test(accounting): content-accounting gate for okf build, written red

Capability loop step 3, no capability. tools/okf_accounting_gate.py asks,
per README file type, how many of the elements a SOURCE holds okf build
books as carried / pointer / coded rejection, with unaccounted and
double-booked both required to be 0. Exit 1 today on rows 2, 3, 4 and 6.

The fasit is tools/okf_witness.py (stdlib + pdfplumber + poppler, no
package import; tested on the live import graph), committed as
tests/fixtures/accounting/*inventory.json over one fixture per type.

Measured: no source inventory (0 of 13); two graphics/ files carried
through documents AND counted extractor_unknown (50 on R761 under
--gate none); a refused document logged "0 carried of 0 found"; R761
refused whole because guard 1.4.0 treats its 71 U+00AD soft hyphens as an
invisible carrier (asked of the security repo). The two R761 witnesses
agree once STS labels are counted by role, not tag.

Report: docs/2026-09-17-innholdsregnskapet-rod-gate.md

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-17 15:40:37 +02:00
commit 0b00de4408
26 changed files with 2598 additions and 0 deletions

View file

@ -890,6 +890,19 @@ and fixtures, never code.
move (it is not delivered on the Arm B bundle either, by a different
mechanism). hit@8 over the six published questions holds at **5 of 6 on both
K2 bundles**, so the default move cost the retrieval side nothing.
- **Account for content: `python3 tools/okf_accounting_gate.py` (2026-09-17), RED by
design.** Capability loop step 3, no capability: per README file type, of M
elements the SOURCE holds, how many `okf build` books as carried / pointer /
coded rejection, with u (unaccounted) and d (double-booked) required to be 0.
The fasit is `tools/okf_witness.py`, which imports no package module (tested on
the live import graph), committed as `tests/fixtures/accounting/*inventory.json`.
It reads a door that does not exist yet (`okf build --accounting PATH`, contract
in the module docstring). Red today on rows 2, 3, 4 and 6: no inventory; a
`graphics/` file carried through a document AND counted `extractor_unknown`
(2 on the fixtures, 50 on R761 under `--gate none`); a refused document logged
`0 carried of 0 found`; R761 refused whole because guard 1.4.0 treats its 71
U+00AD soft hyphens as an invisible carrier (asked of the security repo).
Report: `docs/2026-09-17-innholdsregnskapet-rod-gate.md`.
- **Judge a bundle: `okf quality <bundle>` (G37, 2026-09-12).** A per-file-type
verdict, with the denominator on every line, and it is a SEPARATE command
from `okf check` on purpose: `check` is the contract check, and a green one