Skip to content

test(doc-control): address RENDERING.md table cells by name, and check the ladder column - #747

Open
tractorjuice wants to merge 2 commits into
mainfrom
fix/rendering-table-assertions
Open

test(doc-control): address RENDERING.md table cells by name, and check the ladder column#747
tractorjuice wants to merge 2 commits into
mainfrom
fix/rendering-table-assertions

Conversation

@tractorjuice

Copy link
Copy Markdown
Owner

Two Minor findings from #744's final review, now that the guard they concern is on main.

Positional cell reads

scripts/tests/test-regime-registration.mjs addressed table cells by index — c[1] for the partial, c[3] for the routing. Reorder a column in RENDERING.md and the table still parses, the guard still passes, and it is silently asserting the wrong thing.

Cells are now addressed by column name. A missing column fails loudly, reporting the header it actually found rather than comparing against undefined.

The ladder column was never checked

The Classification ladder column existed in the table but nothing verified it. A row could name the correct partial while describing a completely different scheme — precisely the drift the guard exists to prevent, one column over from where it was looking.

It is now compared against the partial's own Classification row. The comparison is first rung to last rung, not verbatim, because the table legitimately abbreviates: CA writes Protected A–C where document-control-ca.md spells out all three. Demanding exact equality would force the table to become unreadable, which is the wrong trade for a document a human reads.

Probed, not assumed

Both assertions were verified by making the change they are meant to catch:

Swapping two column headers (leaving the data rows alone):

[FAIL] RENDERING.md routes UK to PUBLIC / OFFICIAL / OFFICIAL-SENSITIVE / SECRET, REGIME_PARTIALS says `document-control-uk.md`
[FAIL] RENDERING.md documents UK's ladder as "`document-control-uk.md` … `document-control-uk.md`", but document-control-uk.md contains "PUBLIC … SECRET"

Giving CA the UK ladder text in the table while leaving its partial untouched:

[FAIL] RENDERING.md documents CA's ladder as "PUBLIC … SECRET", but document-control-ca.md contains "UNCLASSIFIED … TOP SECRET"

Neither was detectable before.

Verification

node scripts/tests/test-regime-registration.mjs        PASS (9 regimes)
node scripts/tests/test-doc-types-dual-registration.mjs PASS (161 codes)
python -m pytest -q                                    1267 passed, 225 skipped
scripts/sync-shared-assets.py --check                  clean
scripts/sync-claude-plugin-layout.py --check           clean

Test-only change — RENDERING.md and the partials are untouched, so nothing needed propagating.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VKbHCujejpxkgvh47BndDE

tractorjuice and others added 2 commits August 7, 2026 16:43
…k the ladder column

Two gaps flagged in #744's final review.

The table assertions read cells positionally (c[1], c[3]), so reordering a
column in RENDERING.md would silently change what was asserted — the table
still parses and the guard still passes while checking the wrong thing. Cells
are now addressed by column name, and a missing column fails loudly with the
header it actually found rather than comparing against undefined.

The `Classification ladder` column was never checked at all, so a row could
name the correct partial while describing a completely different scheme. It is
now compared against the partial's own Classification row. The comparison is
first-rung-to-last rather than verbatim, because the table legitimately
abbreviates — CA writes "Protected A-C" where the partial spells out all three.

Both probed: swapping two column headers, and giving CA the UK ladder text
while leaving its partial alone, each now fail with a specific message.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKbHCujejpxkgvh47BndDE
lint-markdown.yml is where the node guards run — regime registration,
doc-type dual registration, handoff validation. Its path filters listed the
inputs those guards check (doc-types.mjs, plugin.json, hooks, tests/plugin)
but never scripts/tests/** itself.

So a PR that changes only a guard's own test file does not run that guard.
This PR was exactly that shape: it rewrote test-regime-registration.mjs and
CI executed only the Python suite, which never invokes it.

Adds scripts/tests/** to both the push and pull_request filters.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKbHCujejpxkgvh47BndDE
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