Skip to content

Test the written path of staging reconciliation's failed outcome and update its failure documentation - #243

Merged
anth-volk merged 2 commits into
mainfrom
staging-reconciliation-follow-up
Oct 20, 2026
Merged

anth-volk merged 2 commits into
mainfrom
staging-reconciliation-follow-up

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Fixes #242

Summary

Follow-up to #237, from its review after merge. That review found no bugs; this PR fixes two small gaps in #237's record-and-continue change. Nothing that runs in production changes: one commit adds a test, the other changes documentation.

Since #237, staging reconciliation reports a run it can't publish or repair as failed, reconciles the remaining runs, and then exits with status 1.

  1. Test for a reconciliation that writes. Keep same-named UK constituencies and local authorities apart in the calibration views #237's two tests of the failed outcome both run as dry runs. The new test in publish-calibration-tree-golden.test.ts runs a reconciliation that writes, using a store that records every operation. The newer of two UK staging runs has a manifest entry whose repair is refused. It checks:
    • the refused run is audited and then left alone: no upload and no manifest write;
    • the next run is uploaded, written to the manifest, listed again and audited, in that order, and reported published;
    • the manifest keeps the refused run's entry unchanged and gains exactly one entry.
  2. Failure documentation. In docs/calibration-tree-artifacts.md, "Failure meanings and recovery" said a failed publisher workflow means publication didn't complete. It now separates the two kinds of run:
    • Release: reconciliation stops at its first error.
    • Staging: the workflow either stopped before reconciling any run, or printed a report in which every run without a failed outcome was reconciled. Every later staging workflow for that country retries the failed runs. Rerunning doesn't correct a refused repair of a published tree.

Commits

Commit What Red Green
c5b7208 Test the written path of a failed staging reconciliation No red step: the behaviour is already correct, so there's no bug for the test to fail on. As a check, I changed the per-run error handling to rethrow in a run that writes, without committing it: the test failed (0 passed, 1 failed, "Rebuilt staging index differs from immutable manifest entry aaaa…"). I then restored the file. 7 of 7 in publish-calibration-tree-golden.test.ts
0428dc0 Describe what a failed staging publisher workflow means since #237 Documentation only, so no red step —

Tests run

Locally at the head (0428dc0), only the test file this branch changes: publish-calibration-tree-golden.test.ts, 7 passed and 0 failed. bun run lint (the dashboard and package typecheck) is clean. I didn't run the full suites; CI runs them.

Deploy order and #239

Environment variables

None. No workflow, deploy script, packaging or configuration changes, and the new test reads no environment variables. It sets nothing beyond what the neighbouring tests in the file already use.

🤖 Generated with Claude Code

anth-volk and others added 2 commits October 20, 2026 20:50
#237's tests of the `failed` staging outcome run as dry runs, so none
covered a reconciliation that writes. The new test runs one with a
recording store. A refused repair of one run is audited and left alone:
no upload and no manifest write. The next run is uploaded, written to
the manifest, listed again and audited, in that order. The manifest
keeps the refused run's entry unchanged and gains exactly one entry.

The code is already correct, so the test passes on this branch's base.
Changing the per-run error handling to rethrow in a run that writes
makes it fail (0 passed, 1 failed).

Refs #242

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Failure meanings and recovery" said a failed publisher workflow means
publication didn't complete. Since #237 that holds for releases only.
A failed staging workflow either stopped before any run, or printed a
report in which every run without a `failed` outcome was reconciled.
Every later staging workflow for that country retries the failed runs.
Rerunning doesn't correct a refused repair of a published tree.

Documentation only, so there is no red step.

Refs #242

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
calibration-diagnostics Ready Ready Preview Oct 20, 2026 4:52pm UTC

Request Review

@anth-volk
anth-volk merged commit 19be8dc into main Oct 20, 2026
5 checks passed
@anth-volk
anth-volk deleted the staging-reconciliation-follow-up branch October 20, 2026 18:14
anth-volk added a commit that referenced this pull request Oct 20, 2026
#239 merged into main as dec6ed1 with its last fixes (e5367a0, b51b5c5),
and #243 merged after it. This branch had taken #239 before those fixes,
so the merge conflicted in seven files.

The result is main's tree plus this branch's own changes, the diff from
#239's head it last merged (ee84664) to this branch's head (2e43079):
#239's files take main's final code, and this branch's changes apply
without conflicts. git diff origin/main HEAD now shows only this branch's
own changes: the same 22 files and changed lines as ee84664..2e43079.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 0428dc0a Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test the written path of staging reconciliation's failed outcome and update its failure documentation

1 participant