← All research

Government

Case study: replacing a legislative procedure system

Thirteen years of legislative history lived in a web portal’s database. We replaced it with a system built for one job, tracking every measure from filing to final vote, and moved the current term across with every record reconciled.

9 min read

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.

2,681measures of the current term migrated and reconciled
20,557procedural events carried into the new timeline
2,949documents linked, with none missing
146committees migrated with their members

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:

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.

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:

  1. 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.
  2. 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

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.

Talk to the person who signed it.

Talk to us