nx_paper_audit.nx
buildroot/runtime/nx_paper_audit.nx
about
nx_paper_audit.nx -- RESOLVE every citation in a manuscript against its ledger (AS-3).
★WHY THIS EXISTS -- A MEASURED BLIND SPOT IN OUR OWN RULER, NOT A SUSPECTED ONE.
nx_paperbench COUNTS provenance tokens; it never checks that a token RESOLVES, nor that
the number printed next to it MATCHES the ledger row it names. Proven with a fixture
(knowledge/papers/rt004_negcontrol_liar.md): a manuscript citing "999 [ev:E02]" when the
ledger says 254, and "[ev:E99]" which does not exist at all, scored composite 750 and
publishable=1. A well-formed token is indistinguishable from a true one to a counter.
This organ closes that hole by a DIFFERENT METHOD: it resolves. For each "[ev:ID]" it
1. looks ID up in the ledger -> absent = DANGLING
2. reads the digit run immediately before -> differs = CONTRADICTED
3. no adjacent number -> UNANCHORED (reported, not an error:
a citation may legitimately support a sentence rather than a figure)
★It audits the ARTIFACT, not the process. nx_paper_forge guarantees correctness at EMIT
time; this checks the file as it now stands, so a hand-edited, post-processed, or
forge-bugged manuscript is still caught. That independence is the whole point.
DRY: ledger lookup is nx_paper_forge's pf_lookup and marker scanning is nx_paperbench's
pb_find -- reused, not reimplemented (rule 15). Imports are transitive through the forge.
Integer, deterministic. No hw writes (Rule 26). license_tier: ORIGINAL
module: nishi-core.research.paper_audit
depends: nx_paper_forge.nx (-> nx_paperbench.nx -> nx_syscalls.nx)
genealogy_id: paperbench_token_count_blindspot + forge_ledger_lookup
dependencies 1 imports · 2 importers
imports: nx_paper_forge.nx
imported by: nx_paper_audit_cli.nxnx_paper_audit_gate.nx
structs
| none |
consts
| none |
functions
| 31 | func pa_prev_num(buf: *u8, p: i64, out: *i64) -> i64 called by 1: pa_audit |
| 59 | func pa_range_eq(a: *u8, ar: *i64, b: *u8, br: *i64) -> i64 called by 1: pa_audit |
| 73 | func pa_audit(doc: *u8, dn: i64, ledp: *i64, out: *i64) -> i64 |
| 133 | func pa_rows(led: *u8, ln: i64) -> i64 |
| 146 | func pa_row(led: *u8, ln: i64, idx: i64, out: *i64) -> i64 |
| 176 | func pa_contains(hay: *u8, hn: i64, ndl: *u8, nr: *i64) -> i64 |
| 193 | func pa_integrity(out: *i64) -> i64 |
| 199 | func pa_clean(out: *i64) -> i64 |