code wiki / _hdl_build / nx_quarantine.nx

nx_quarantine.nx

buildroot/runtime/_hdl_build/nx_quarantine.nx

12969 B265 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_quarantine.nx -- W-TD-3: THE WITHHOLD-WITHOUT-DESTROYING STORE, and the locator resolver. This is where nx_realperson's RP_QUARANTINE finally has somewhere to put something. Until now it was a verdict with no destination (debt 1785893553), which is a promise, not a capability. ★★★★★★WHY MOVE AND NOT DELETE. The operator's correction is the whole design: "for minors it should be flagged and quarantined, as the performer could be 18 and miscategorized." A suspected -age call is a HYPOTHESIS. Deleting on it destroys the very record (2257-style age documentation, the original file, its provenance) that would have EXONERATED a lawful adult -- and it destroys it precisely in the case where we were wrong. So: HOLD = rename into a quarantine prefix. The asset stops being served immediately (safe if the suspicion is right) and survives byte-for-byte (safe if it is wrong). RELEASE = rename back. This path is not a nicety; it is the remedy for the misread performer, and a quarantine with no release is just a slow delete. ⛔THERE IS NO UNLINK IN THIS ORGAN, deliberately. Rule 13: history is sacred. Even the CSAM branch of nx_takedown says PRESERVE+REPORT, never remove-and-forget -- silent deletion is evidence destruction, which is a worse problem than the one it pretends to solve. ★RENAME, NOT COPY+DELETE: atomic, so there is no window where the bytes exist in neither place or in both. A half-finished quarantine is exactly the state you cannot explain to anyone later. verbs: resolve <locator> -- /gen/img/<cid> | blob-<cid>.png | <cid> -> the on-disk asset hold <locator> <notice-id> -- withhold (reversible), append a record release <locator> <notice-id>-- restore, append a record status <locator> -- LIVE | HELD | ABSENT selftest -- hermetic teeth, creates and cleans its own fixtures license_tier: ORIGINAL expect_exit: 0 module: nishi-core.hosting.quarantine

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_estate_path.nx nx_quarantine.nx

imports: nx_syscalls.nxnx_estate_path.nx

imported by: nobody (leaf or entry point)

structs

none

consts

32const QT_MAGIC_65536: i64 = 65536
33const QT_MAGIC_1024: i64 = 1024
35const QT_GENDIR: *u8 = "/volume1/ai/gen/"
36const QT_QDIR: *u8 = "/volume1/ai/gen/quarantine/"
37const QT_MODE_DIR: i64 = 493
38const QT_CIDCAP: i64 = 128

functions

40func qw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: qn calls 1: sys_write
41func qn(v: i64) -> i64
51func qt_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: qt_resolve_cid
52func qt_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var a: i64 = o; while s[i] != (0 as u8) { d[a] = s[i]; a = a + 1; i = i + 1 } return a }
53func qt_catn(d: *u8, o: i64, v: i64) -> i64
called by 1: qt_record calls 1: sys_mmap
68func qt_resolve_cid(loc: *u8, out: *u8) -> i64
called by 1: qt_selftest calls 1: qt_len
95func qt_live_path(cid: *u8, out: *u8) -> i64
called by 2: qt_holdqt_release calls 1: qt_cat
103func qt_held_path(cid: *u8, out: *u8) -> i64
called by 2: qt_holdqt_release calls 1: qt_cat
111func qt_exists(p: *u8) -> i64
117func qt_size(p: *u8) -> i64
129func qt_record(action: *u8, cid: *u8, notice_id: i64) -> i64
146func qt_hold(cid: *u8, notice_id: i64) -> i64
160func qt_release(cid: *u8, notice_id: i64) -> i64
171func qt_selftest() -> i64
226func main(argc: i64, argv: *i64) -> i64