DEV Community

Suudipta Mukherjjee
Suudipta Mukherjjee

Posted on

Three locks between a tax-data draft and production

The IRS has published its 2027 inflation adjustments (Rev. Proc. 2026-35 and Notice 2026-66). Within days, the 2027 tax data for CalculatorManager was written and merged into main.

The live site still runs on 2026 figures, and that's deliberate. Most people filing in spring 2027 are filing a 2026 return, so 2026 has to stay the default until January. A new year's data also isn't finished the day the IRS publishes: some sources arrive weeks later.

So the question was how to let a half-finished year live in main with no risk of it reaching a visitor. The answer is three independent locks, plus a fourth that turned out to be the most useful.

Every year has a status

Each tax year's figures live in their own file, and a small manifest gives every year one of three statuses:

  • current: what the calculators load by default
  • archived: an older year, still selectable, and frozen
  • draft: in the repository, never served

Everything below hangs off that one field.

Lock 1: the build strips drafts

The deploy step that copies tax data into the published site skips any year marked draft, removing both its file and its entry in the manifest. On production, a draft year isn't hidden or unlinked; it doesn't exist. Merging the 2027 draft redeployed the site with zero visible change.

Lock 2: the UI ignores drafts too

The year selector filters out drafts before it builds its dropdown. In production that's redundant, because lock 1 has already removed them. It matters when running from source locally, where the build step is skipped. Cheap insurance.

Lock 3: the data check fails the build

A QA script runs over every year's data and fails the build if the rules are broken. Among them:

  • exactly one year is current, and it can never be a draft
  • archived years are frozen: a hash of each archived file is recorded when it's archived, and any later change to that file fails the build

The freeze matters because old years stay on the site permanently. Someone checking last year's figures should get them exactly as published, not as someone "tidied" them later.

The same script checks figures against each other. Social Security bend points, for example, are re-derived from the national average wage index and compared with the stored values. That caught a real mistake in this year's draft: the payroll wage base had been updated but the Social Security figures hadn't, and the check refused to pass until they agreed.

The fourth lock: tests pinned to a year

The calculation engines have 4,125 hand-worked test assertions, written against the current year's figures. As an experiment, I switched 2027 to current on a scratch copy and ran them: 105 failed.

That's not a bug, it's the design. Each failure is a hand-worked answer that has to be redone with 2027 figures before the switch can ship. Publishing a new year forces someone to re-derive the expected answers rather than trust the new data.

What publishing will look like

In January it's a small change: 2027 becomes current, 2026 becomes archived and gets frozen, and the reworked test answers go in. The year selector then gets a second option, and 2026 stays available, unchanged, for anyone who needs it.

None of this is clever. Tax figures on a calculator site are read by people making real decisions, and the expensive mistake isn't a crash; it's a confident wrong number. Making "merged" and "published" two separate steps is the cheapest way I know to avoid that.

Top comments (0)