A legislative chamber’s procedure system has one job: to say, at any moment, where every measure stands. Who filed it, which committee has it, what happened at each step and which document proves it. When that system is wrong, a public record is wrong.
In 2026 the Cámara de Representantes de Puerto Rico asked us to replace the system it had used for about thirteen years. The new application went live in July 2026, and the current four-year term was migrated into it.
What we found
The old system was a module inside a content-management portal. One SQL Server database held both the chamber’s website (news, galleries, plugins) and its legislative records: measures, procedural history, committees, authors, votes and attendance. Of its 365 tables, many had nothing to do with legislation.
Studying the data before writing any code showed how the system had actually been used:
- No reliable filing date. One of the two date fields was empty for thousands of measures, and for the current term it held the date the row was created, not the date the measure was filed.
- The new term had never been created. Measures from 2025 onward were still attached to the previous four-year term.
- Numbers repeat every term. A measure’s number is reused each term, so without a date filter, authors from 2013 and 2018 attached themselves to 2025 bills.
- History as free text. Each procedural event was a sentence, with committees named inside the text and up to three of them in fixed columns.
- Modules that had stopped being used. No votes had been recorded since 2016.
- One editor, no history. Legislative records stored only the last person who changed them.
None of these is unusual. They are what thirteen years of daily use does to a system nobody owns end to end.
What we recommended
A system that does one thing completely: the legislative process. The website stays a website. The legislative procedure system became its own application, with the procedure modeled as data rather than prose.
- Each type of measure has a catalog of steps, with prerequisites, so a step cannot be completed before the one it depends on. Seven types of legislation, 298 steps today.
- Committees, legislators and terms are structured records, not names in text.
- Certified documents are generated, not typed. Attendance certifications come out byte-for-byte identical every time they are produced, and a certificate keeps the roster as it was on that day even if the roster later changes.
- Every change has an author. Roles carry explicit permissions (read, edit, delete, download, take attendance, certify), deleted measures leave a record of who deleted them and what was lost, and the records office can certify that it reviewed a measure.
- Boring, maintainable technology. A well-known web framework, a PostgreSQL database and containers, chosen so the chamber’s own team can run it for years.
We did not migrate the old system’s habits. We migrated its facts, and checked each one.
What we built and how we moved the data
The migration was written as a repeatable, seven-stage process: terms, catalogs, legislators, committees, measures and authors, subscriptions, and finally the procedural timeline. Two rules governed it:
- Every run is a rehearsal. By default the migration runs inside a transaction and rolls back, so it can be repeated against a clean database as many times as needed. Saving takes an explicit decision.
- Nothing is invented. If the old data did not have a value, the new record leaves it empty and the gap goes on a list for the chamber to complete.
The hardest questions were legal, not technical.
Which date is the filing date? The two old date fields disagreed. We measured both against first-reading records and chose the one that agreed 99.0% of the time, against 94.7% for the other. Validation also showed that an early scoping rule based on the weaker field left most of the term out. The final cut used the corrected rule and carried 2,681 measures.
Which ordinary session does a measure belong to? Each term has eight ordinary sessions, two a year. We wrote the rule, then tested it against thirteen years of the chamber’s own session days: it agreed on 478 of 482, or 99.2%. The four exceptions were typos in the old session titles.
How do sentences become steps? Each historical event was matched to a step of the new catalog by type of legislation. About 97% matched automatically. The rest were resolved with a reviewed override table and sixteen steps the procedure needed but the catalog lacked (hearings, withdrawals, the governor’s actions), until no event was left unresolved.
Before go-live the counts were reconciled: measures, events, documents and steps checked against the expected totals, and every referenced document confirmed present. All 2,949 were.
How it runs now
The system has been in production since July 2026. It started on the chamber’s own offline server and moved weeks later to a containerized setup, with the first installation kept running as the way back until the new one passed its checks.
Each change runs through automated checks and a suite of more than 500 backend tests. Releases carry version numbers that cannot be moved, go first to a staging copy with a database backup and automatic rollback, and reach production only with approval. The production database is backed up every day.
Along the way the team turned each problem into a rule: nothing edited by hand on a server, nothing deployed that is not a tagged release, and no data change applied before it has been rehearsed on a copy.
What we would tell another institution
- Read the data before the requirements. The old system’s real behavior was in its tables, not its manual.
- Separate the record from the website. A legal record deserves its own system, permissions and audit trail.
- Model the procedure. When steps are data, the system can refuse an impossible sequence instead of recording it.
- Make migration repeatable and reversible. If it can only run once, it will run wrong once.
- Reconcile every count before go-live, and write the gaps down instead of filling them.
The best sign that the project worked is the one we described in our essay on invisible systems: on the day the system changed, the chamber’s work went on.
