code wiki / _hdl_build / nx_doc_annotate_gate.nx

nx_doc_annotate_gate.nx

buildroot/runtime/_hdl_build/nx_doc_annotate_gate.nx

12370 B235 linesdepth 11pulls 17 transitivereach 0 importersview sourcekind gate/prooftopic doc
docsdependenciesstructsconstsfunctions

about

nx_doc_annotate_gate.nx -- GATE for LEGAL D4 (nx_doc_annotate). Drives the annotation/markup overlay composing D1 (vault versions) + D2 (envelope completion -> the freeze) + D5 (real Ed25519 seal to complete it) and asserts every overlay invariant WITH a negative control: T1 ADD + COUNT + TYPE : notes/comments/highlights/redlines/checks/sigfields land on a doc version; per-type counts are exact. T2 REDLINE LIFECYCLE : a redline accepts (resolver recorded); another rejects and is RETAINED (additive, count unchanged). T3 THREADED COMMENTS : a comment + 2 replies -> thread_replies = 2. T4 CHECKLIST GATES SEND : 3 required checklist items, 2 done -> complete=0 (a portal withholds nx_env_send); all done -> complete=1 and nx_env_send = OK (compose w/ D2). T5 IMMUTABLE-AFTER-COMPLETE (the crux) : (a) frozen=1 -> add/resolve REFUSED; (b) a REAL envelope driven to COMPLETED yields frozen := (status==COMPLETED) and a subsequent add is REFUSED; control: a still-SENT envelope frozen=0 -> add succeeds. A signed agreement can't be re-marked. T6 PER-VERSION ANCHORING : an annotation on v1 is not counted for v2 after a vault version bump (it stays pinned to v1). T7 HISTORY READABLE UNDER FREEZE : a completed doc's prior annotations remain fully readable + counted; only NEW writes are refused. NOTE (honest): uses the single RFC 8032 KAT keypair for determinism (per-signer keys = a PKI rung). What is proven is the overlay lifecycle + the freeze/additive invariants and their composition with the real envelope + vault. Evidence -> knowledge/status/doc_annotate.log license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_doc_annotate.nx nx_doc_envelope.nx nx_doc_seal.nx nx_doc_vault.nx nx_legal_compliance.nx nx_syscalls.nx nx_doc_annotate_gate.nx

imports: nx_doc_annotate.nxnx_doc_envelope.nxnx_doc_seal.nxnx_doc_vault.nxnx_legal_compliance.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_ann_add na_put nx_ann_count nx_ann_count_type nx_ann_resolve na_find nx_ann_status na_find ↻ nx_ann_add_reply na_put ↻ nx_ann_thread_replies nx_env_create nx_legal_doc_classify lc_ci_contains lc_slen lc_lower nx_legal_regime nx_legal_is_excluded nx_env_add_recipient nx_ann_checklist_remaining nx_ann_checklist_complete nx_ann_checklist_remaining ↻ nx_env_status ne_find_env nx_env_send ne_find_env ↻ nx_env_required_signers mk_seal slen nx_seal_create sys_mmap ↻ nx_legal_verdict nx_legal_regime ↻ nx_seal_canonical sl_cat ed25519_sign_full sys_mmap ↻ ed25519_sha512

structs

none

consts

38const DA_LOG: *u8 = "knowledge/status/doc_annotate.log"

functions

40func ew(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
41func ewn(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
50func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: mk_seal
52func mk_seal(s: *NxSeal, dt: i64, ewills: i64, signer: *u8, ts: i64,
called by 1: main calls 2: slennx_seal_create
69func main() -> i64