code wiki / _hdl_build / nx_docportal_policy_gate.nx

nx_docportal_policy_gate.nx

buildroot/runtime/_hdl_build/nx_docportal_policy_gate.nx

8441 B125 linesdepth 5pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic docportal
docsdependenciesstructsconstsfunctions

about

nx_docportal_policy_gate.nx -- MEASURED gate for OWNER USAGE POLICY enforcement (operator: "lawyers or users on any site able to flag how the results of their uploads are managed and whether an ai writer can publish blog posts with the content"). Self-contained (in-process; real seg_store + real AI-blog composer). Proves the owner's flags are honored BY CONSTRUCTION: T1 ai_blog ON -> dp_may(AI_BLOG)=1 (permitted) T2 ai_blog OFF -> dp_may(AI_BLOG)=0 (denied) even though the doc is public + searchable T3 blog publish -> the draft CONTAINS the consented doc, EXCLUDES the non-consented doc (1 doc used) T4 consent withdrawal -> after dp_set_policy turns ai_blog OFF, the doc vanishes from the blog AT ONCE, and the doc bytes are preserved (the amendment never deletes content) T5 search management -> a public doc whose owner did NOT flag pub_search is INVISIBLE to the live store-native search (dss_search query-time consent filter), while a flagged doc IS findable Verdict MEASURED. GREEN iff 5/5. Appends knowledge/status/docportal_policy_gate.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_docportal_aiblog_lib.nx nx_g_puts_lib.nx nx_docportal_search_seg.nx nx_docportal_policy_gate.nx

imports: nx_docportal_aiblog_lib.nxnx_g_puts_lib.nxnx_docportal_search_seg.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write dp_blogsrc dp_cat g_trunc sys_openat_wr dp_ingest_policy dp_cid fnv1a_init fnv1a_update sys_mmap dp_prefix dp_cat ↻ dp_key dp_cat ↻ dp_catn sys_mmap ↻ dp_polkey dp_cat ↻ dp_catn ↻ dp_catn ↻ ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻

structs

none

consts

none

functions

17func g_num(v: i64) -> i64
called by 1: main
25func g_w(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
26func g_wn(fd: i64, v: i64) -> i64
called by 1: main
32func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: g_containsmain
33func g_contains(hay: *u8, n: i64, ndl: *u8) -> i64
called by 1: main calls 1: g_slen
39func g_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd >= 0 { sys_close(fd) } return 0 }
called by 1: main calls 1: sys_openat_wr
40func g_eq(a: *u8, al: i64, b: *u8, bl: i64) -> i64 { if al != bl { return 0 } var i: i64 = 0; while i < al { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
42func main() -> i64