code wiki / _hdl_build / nx_quarantine.nx
nx_quarantine.nx
buildroot/runtime/_hdl_build/nx_quarantine.nx
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
imports: nx_syscalls.nxnx_estate_path.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 32 | const QT_MAGIC_65536: i64 = 65536 |
| 33 | const QT_MAGIC_1024: i64 = 1024 |
| 35 | const QT_GENDIR: *u8 = "/volume1/ai/gen/" |
| 36 | const QT_QDIR: *u8 = "/volume1/ai/gen/quarantine/" |
| 37 | const QT_MODE_DIR: i64 = 493 |
| 38 | const QT_CIDCAP: i64 = 128 |
functions
| 40 | func qw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 41 | func qn(v: i64) -> i64 |
| 51 | func 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 |
| 52 | func 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 } |
| 53 | func qt_catn(d: *u8, o: i64, v: i64) -> i64 |
| 68 | func qt_resolve_cid(loc: *u8, out: *u8) -> i64 |
| 95 | func qt_live_path(cid: *u8, out: *u8) -> i64 |
| 103 | func qt_held_path(cid: *u8, out: *u8) -> i64 |
| 111 | func qt_exists(p: *u8) -> i64 |
| 117 | func qt_size(p: *u8) -> i64 |
| 129 | func qt_record(action: *u8, cid: *u8, notice_id: i64) -> i64 called by 2: qt_holdqt_release calls 7: sys_openat_appendsys_mmapqt_catnsys_now_realtime_secqt_catsys_write+1 |
| 146 | func qt_hold(cid: *u8, notice_id: i64) -> i64 |
| 160 | func qt_release(cid: *u8, notice_id: i64) -> i64 |
| 171 | func qt_selftest() -> i64 |
| 226 | func main(argc: i64, argv: *i64) -> i64 |