Skip to content

docs(genai): recount the closed structs and cite the grammar where it is stated - #2110

Open
justinchuby wants to merge 1 commit into
mainfrom
justinchuby/decisions-doc-recount
Open

justinchuby wants to merge 1 commit into
mainfrom
justinchuby/decisions-doc-recount

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

Two facts in the metadata decisions document describe the code inaccurately. Both are in passages that 266820801 ("describe the shipped schema version gate accurately") rewrote, and both were carried through it unchanged.

That is the part worth stating plainly: a correction commit is the worst place for a stale fact. 266820801 is more accurate than what it replaced, but everything it touched now reads as verified-today, including the two facts it merely carried past. An assertion sitting inside a checked repair is harder to doubt than one nobody claimed to have checked.

1. The count is stale, and this design's own implementation moved it

schema/ir.rs no longer carries 45 deny_unknown_fields attributes.

47fda6cea^   parent of the first batching commit   45
47fda6cea    feat(metadata): declare how an encoder batches   46
origin/main                                        49

The document said 45 in two places (§10.4 and §10.6). #2009 — the implementation of the very surface these sections describe — added the structures that moved it. The number was true when written and was falsified by the code it documents.

Fixed to 49, and the derivation is now stated beside it (grep -c deny_unknown_fields) so the next reader can recompute it instead of trusting it. A count in prose has nothing that can falsify it; naming the command it came from gives it one.

2. The citation resolves, and does not say what cites it

schema/mod.rs:62-78 is a real range inside the right doc comment on the right field — and it covers additive fields and the token_packed reshape. The accepted grammar and the normalization rule are at 51-60.

site claim was now
§10.6 "states the accepted grammar and normalization" mod.rs:62-78 mod.rs:51-60
§10.4 "the normalized version contract now documented at" mod.rs:62-78 mod.rs:51-78

§10.4 claims the whole contract, so it now spans 51-78, whose head line is the grammar sentence. §10.6 claims grammar and normalization specifically, so it narrows to 51-60.

This is the failure mode this document argues about, committed by the document: a citation that still resolves is the most durable way to be wrong, because a broken link announces itself and a wrong-but-resolving one does not.

Verification

Content-aware, not line-in-range — each cited span is asserted to contain the symbol or phrase the sentence claims for it:

PASS  schema/mod.rs:51-78  head "Canonically" + "normalize before comparing"
PASS  schema/mod.rs:51-60  head "Canonically" + "readers normalize before comparing"
PASS  schema/mod.rs:38-40  contains deny_unknown_fields
PASS  version.rs:42        contains SUPPORTED_SCHEMA_VERSION
PASS  version.rs:78        contains pub fn gate
PASS  grep -c deny_unknown_fields schema/ir.rs = 49, matching the document
PASS  no stale "45 more" / "45 occurrences" remains (checked whitespace-normalised,
      so a line wrap cannot hide one)

capability_catalogue, which include_str!s this document, selects 3 (confirmed with --list before reading the result) and passes 3. Full onnx-genai-metadata: 344 passed, 0 failed.

git diff --check clean. Docs-only: one file, four factual corrections and one reflow, no contract or design change.

Credit

Both defects were found by the schema agent auditing 266820801 against the code it describes, after I had checked only version.rs:42,78 by content and left the third citation and the count uninspected.

… is stated

Two facts in section 10.4 and section 10.6 describe the code inaccurately.
Both were carried unchanged through 2668208, which corrected the sentences
around them; a repair certifies its own neighbourhood, so a stale fact inside
one is harder to doubt than a stale fact on its own.

The count is stale because this design's own implementation moved it. #2009
added structures to schema/ir.rs, so `grep -c deny_unknown_fields` went 45 to
46 at 47fda6c and reads 49 on main. Both sites said 45. The derivation is
now stated beside the number so the next reader can recompute it rather than
trust it.

The citation resolves but does not say what cites it. `schema/mod.rs:62-78`
covers additive fields and the token_packed reshape; the accepted grammar and
the normalization rule are at 51-60. Section 10.6 claimed grammar and
normalization from 62-78 and now cites 51-60; section 10.4 claimed the whole
normalized contract and now cites 51-78, whose head line is the grammar.

Verified by content, not by range: each cited span is asserted to contain the
symbol or phrase the sentence claims for it, and the count is asserted against
the grep it names. capability_catalogue, which include_str!s this document,
selects 3 and passes 3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.73%. Comparing base (d30118a) to head (293ac46).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2110      +/-   ##
==========================================
+ Coverage   80.32%   80.73%   +0.41%     
==========================================
  Files         426      429       +3     
  Lines      204769   214808   +10039     
  Branches   204769   214808   +10039     
==========================================
+ Hits       164484   173431    +8947     
- Misses      34664    35611     +947     
- Partials     5621     5766     +145     
Flag Coverage Δ
cli-ort-linux 72.51% <ø> (?)
cli-ort-windows 72.01% <ø> (-0.10%) ⬇️
mlas 85.90% <ø> (?)
offline 80.86% <ø> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 69 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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