code wiki / _hdl_build / nx_doc_vault_gate.nx
nx_doc_vault_gate.nx
buildroot/runtime/_hdl_build/nx_doc_vault_gate.nx
about
nx_doc_vault_gate.nx -- GATE for LEGAL D1 (nx_doc_vault).
Drives the REAL vault and asserts the retention invariants:
ADDITIVE+VERSIONED : 3 versions of doc A -> version_count(A)=3, current is
version 3 (older versions retained, not overwritten).
SINGLE-AUTHORITATIVE: exactly one is_current per doc (UETA 16).
CHAIN TAMPER-EVIDENT: verify_chain(A)=OK; corrupt a non-final version's
hash -> CHAIN_BROKEN; restore -> OK (UETA 12).
SOFT-DELETE KEEPS HISTORY: soft_delete(A) -> no current, but
version_count(A) still 3 (Rule 13 additive-only).
SEAL ATTACH : a D5 seal attaches to the CURRENT version only.
TENANT ISOLATION : valid tid accepted; '.'/'/'/empty rejected (no
cross-tenant traversal -- MRPC 1.6 confidentiality).
MULTI-DOC : adding doc B leaves doc A's history untouched.
Evidence -> knowledge/status/doc_vault.log
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_doc_vault.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 21 | const DV_LOG: *u8 = "knowledge/status/doc_vault.log" |
functions
| 23 | func 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 } |
| 24 | func ewn(fd: i64, v: i64) -> i64 |
| 34 | func main() -> i64 |