Skip to content

Govreview 2b — contracts stop describing behaviour that changed under them - #282

Open
Polichinel wants to merge 1 commit into
developmentfrom
docs/govreview-p2b-doc-code-staleness
Open

Govreview 2b — contracts stop describing behaviour that changed under them#282
Polichinel wants to merge 1 commit into
developmentfrom
docs/govreview-p2b-doc-code-staleness

Conversation

@Polichinel

Copy link
Copy Markdown
Contributor

Phase 2b. The class where a change landed, sibling documents were updated, and the document describing the behaviour was not. 5 findings, 3 of the review's 9 contradictions.

The one a consumer could act on

docs/CICs/FrameMetadata.md §6:

"Field set to a non-JSON type, then saved via npz | Silently stringifiedio/npz.py uses json.dumps(..., default=str)"

That default=str was deleted on 2026-08-18 to close register C-90 — three hours after the CIC was written. A consumer reading §6 today builds a workaround for a bug that has not existed since August, guided by a quotation of a line that no longer exists.

Its §10 said three guarantees are "not pinned by anything". The same commit added all three tests.

The commit stat shows why it was missed:

5423431 updated  PredictionFrame.md, Summarize.md, TargetFrame.md
        and not  FrameMetadata.md

The CIC that described the gaps was the one document not updated when they closed. Fifth recorded instance of the pattern C-96 names.

The rest

Document Said Actually
Reconcile.md writing .values "may corrupt shares" raises ValueError since 2.0.0
README.md scripts/ — "none wired into CI" two of six run in the docs job
research note tip_mass default 0.5 0.25 since Amendment 3

The README line is mine twice over — false since 18 Aug when I wired in check_arch_tree.py, more false this afternoon when I added check_doc_refs.py. It sits inside the tree check_arch_tree.py validates, but that check reads module paths and ignores the prose beside them.

§10 rewritten, not deleted

The gap items now name their closing tests. A CIC states its guarantees whether or not a test exists (ADR-006), and this document is why the gaps were found — written, noticed, closed the same day. Check 12 now verifies 21 test references instead of 19, so the newly-named tests are guarded against renaming.

Also fixed: a tests/test_select.py:88 citation, which the register's own convention forbids — "name things, never line numbers".

One finding did not survive verification

F-B8-03 is withdrawn. It claimed research/figures/NOTE.md predates Amendment 4's correction to the MAP-containment law. It does not — the note says "more than half the tip floor's draws", the corrected formulation, matching the shipped 2 * n_floor > n_tip. The pre-correction version counted index spans. Already right; not touched.

validate_docs.sh   PASSED (14 checks, 21 test refs)
check_doc_refs.py  PASSED · ruff · pytest --cov 100%

🤖 Generated with Claude Code

Phase 2b of the governance consistency review — the class where a change landed,
sibling documents were updated, and the document describing the behaviour was not.
5 findings, 3 of the review's 9 contradictions.

**docs/CICs/FrameMetadata.md was wrong about the code it cites.** Its §6 table said a
non-JSON metadata field is "**Silently stringified** — `io/npz.py` uses
`json.dumps(..., default=str)`" while arrow raises. Commit 5423431 deleted that
`default=str` on 2026-08-18 to close register C-90, three hours after this CIC was
written. A consumer reading §6 today would build a workaround for a bug that has not
existed since August, guided by a quotation of a line that no longer exists.

**Its §10 said three guarantees are "not pinned by anything".** The same commit added
all three tests. The commit stat shows why it was missed: 5423431 updated
PredictionFrame.md, Summarize.md and TargetFrame.md — and not FrameMetadata.md. The
CIC that described the gaps was the one document not updated when they closed.

Both are mine, from the same day, and together they are the fifth recorded instance of
the pattern C-96 names: a fix that reaches the instance and not the class.

The §10 items are rewritten to name their closing tests rather than deleted. A CIC
states its guarantees whether or not a test exists (ADR-006), and this document is the
reason the gaps were found at all — written, gaps noticed while writing, gaps closed
the same day. `docs/validate_docs.sh` check 12 now verifies 21 test references instead
of 19, so the three newly-named tests are themselves guarded against renaming.

**docs/CICs/Reconcile.md** told the reader that writing to `.values` "may corrupt
shares". Since 2.0.0 it raises `ValueError` (ADR-028 / C-66) — the corruption it warns
about is no longer reachable.

**README.md** said `scripts/` holds "standalone dev tools, none wired into CI". Two of
six run in the `docs` job. I made that false on 2026-08-18 by wiring in
`check_arch_tree.py` and more false this afternoon by adding `check_doc_refs.py`. The
line sits inside README's directory tree, which `check_arch_tree.py` validates — but
that check reads module paths and ignores the prose beside them.

**research/coherent_posterior_summary_note.md** asserted `tip_mass` default `0.5`. It
has been `0.25` since ADR-019 Amendment 3 (2026-07-24). The note carries a v1.3.0
stamp, so the value was right when written; it now says both.

Also corrected: a `tests/test_select.py:88` citation, which the register's own
convention forbids — "name things, never line numbers", because line numbers drift
silently. It now names `test_select_preserves_metadata`.

**One finding did not survive verification and is not fixed.** F-B8-03 claimed
`research/figures/NOTE.md` predates Amendment 4's correction to the MAP-containment
law. It does not: the note says "every floor holding more than half the tip floor's
**draws**", which is the corrected formulation and matches the shipped
`2 * n_floor > n_tip`. The pre-correction version counted index spans. The note was
already right.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant