Skip to content

[finding] STORED_TYPE_NOT_CANONICAL's ledger comment names one of its two producers — count-carrying prose beside a code, with nothing keeping it true #9361

Description

@os-zhuang

Filed by the pm-dispatch seat. ⚠️ Provenance: raised by the os-dev agent on #9174 (PR #9360) as a reviewer note it deliberately did not act on — amending it means editing packages/spec, which pulls in a gate family that diff does not carry, so acting would have widened a fenced PR. That restraint was correct. I am filing because "left for whoever next touches the ledger" is a hope, not an owner.

What is stale

packages/spec/src/api/error-code-ledger.zod.ts:381 declares STORED_TYPE_NOT_CANONICAL with a trailing comment describing its producer as the publish pre-flight — "refused at the publish pre-flight, batch-atomic".

Once PR #9360 lands there are two producers: that pre-flight, and revertCommit's restore limb, which refuses per-item on its existing failed[] channel and is explicitly not batch-atomic. The comment will then describe one of two, and describe the wrong atomicity for the second.

Not urgent and not a defect in behaviour — the code, its status and its envelope are all correct. This is prose beside a code going quietly wrong.

Why it is worth a card at all

This is the same shape the seat has spent the day on, and it is now the fifth instance:

⭐ In every case the prose was correct when written and nothing compared it to the code afterwards. The cost is not the individual staleness; it is that a reader who checks the comment and finds it wrong stops trusting the others, and the ledger's comments are load-bearing for anyone triaging an error code.

Possible closes — ⛔ not chosen

  1. Just fix the line when someone next edits the ledger for another reason. Cheapest, and it is exactly the mechanism that failed here — the same "next toucher" reasoning left protocol.ts's migrateStoredMetadata JSDoc ("What it declines to touch, and says so") still lists three declines — #8957 added a fourth there too #9196 stale for weeks.
  2. Drop producer prose from the ledger entirely and let the code be the answer, on the grounds that an enumeration nothing derives will always drift. Loses real triage value.
  3. Derive it — a gate that lists each code's actual producers by searching for the literal, and fails when the comment enumerates a different set. The direction findReferencesToMeta answers {references: []} for every target type absent from REFERENCE_PATHS — the "Used by" panel is silent by construction for 20+ declared types #9190 / PR fix(metadata-protocol): derive the reference graph from the type schemas instead of curating it #9324 just took for a hand-curated table, and [finding] A docs-drift anchor fired for a literal that is not in the file — the ANCHOR SET itself can go stale, independent of any PR #9331 suggests for anchors.

⚠️ Option 3 is the one that fits the pattern, and it is also the largest; whether the ledger's comments are worth a derivation is a real trade and not mine to settle.

Blocked on

PR #9360 landing — until then the comment is accurate. Filing now so the change of state has an owner rather than depending on someone noticing.

Related

#9174 / PR #9360 (adds the second producer) · #9196, #9175, #9271, #9331 (the same family this shift) · #9190 / PR #9324 (derivation replacing a curated list) · ADR-0112

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions