Skip to content

A temporary code is a code the status checker can see - #205

Merged
dmarx merged 1 commit into
mainfrom
claude/temp-codes-have-standing-e6evzh
Sep 7, 2026
Merged

A temporary code is a code the status checker can see#205
dmarx merged 1 commit into
mainfrom
claude/temp-codes-have-standing-e6evzh

Conversation

@dmarx

@dmarx dmarx commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Closes #203.

Options (1)+(2) from the issue. luria link --fix has always treated a merge-allocated code as a code; ref_status never did, and the halves disagreeing was the bug.

The fix

The issue worried that (1) means widening documents(), whose dict[int, Path] return five call sites were deliberately consolidated onto. It doesn't. adr_index.load_scheme(scheme) already returns numbered documents plus temporary ones, and Adr.code already spells either — so ref_status._load_scheme asks that function instead of re-deriving the answer, and documents() keeps answering "every numbered document", which is a different question and still the right one for its callers.

  • CODE_RE composes config.TEMP_TAIL rather than restating the shape.
  • The scan loop runs each scheme's temp_pattern alongside its numeric one.
  • _codes() (which parses a directive's arguments) keeps temporary tails whole instead of int()-ing them, so an acknowledgement can name one.

Five tests, written first, three of which failed for the right reasons before the change.

What it found on its first run here

Five source comments cited ADR-tmpstat1 — in config.py, contract.py, init.py, site.py and statuses.py. No document has ever answered to that tail: it is not a minted one and it is in no formerly: list. It was hand-written as a placeholder for the decision that became ADR-085, and because nothing scanned temporary codes, five source files claimed a decision explained them while the claim resolved nowhere. Corrected to ADR-085.

That surfaced the finding underneath, which this PR leaves visible:

luria: 1 warning(s) — retired documents cited unacknowledged from current docs/code
  ADR-085 is Proposed, cited 5× in 5 file(s) — Status is an ordinary controlled
  vocabulary; a built-in is a declaration nobody wrote

ADR-085 shipped; it is still Proposed. That is exactly the drift the module exists to report, so it is not acknowledged — an inactive-ok: would go stale the moment the decision is accepted. pending-documents now reads "3 undecided document(s), oldest 1 days, 1 with unacknowledged references". Accepting ADR-085 (and 084, 086) clears it. Warning class, so CI is unaffected.

The one-time cost

The check is unmasked by design, so an illustration of the temporary shape reads as a citation. Eleven sites here — ADR-049's prose, the README transcript, the CLI page, CONTRIBUTING.md, fixture tails in three test files — cleared with nine unresolved-ok acknowledgements.

Every record that documents merge allocation pays this once. anthology-of-the-sota has exactly one (LIT-tmp3kf9x, in its ADR-013), and the acknowledgement has to be filed with the version bump: on the older luria the code is not scanned, so the directive excuses nothing and gets reported stale.

Fired before trusting (DP-6)

python -m pytest tests -q → 937 passed. luria lint → the ADR-085 warning above, otherwise unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YP4P3m8rzVFb8idnTE4FfT


Generated by Claude Code

Reference resolution handled merge-allocated codes; reference standing did
not. `ref_status` loaded a scheme through `documents()`, which keys by number
and skips any file it cannot get one from, and matched codes with a
digits-only pattern — so a temporary document was neither loaded nor cited.
Both blind spots had to hold for the finding to stay hidden, and both did:
for the whole life of a pull request filing merge-allocated documents,
citations among them went unchecked, and the findings appeared only after
the merge that concretized the codes.

`documents()` keeps its return type. `adr_index.load_scheme()` already
returns numbered documents plus temporary ones and `Adr.code` already spells
either, so `_load_scheme` asks it instead of re-deriving the answer.
`CODE_RE` composes `TEMP_TAIL` rather than restating it, and the scan loop
runs each scheme's `temp_pattern` alongside its numeric one.

Fired on both real corpora. Here it found five source comments citing
`ADR-tmpstat1`, a tail no document has ever answered to — corrected to
ADR-085, which then surfaced the finding underneath: the decision is still
Proposed and the code that implements it cites it as settled. That one is
left visible. The illustrations of the temporary shape — ADR-049's prose,
the README transcript, fixture tails — carry `unresolved-ok`
acknowledgements now.

Closes #203

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YP4P3m8rzVFb8idnTE4FfT
@dmarx
dmarx merged commit ce4a942 into main Sep 7, 2026
5 checks passed
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.

A merge-allocated document is invisible to the status checker, from both ends

1 participant