nx_srcfresh_gate.nx
buildroot/runtime/nx_srcfresh_gate.nx
about
nx_srcfresh_gate.nx -- TEETH FOR THE EXTRACTED FRESHNESS PREDICATE (nx_srcfresh.nx).
T1-T5 are DELIBERATELY THE SAME FIVE CASES _freshness_gate.nx already locks against the original
oi_src_stale, re-asserted against the extracted copy. An extraction that is not re-asserted is a claim of
equivalence, not a proof of it -- and the copies already in this tree are exactly what happens when the
claim is trusted (several read only tv_sec and disagree with the predicate the gate proved).
T6/T7 ARE THE LOAD-BEARING PAIR AND ARE NEW. They set two files to the SAME SECOND and different
NANOSECONDS. Every second-granularity implementation of this predicate answers 0 (fresh) for T6, because
the two mtimes compare EQUAL -- so T6 is the tooth that fails for the copies and passes only for a real
nanosecond comparison. T7 drives the same fixture the other way so the pair discriminates in BOTH
directions and cannot be satisfied by a function that simply always returns 1.
LAW: A TOOTH THAT ONLY THE CORRECT IMPLEMENTATION PASSES IS THE ONLY KIND WORTH ADDING TO A COPY.
T8-T10 lock the MAGNITUDE, including the absent-artifact case returning -1 rather than 0: "no measurable
lag" and "no lag" are different facts, and folding them is the defect class this session kept finding.
DETERMINISTIC: mtimes are set explicitly via sys_utimensat -- no sleeps, no filesystem-resolution races.
Fixtures live in /tmp and are unlinked at the end. Inherits nx_gate_verdict (D001).
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_srcfresh.nxnx_gate_verdict.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
| 24 | const SG_MODE: i64 = 420 // 0644 |
| 25 | const SG_BASE: i64 = 1700000000 // fixed epoch -- the clock is set, never observed |
| 26 | const SG_LAG: i64 = 100 // seconds the source leads the artifact in T8 |
| 27 | const SG_RT: i64 = 1700000042 // round-trip probe value |
| 28 | const SG_NS_LO: i64 = 500 |
| 29 | const SG_NS_HI: i64 = 900 |
| 30 | const SG_TSBUF: i64 = 64 |
functions
| 32 | func sg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: sg_write |
| 33 | func sg_cat(d: *u8, at: i64, s: *u8) -> i64 called by 1: main |
| 40 | func sg_write(path: *u8, content: *u8) -> i64 |
| 48 | func sg_set(path: *u8, sec: i64, nsec: i64) -> i64 |
| 57 | func main(argc: i64, argv: *i64) -> i64 |