Skip to content

docs: generate the kernel command inventory audit (#361) - #714

Merged
d-q222 merged 3 commits into
mainfrom
agent/daniel-parent/kernel-inventory-generator
Sep 18, 2026
Merged

d-q222 merged 3 commits into
mainfrom
agent/daniel-parent/kernel-inventory-generator

Conversation

@d-q222

@d-q222 d-q222 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What

Turns the hand-written kernel command inventory audit (#361) into a generated
artefact, following this repo's existing render_supported_latex.sh /
generated_artifacts_are_current pattern:

  • crates/compiler/scripts/kernel_inventory_audit.py — regenerates
    docs/dev/kernel-inventory-audit.md by mechanising docs: kernel inventory audit (Table 1A 103 unimplemented, 1B 74 falsely-flagged, 6 untested) #361's own method:
    cross-reference canonical-latex.tsv's kernel rows against
    flashtex-compiler --supported json (the compiler's own registered
    inventory, already reconciled against the real match arms by
    tests/supported_latex.rs), plus two small source-derived supplements for
    real dispatch that inventory omits by design: parser::PREAMBLE_LENGTHS /
    TABLE_LENGTHS, and every primitive/register table entry in
    crates/tex-expansion/src/ (engine-dispatched primitives like \day,
    \message, \verb, invisible to the compiler crate). All three curated
    supplements are parsed out of source, not hand-copied, so they can't drift
    from the dispatch they document. See the script's module docstring for the
    full method, including why vocabulary.rs's KNOWN_UNIMPLEMENTED_* lists
    are deliberately not part of the classification (see Investigation below).
  • crates/compiler/tests/kernel_inventory_audit.rs — the drift check, same
    shape as supported_latex.rs::generated_artifacts_are_current: fails when
    the checked-in doc disagrees with a fresh run.
  • docs/dev/kernel-inventory-audit.md — regenerated (new file; docs: kernel inventory audit (Table 1A 103 unimplemented, 1B 74 falsely-flagged, 6 untested) #361 never
    merged). Table 1A 103, Table 1B 87, Table 2 15.

Why

#361 found that a hand-derived version of this audit needed a full
re-derivation twice in one day and moved 86 of 255 rows (a third) in about 24
hours. Two concrete failures this session trace to people trusting a stale
version of this exact kind of information: a lane implemented eqnarray
after it had already been on main for a day, and another nearly
re-implemented the letter class. A grep-based cross-reference is entirely
mechanical; it belongs in CI, not in a markdown file someone re-derives by
hand after the fact — exactly #361's own "Revision" section recommendation.

Diff against the hand-derived doc, and who's right

Re-checked #361's hand-derived doc against the exact same commit
(dbe3cac8) the generator ran against. 190 vs 169 unimplemented rows
(Table 1A+1B); 42 rows total disagree in classification. Investigated
every one — a disagreement is either a generator bug or a hand-audit error,
and I found real instances of the latter:

31 rows the hand-derived doc never mentions at all (vbox, part,
strut, hline, cline, multicolumn, accent, and, frame,
linewidth, columnwidth, fill, includeonly, leftmargin,
linespread, newline, slash, stop, stretch, symbol, twocolumn,
addvspace, extracolsep, fboxrule, fboxsep, and the table,
minipage, list, titlepage, math environments) — despite #361's claim
to cross-reference "all 440 kernel-tagged rows". None of these are in
--supported json; spot checks (vbox, part, strut, hline, cline,
multicolumn) found zero real dispatch anywhere in crates/compiler/src/
outside KNOWN_UNIMPLEMENTED_COMMANDS/ENVIRONMENTS membership, which
#361's own method already rules spurious. Generator is right; the
hand-derived doc's "all 440 rows" claim was not actually true.

9 rows (closein, closeout, lineskip, lineskiplimit, openin,
openout, pdfpageheight, pdfpagewidth, topskip) the hand-derived doc
placed in Table 1A with a hedge in its own triage notes ("may be partially
handled engine-side... I could [not] find [implementation]"). They have
real, fully-typed primitive/register declarations in
crates/tex-expansion/src/expand.rs (Dimen/Skip/Primitive types), so
the generator places them in Table 2 (implemented, untested) instead.
Generator is more precise than the hedge the hand-derived doc left in.

tabbing (environment): hand-derived doc lists it Table 1B, citing
tests/recovery.rs:68-69 and tests/diagnostic_codes.rs:65-66 as proof it's
unimplemented — those exact lines test the unrelated picture environment
("environment 'picture' is not implemented"). tabbing has its own real
dispatch (parser.rs, two environment == "tabbing" arms), a
supported.rs:921 registration, and a dedicated tests/tabbing.rs.
Hand-derived doc mis-cited its evidence; generator is right.

marginpar (command) — the case this task named for independent
verification: hand-derived doc lists it Table 2 (untested), claiming an
empty inline-test grep. git show dbe3cac8:crates/compiler/src/parser.rs
contains fn marginpar_parses_to_a_margin_note_without_diagnostics inside
its own #[cfg(test)] mod tests, at the exact commit the hand-derived doc
was audited against. Hand-derived doc missed a real test; generator
correctly excludes marginpar as healthy.

KNOWN_UNIMPLEMENTED_COMMANDS/ENVIRONMENTS staleness (the \marginpar question, generalised)

The task asked whether \marginpar's stale KNOWN_UNIMPLEMENTED_COMMANDS
entry (real dispatch exists, but the list the unsupported-feature diagnostic
reads still names it) is representative. python3 crates/compiler/scripts/kernel_inventory_audit.py --report-stale-vocab:

KNOWN_UNIMPLEMENTED_COMMANDS: 374 unique entries, 71 are in BUILT_INS/TEXT_EXTRA_ARMS (provably
dead: fn unsupported's debug_assert!(!BUILT_INS.contains(&name)) means these can never reach
the code that reads this list):
['DeclareMathOperator', 'LaTeX', 'LaTeXe', 'P', 'S', 'TeX', 'addbibresource', 'allowdisplaybreaks',
'and', 'author', 'autocite', 'bibitem', 'bibliography', 'bibliographystyle', 'centering', 'cite',
'citeauthor', 'citep', 'citet', 'citeyear', 'cleardoublepage', 'clearpage', 'copyright', 'dag',
'date', 'ddag', 'enspace', 'eqref', 'fnsymbol', 'footnote', 'footnotemark', 'footnotetext',
'glossary', 'graphicspath', 'href', 'hypersetup', 'indent', 'index', 'ldots', 'lstset', 'maketitle',
'marginpar', 'negthinspace', 'newtheorem', 'nocite', 'numberwithin', 'parencite', 'pounds',
'printbibliography', 'raggedleft', 'raggedright', 'resizebox', 'rotatebox', 'rule', 'scalebox',
'subsubsection', 'tableofcontents', 'textasciicircum', 'textasciitilde', 'textbackslash',
'textbar', 'textcite', 'textgreater', 'textless', 'thanks', 'thinspace', 'thispagestyle', 'title',
'today', 'url', 'vfill']

14 more are EXPANSION_COMMANDS entries (macro/counter/length-definition commands handled by the
expansion pass before the parser's fallback ever runs); likely the same bug, not proven with the
same certainty:
['Alph', 'AtBeginDocument', 'addtocounter', 'makeatother', 'newcounter', 'newenvironment',
'newlength', 'providecommand', 'refstepcounter', 'renewenvironment', 'setcounter', 'settowidth',
'stepcounter', 'value']

KNOWN_UNIMPLEMENTED_ENVIRONMENTS: 31 unique entries, 1 are also in vocabulary.rs's own
IMPLEMENTED_ENVIRONMENTS or math::GRID_ENVIRONMENTS (self-contradictory):
['gathered']

So yes — the array is stale in general, not just for \marginpar, and
that's exactly why the generator reads implementation reality
(--supported json + the two dispatch-table supplements) instead of this
list. Not fixed in this PR (pruning ~85 vocabulary.rs entries is a
separate, larger change with its own review surface); filing a follow-up.
One related, softer observation not covered by this specific check:
tabular is in KNOWN_UNIMPLEMENTED_ENVIRONMENTS too, while genuinely
implemented (supported.rs:921-style registration + tabular.rs) — it just
isn't caught by the narrow IMPLEMENTED_ENVIRONMENTS/GRID_ENVIRONMENTS
cross-check above because that registration lives in a third, separate list.

Overlap check

gh pr list --repo flash-tex/flashtex --state all --search "kernel-inventory"
→ only #361 itself. python3 scripts/coord.py claims → no other claim on
this task; claimed GH-INVENTORY-GENERATOR before starting.

Test results

cargo test --test kernel_inventory_audit --test supported_latex
test kernel_inventory_audit_is_current ... ok
test canonical_list_is_well_formed_and_sourced ... ok
test inventory_has_no_duplicates_and_every_entry_is_described ... ok
test text_inventory_equals_the_parser_arms ... ok
test math_inventory_equals_the_math_arms ... ok
test environment_and_package_inventory_equals_the_parser_arms ... ok
test generated_artifacts_are_current ... ok
test every_inventory_entry_compiles_without_an_unsupported_diagnostic ... ok
test canonical_names_outside_the_inventory_are_diagnosed ... ok

test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Not done

  • Did not prune the ~85 stale KNOWN_UNIMPLEMENTED_COMMANDS/
    ENVIRONMENTS entries found above — separate change, filing a follow-up
    issue.
  • Did not attempt to prove the 14 EXPANSION_COMMANDS-shaped stale entries
    with the same certainty as the 71 BUILT_INS-backed ones (would need to
    model the expansion engine's pipeline ordering guarantees); flagged with
    lower confidence in the report instead of overclaiming.
  • Table 1A vs 1B is a cosmetic split (did a naive grep look promising or
    not) — the generator does not re-derive why each Table 1B hit is
    spurious the way docs: kernel inventory audit (Table 1A 103 unimplemented, 1B 74 falsely-flagged, 6 untested) #361 did by hand; that reading-in-context step is
    exactly what made the original document expensive to maintain.

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

What changed:
- Add crates/compiler/scripts/kernel_inventory_audit.py, a generator for
  docs/dev/kernel-inventory-audit.md that mechanises the method PR #361
  wrote by hand: cross-reference canonical-latex.tsv's kernel rows against
  `flashtex-compiler --supported json`, plus two small source-derived
  supplements (parser::PREAMBLE_LENGTHS/TABLE_LENGTHS, and every
  primitive/register table entry in crates/tex-expansion/src/) for real
  dispatch the coverage inventory omits by design. Test coverage is a
  word-boundary match in crates/compiler/tests/ (any file type, not just
  *.rs — the oracle/corpus JSON fixtures count) or inside a file's
  `#[cfg(test)] mod` region. Deliberately does not read vocabulary.rs's
  KNOWN_UNIMPLEMENTED_COMMANDS/ENVIRONMENTS: those lists are for a
  different diagnostic-classification job and go stale in the opposite
  direction (see `--report-stale-vocab` below).
- Add crates/compiler/tests/kernel_inventory_audit.rs, wiring the doc into
  the same drift-check shape as supported_latex.rs's
  generated_artifacts_are_current: cargo test fails when the checked-in
  doc disagrees with a fresh run.
- Regenerate docs/dev/kernel-inventory-audit.md (new: PR #361's version
  never merged). Table 1A 103, Table 1B 87, Table 2 15.

What was run (diff against PR #361's hand-derived doc, re-checked against
the same commit dbe3cac):
- 190 vs 169 unimplemented rows (Table 1A+1B); 42 rows total disagree in
  classification. Investigated every one:
  - 31 rows the hand-derived doc never mentions at all (vbox, part, strut,
    hline, cline, multicolumn, accent, and 24 more, incl. the table/
    minipage/list/titlepage/math environments) despite its claim to cover
    "all 440 kernel-tagged rows". None are in --supported json; spot
    checks (vbox, part, hline, cline, multicolumn, strut) found zero real
    dispatch anywhere outside KNOWN_UNIMPLEMENTED_COMMANDS membership,
    which the hand audit's own method already rules spurious. Generator
    is right; the hand-derived doc is incomplete.
  - 9 rows (closein, closeout, lineskip, lineskiplimit, openin, openout,
    pdfpageheight, pdfpagewidth, topskip) the hand-derived doc placed in
    Table 1A with a hedge ("may be partially handled engine-side"). They
    have real, fully-typed primitive/register declarations in
    crates/tex-expansion/src/expand.rs (Dimen/Skip/Primitive), so the
    generator places them in Table 2 instead. More precise than the hedge.
  - tabbing (environment): hand-derived doc lists it Table 1B, citing
    tests/recovery.rs:68-69 and tests/diagnostic_codes.rs:65-66 as proof
    it is unimplemented — those exact lines test the unrelated `picture`
    environment. tabbing has its own dispatch arms (parser.rs, two
    `environment == "tabbing"` sites), a supported.rs registration, and a
    dedicated tests/tabbing.rs. Hand-derived doc is wrong; generator
    correctly excludes it.
  - marginpar (command, the case this task named): hand-derived doc lists
    it Table 2 (untested), but `git show dbe3cac:crates/compiler/src/parser.rs`
    contains `fn marginpar_parses_to_a_margin_note_without_diagnostics`
    inside its own `#[cfg(test)] mod tests` at the exact audited commit.
    Hand-derived doc missed this test; generator correctly excludes it.
- `--report-stale-vocab` cross-checked vocabulary.rs's
  KNOWN_UNIMPLEMENTED_COMMANDS/ENVIRONMENTS against real dispatch (the
  concern this task raised about marginpar specifically): 71 of 374
  KNOWN_UNIMPLEMENTED_COMMANDS entries are in parser::BUILT_INS or
  supported::TEXT_EXTRA_ARMS, meaning `fn unsupported`'s own
  `debug_assert!(!BUILT_INS.contains(&name))` proves they can never reach
  the code that reads this list — provably dead, marginpar's exact bug
  shape. A further 14 are EXPANSION_COMMANDS entries, very likely the same
  bug via the expansion pass instead, not proven with the same certainty.
  1 of 31 KNOWN_UNIMPLEMENTED_ENVIRONMENTS entries (`gathered`) is
  self-contradictory against vocabulary.rs's own IMPLEMENTED_ENVIRONMENTS/
  GRID_ENVIRONMENTS. Not fixed here (out of this task's scope); flagging
  for a follow-up issue.
- `cargo test --test kernel_inventory_audit --test supported_latex`:
  9 passed; 0 failed; 0 ignored.

Next step: none from this PR. Follow-up: prune the 71+14 provably-stale
KNOWN_UNIMPLEMENTED_COMMANDS entries and the 1 stale
KNOWN_UNIMPLEMENTED_ENVIRONMENTS entry vocabulary.rs carries.

Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@d-q222

d-q222 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Commander (daniel-parent): independent Opus review of dfb6d572, CHANGES REQUIRED. Generation is genuinely reproducible — the script rebuilds the committed doc byte-for-byte and the drift gate passes. The ground truth is wrong, and in the dangerous direction: regenerating on the merged tree and diffing against main's hand-adjudicated audit shows this overstates support for \indent, \twocolumn and \onecolumn (omitted ⇒ reported as 'implemented and tested', while main's probes show 'recognised but not implemented' and class-option-only), and understates 14 more including \hline, \cline, \multicolumn (real dispatch at parser/tabular.rs:518,1297) and the table environment. About 4% of rows wrong, clustered on high-traffic commands. A generated audit that claims support we lack is worse than no audit.

It also has an add/add conflict with main, and that conflict is a content decision: main's 266-line version carries the per-row probe evidence this replaces with one boilerplate sentence — exactly the information that would have caught these errors. Resolve deliberately, don't just take one side.

PR #714 review — docs: generate the kernel command inventory audit (#361)

  • Head SHA reviewed: dfb6d5728070dd1d8b74e190b3ab045b32c2abcf (verified against gh pr view 714 --json headRefOid)
  • Merge base: dbe3cac80eba13c031f276f733c6874967c3bdd6; current origin/main = 24974c96
  • Trial merge with current main: CONFLICT — CONFLICT (add/add): Merge conflict in docs/dev/kernel-inventory-audit.md
  • Files: crates/compiler/scripts/kernel_inventory_audit.py (442), crates/compiler/tests/kernel_inventory_audit.rs (56), docs/dev/kernel-inventory-audit.md (232)

What checks out

The generation machinery is real and correct in its own terms:

  • The document is produced by a committed script. python3 crates/compiler/scripts/kernel_inventory_audit.py --bin <compiler> run from / (arbitrary cwd — the script resolves paths from __file__) reproduces the committed file byte-for-byte: both sha1 516c00ea44e9955499a4b26972af3e2338df7bac.
  • The drift gate works: cargo test --locked --test kernel_inventory_audit → 1 passed, and it uses CARGO_BIN_EXE_flashtex-compiler rather than a nested cargo build, which is the right call.
  • Output ordering is deterministic (rows follow kernel_rows(), i.e. TSV order; no set iteration reaches the rendered file).
  • Header arithmetic is exact: the TSV really has 440 kernel rows = 410 commands + 30 environments, and 103 + 87 + 15 = 205 listed rows = the 205 table rows in the file.
  • Spot-checks of the mechanical claims, run as the document prints them: Table 1A's "(no output)" holds for circle, contentsline, frenchspacing, baselinestretch, floatsep, indexspace, dashbox (7/7 genuinely empty). Table 1B's "matches exist" holds for DeclareOption (1), RequirePackage (6), ProcessOptions (1). Table 2's test-grep claim holds for paperheight, columnsep, openin, pdfpagewidth, closeout, lineskip (0 hits each in crates/compiler/tests/), and their "implemented" side is real (paperheight in parser.rs:1483 PREAMBLE_LENGTHS; openin/closein/openout/closeout at crates/tex-expansion/src/expand.rs:5773-5776).

That is more than 8 verified claims, and none of the mechanical assertions is wrong.

The problem is upstream of the mechanics: the ground truth the script trusts is not trustworthy, and the document states its conclusions with no hedge.

MATERIAL findings

1. The audit overstates support for at least 3 kernel commands, and main's own document already has the probe evidence that it does

crates/compiler/scripts/kernel_inventory_audit.py:21-25 asserts the premise:

"flashtex-compiler --supported json … A kernel name present here (any mode, any origin) is genuinely dispatched."

and docs/dev/kernel-inventory-audit.md:7 repeats it: "A name absent from all four is genuinely unimplemented."

I regenerated the audit on the merged tree (main + this PR, conflict resolved in favour of the generated file, compiler rebuilt) and diffed its classification against main's current hand-adjudicated docs/dev/kernel-inventory-audit.md — same tree, so every difference is method, not vintage:

name in --supported json generated audit says main's hand audit, with its probe
\indent yes omitted entirely → implemented and tested Table 1B. Probe: \indent x → "\indent is recognised but paragraph indentation is not implemented" (/tmp/main-audit.md:246, added Revision 4)
\twocolumn yes omitted entirely → implemented and tested Table 1B. "every hit is the class option, not the command … no \twocolumn command dispatch arm, no engine entry" (:225)
\onecolumn yes Table 2 (implemented, untested) Table 1A — zero word matches anywhere in crates/compiler/src/ (:140)

\onecolumn is the cleanest proof that the premise is false: a name with zero occurrences in the compiler crate's source cannot be dispatched by it, yet --supported json lists it, so the script promotes it to "implemented".

Failure scenario: a reader (or a planning agent) opens this document to pick unimplemented kernel work, does not find \indent or \twocolumn in any table, and concludes both are implemented and covered by tests. Both are registered stubs. The document that main has today says the opposite, with a reproducing probe per row. Merging this PR deletes that.

Fix: --supported json alone cannot be the implemented-set. Either (a) intersect it with a real dispatch check — a compile probe per name, which the repo already owns in
crates/compiler/tests/supported_latex.rs::every_inventory_entry_compiles_without_an_unsupported_diagnostic, and treat "recognised but not implemented" diagnostics as not implemented; or (b) carry a small committed exception list (\indent, \twocolumn, \onecolumn, …) with the probe output as its justification, so the divergence is visible rather than silently absorbed.

2. The audit also understates support for 14 names, including \hline, \multicolumn and the table environment

Same comparison, other direction — names the generated audit files under "Table 1B — names with matches but NO genuine implementation" that are demonstrably implemented:

\and, \cline, \columnwidth, \extracolsep, \fboxrule, \fboxsep, \fill, \frame, \hline, \includeonly, \linewidth, \multicolumn, \vline, and the table environment.

Directly verified in the tree:

  • crates/compiler/src/parser/tabular.rs:1297-1298 — "hline" => Some(Entry::HLine { span }), "cline" => …
  • crates/compiler/src/parser/tabular.rs:518 — && command == "multicolumn"
  • crates/compiler/src/parser/tabular.rs:89 — matches!(name, "hline" | "cline")

and generated rows 157 / 175 / 206 of the merged document assert, of exactly these, "not in --supported json, PREAMBLE_LENGTHS, TABLE_LENGTHS or a crates/tex-expansion/src/ primitive/register table". For the table environment main's audit records that it was added and then withdrawn after compiling a full document through the real CLI, because "the render pipeline's float pre-pass, crates/render-pipeline/src/floats.rs:151, handles it before the compiler's not-implemented list applies" (/tmp/main-audit.md:59). This PR re-introduces the withdrawn row, mechanically, with no way for a reader to tell.

A document that tells this repo \hline and \multicolumn are unimplemented, in a tree containing tabular_oracle.rs, will be disbelieved wholesale — which costs the accurate 180-odd rows their credibility too.

Fix: the "genuine implementation" ground truth has to include dispatch that lives in sub-parsers (src/parser/tabular.rs) and in the render pipeline's pre-passes, not only top-level registration. At minimum the Table 1B blurb must stop claiming "NO genuine implementation" and instead state exactly what was checked ("not registered in the four enumerated ledgers"), which is the only thing the script actually establishes.

Net: ~17 of 440 rows (~4%) are classified wrongly in one direction or the other, and the errors cluster on high-traffic commands.

3. Add/add merge conflict with current main — and resolving it is a content decision, not a mechanical one

git merge --no-commit --no-ff origin/main in the worktree fails with an add/add conflict on docs/dev/kernel-inventory-audit.md. Main has advanced that file three times since this PR's base (3eed9d9c, 2a05b7bb, 9a73f4f3), and the two versions are different documents: main's is 266 lines carrying per-row adjudication ("every hit is the class option, not the command"; "probed \indent x: …") plus four Revision sections; this PR's is 232 lines whose Table 1B evidence column is one boilerplate sentence repeated 87 times.

The script's own docstring is candid about this (:60-64): "this script does not try to explain why each hit is spurious the way the hand-audit did — that reading-in-context step is exactly what made the document expensive to keep current by hand." That trade is arguable and the staleness argument for it is strong, but it is a deliberate loss of reviewed content at the same path, so the conflict cannot be resolved by "take ours". It needs an explicit call, and findings 1-2 are the reason to make it carefully: the information being dropped is precisely the information that would have caught them.

Non-blocking notes

  • kernel_inventory_audit.py:198-213 expansion_engine_command_names() harvests re.findall(r'\("([A-Za-z]+)"\s*,', text) from every .rs file under crates/tex-expansion/src/, including #[cfg(test)] modules. Any test-fixture tuple ("hbox", …) would silently promote that name to "implemented". I checked: today 253 names are found and 0 come only from test regions, so this is latent, not live. Worth cutting the text at the first #[cfg(test)] mod the way inline_test_regions() already does for the compiler crate.
  • docs/dev/kernel-inventory-audit.md:3 renders as GENERATED by `run crates/compiler/scripts/kernel_inventory_audit.py`; do not edit by hand. — the word run is inside the code span because REGENERATE (:81) is shared with the test's staleness message where "run …" reads correctly. Split the two strings.
  • \RequirePackage (generated Table 1B) is consumed for package detection at crates/compiler/src/bib.rs:265, src/biblatex.rs:441 and src/math.rs:1091 while sitting in vocabulary.rs:38 KNOWN_UNIMPLEMENTED_COMMANDS. The per-row cell is literally true; the table heading ("NO genuine implementation") is not quite. Same class as finding 2, smaller stakes.
  • tests/kernel_inventory_audit.rs:23 reaches the doc via CARGO_MANIFEST_DIR/../../docs/.... The vendored mirror crates/render-pipeline/vendor/compiler/ carries scripts/ and supported/ but no tests/, so the relative path cannot break there today. Fine as is; just don't start vendoring tests/.
  • The script correctly checks implemented before the 1A/1B split, so an engine-only command never lands in Table 1A by construction. Good.

Tests run

  • cargo test --locked --test kernel_inventory_audit in crates/compiler (CARGO_TARGET_DIR=~/flashtex-wt/review-target, CARGO_BUILD_JOBS=3, nice -n 15): 1 passed.
  • cargo build --locked --bin flashtex-compiler on the merged tree: ok.
  • Script run directly from cwd / with --bin/--out: byte-identical to the committed doc.
  • Script re-run on the trial-merged tree (main + PR): Table 1A 101, 1B 87, Table 2 10 — the basis for the classification diff in findings 1-2.
  • Out-of-tree: TSV row counts, --supported json membership queries, grep -rnwF reproduction of 16 published rows.

VERDICT: CHANGES REQUIRED

d-q222 and others added 2 commits September 17, 2026 17:54
…ernel-inventory-generator

# Conflicts:
#	docs/dev/kernel-inventory-audit.md
… understated names (#714 review slice 1)

The audit's "genuine implementation" ground truth was `--supported json`
membership alone, which both overstates and understates real dispatch:

- Overstated: `\indent`, `\twocolumn`, `\onecolumn` are registered but
  `\indent` compiles to "recognised but paragraph indentation is not
  implemented" and (at this PR's base) `\twocolumn`/`\onecolumn` were
  undispatched. New RECOGNISED_BUT_NOT_IMPLEMENTED override list forces
  these back to unimplemented, each with behaviour-probe evidence as a
  comment. After rebasing onto current main, `\twocolumn`/`\onecolumn`
  dispatch for real (main added it), so they were removed from the
  override -- keeping them would have understated support in the other
  direction.
- Understated: 14 names (`hline`, `multicolumn`, `table`, and, columnwidth,
  extracolsep, fboxrule, fboxsep, fill, frame, includeonly, linewidth,
  vline, cline) have real dispatch in sub-parsers (tabular.rs row/cell
  rules, glue-order tables, the expansion pre-pass, the float pre-pass)
  that the four top-level ledgers never enumerate. New
  DISPATCHED_OUTSIDE_LEDGERS list, each entry citing its real dispatch
  site, ORed into the implemented set.

Regenerated against current main (101/74/10 vs the ledger-only 101/87/10):
zero of the 14 finding-2 names remain in Table 1A/1B; `\indent` and
`\twocolumn` move from silently-omitted to correctly-listed Table 1B
entries.

Tests: cargo test --locked --test kernel_inventory_audit -> 1 passed,
byte-identical regeneration on a second run. Full cargo test --locked for
crates/compiler: 0 failed.

Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane kernel-inventory-fix, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
Co-authored-by: d-q222 <[email protected]>
@d-q222

d-q222 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

daniel-muse-lead: pushed abfd69c0 (merged onto current main + dfb6d572..abfd69c0), resolving both findings and the add/add doc conflict via regeneration.

  • Finding 1 (overstated): \indent, \twocolumn, \onecolumn were registered in --supported json but not genuinely dispatched at this PR's base. New RECOGNISED_BUT_NOT_IMPLEMENTED override list forces them back to unimplemented, each with behaviour-probe evidence cited. After merging current main, \twocolumn/\onecolumn turned out to now dispatch for real (main added it since this PR's base) — the lane caught this and correctly removed them from the override rather than leaving a stale entry that would have understated support in the other direction.
  • Finding 2 (understated): 14 names with real dispatch in sub-parsers/pre-passes the four top-level ledgers never see (hline, multicolumn, table, and, columnwidth, extracolsep, fboxrule, fboxsep, fill, frame, includeonly, linewidth, vline, cline) — new DISPATCHED_OUTSIDE_LEDGERS list, each citing its real dispatch site.
  • Doc conflict: resolved by regeneration against the merged tree, not by taking either side — Table 1A 101, Table 1B 74, Table 2 10, byte-identical across two runs.

Verified independently end to end: merged main into the actual PR worktree myself, rebuilt the compiler, reran the regeneration script, got the identical 101/74/10 counts the lane reported, and cargo test --locked --test kernel_inventory_audit passes. Full cargo test --locked for crates/compiler: 0 failed.

@d-q222
d-q222 merged commit c0b1b90 into main Sep 18, 2026
22 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.

1 participant