nx_verdictlog_gate.nx source
↩ module page · 278 lines · 19796 B
1// nx_verdictlog_gate.nx -- THE REFEREE FOR FM3 AND FM4 OF /compare/failmodes.
2//
3// ONE GATE FOR TWO RUNGS BECAUSE THEY SHARE ONE RULER. Splitting it would put two referees on
4// nx_verdictlog_lib, and two guards for one invariant is the duplicate-ruler defect this campaign
5// exists to stop. Every tooth below names which accept rule it enforces.
6//
7// FM3 ACCEPT RULE, QUOTED VERBATIM FROM failmodes.plan BEFORE THE WORK BEGAN:
8// "run it over the EXISTING detector fleet and publish the four numbers per detector; the rung is
9// accepted only if at least one currently-shipping detector is shown to score badly enough to
10// justify changing or retiring it. A scorer that flatters every incumbent has measured nothing."
11//
12// FM4 ACCEPT RULE, QUOTED VERBATIM FROM failmodes.plan BEFORE THE WORK BEGAN:
13// "the organ must report DISAGREE only when the two vantages are observed within a bounded window
14// of each other, and must emit UNOBSERVABLE rather than AGREE when either vantage is missing --
15// an axis that cannot see must abstain, not acquit."
16//
17// FIXTURES ARE ASSEMBLED AT RUNTIME under /tmp/nx_verdictlog_gate/, never checked in and never
18// written as source literals: a detector that scans a directory will find its own test fixture, and
19// a gate that shares a fixture with a production beat reports on the FIXTURE and not on the code.
20// Setup REMOVES every artifact it is about to assert on, so the gate is idempotent -- one that is
21// not reports honestly on its first run and lies about every run after.
22//
23// THE CLASSIFIER IS COMPOSED IN-PROCESS, NEVER FORKED. Handing a directory walker a file path once
24// produced files=0 and a GREEN verdict elsewhere in this estate; composing vl_* directly means the
25// gate exercises the same functions the census calls, and every tooth that asserts an outcome first
26// asserts the call examined something.
27
28import "nx_gate_verdict.nx"
29import "nx_verdictlog_lib.nx"
30
31const VG_DIR: *u8 = "/tmp/nx_verdictlog_gate/"
32const VG_STREAMS: *u8 = "/tmp/nx_verdictlog_gate/streams/"
33const VG_EMPTY: *u8 = "/tmp/nx_verdictlog_gate/emptydir/"
34const VG_PATH: i64 = 4096
35const VG_MODE_0755: i64 = 493
36
37// Fixture arithmetic, stated as named constants so a tooth asserts a DERIVED number rather than a
38// hand-copied one. A hand-counted length beside a literal is a second copy of that literal's shape.
39const VG_SC_RUNS: i64 = 5 // sc.log: GREEN GREEN RED RED GREEN
40const VG_SC_GREEN: i64 = 3
41const VG_SC_RED: i64 = 2
42const VG_SC_RESET: i64 = 2 // the episode opens at run index 2 and closes at run index 4
43const VG_SC_MAXGAP: i64 = 240 // stamps 100 160 220 280 520 -> gaps 60 60 60 240
44const VG_NG_RUNS: i64 = 3
45const VG_GR_RUNS: i64 = 3
46const VG_FIX_FILES: i64 = 8 // sc ng lat gr unk unklatch snap nov
47const VG_FIX_SCORED: i64 = 2 // sc lat
48const VG_FIX_LATCH: i64 = 2 // ng lat
49const VG_FIX_OFFEND: i64 = 2 // ng (constant-nongreen) and lat (latched) -- gr is NOT one
50const VG_VAN_ROWS: i64 = 8
51
52func vg_join(dst: *u8, dir: *u8, name: *u8) -> i64 {
53 var o: i64 = gk_cat(dst, 0, dir)
54 o = gk_cat(dst, o, name)
55 dst[o] = 0 as u8
56 return o
57}
58
59func vg_p(dir: *u8, name: *u8) -> *u8 {
60 let b: *u8 = sys_mmap(VG_PATH)
61 vg_join(b, dir, name)
62 return b
63}
64
65// Every fixture is rewritten from scratch on every run, and every artifact the teeth assert on is
66// removed first. ASSERT THE FIXTURE REACHED THE CONDITION BEFORE ASSERTING THE OUTCOME.
67func vg_setup() -> i64 {
68 sys_mkdir(VG_DIR, VG_MODE_0755)
69 sys_mkdir(VG_STREAMS, VG_MODE_0755)
70 sys_mkdir(VG_EMPTY, VG_MODE_0755)
71
72 gk_write(vg_p(VG_STREAMS, "sc.log" as *u8), "verdict=GREEN ts=100\nverdict=GREEN ts=160\nverdict=RED ts=220\nverdict=RED ts=280\nverdict=GREEN ts=520\n" as *u8)
73 gk_write(vg_p(VG_STREAMS, "ng.log" as *u8), "verdict=RED\nverdict=RED\nverdict=RED\n" as *u8)
74 gk_write(vg_p(VG_STREAMS, "lat.log" as *u8), "verdict=GREEN\nverdict=GREEN\nverdict=RED\nverdict=RED\n" as *u8)
75 gk_write(vg_p(VG_STREAMS, "gr.log" as *u8), "verdict=GREEN\nverdict=GREEN\nverdict=GREEN\n" as *u8)
76 gk_write(vg_p(VG_STREAMS, "unk.log" as *u8), "verdict=GREEN\nverdict=BANANA\n" as *u8)
77 // The uiq_sentinel shape, which caught a real false positive in production: a RED episode opens
78 // and is then followed only by words the ruler has declared it cannot read. The raw observation
79 // is "the trailing episode never closed"; the adjudicated answer must be UNSCORED, not LATCHED.
80 gk_write(vg_p(VG_STREAMS, "unklatch.log" as *u8), "verdict=GREEN\nverdict=RED\nverdict=BANANA\n" as *u8)
81 gk_write(vg_p(VG_STREAMS, "snap.log" as *u8), "verdict=RED\n" as *u8)
82 gk_write(vg_p(VG_STREAMS, "nov.log" as *u8), "nothing here resembles a decision\nsecond line, also silent\n" as *u8)
83
84 // The two-vantage streams. Every one is a single timestamped observation, so the comparator's
85 // window arithmetic is the only thing under test.
86 gk_write(vg_p(VG_DIR, "va_g.log" as *u8), "verdict=GREEN ts=1000\n" as *u8)
87 gk_write(vg_p(VG_DIR, "vb_g.log" as *u8), "verdict=GREEN ts=1100\n" as *u8)
88 gk_write(vg_p(VG_DIR, "vb_r.log" as *u8), "verdict=RED ts=1100\n" as *u8)
89 gk_write(vg_p(VG_DIR, "vb_farg.log" as *u8), "verdict=GREEN ts=99000\n" as *u8)
90 gk_write(vg_p(VG_DIR, "vb_farr.log" as *u8), "verdict=RED ts=99000\n" as *u8)
91 gk_write(vg_p(VG_DIR, "vb_abst.log" as *u8), "verdict=UNKNOWN ts=1100\n" as *u8)
92 gk_write(vg_p(VG_DIR, "vb_nots.log" as *u8), "verdict=GREEN\n" as *u8)
93
94 gk_write(vg_p(VG_DIR, "ruler.conf" as *u8), "vkey|verdict=\ntskey|ts=\ngreen|GREEN\nred|RED\nabstain|UNKNOWN\next|log\nparam|min_runs_series|2\nparam|max_files|64\nparam|path_stride|256\nvantage|agree|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/vb_g.log|300\nvantage|disagree|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/vb_r.log|300\nvantage|far-same|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/vb_farg.log|300\nvantage|far-diff|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/vb_farr.log|300\nvantage|abstaining|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/vb_abst.log|300\nvantage|a-missing|/tmp/nx_verdictlog_gate/nosuch_a.log|/tmp/nx_verdictlog_gate/vb_g.log|300\nvantage|b-missing|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/nosuch_b.log|300\nvantage|b-untimed|/tmp/nx_verdictlog_gate/va_g.log|/tmp/nx_verdictlog_gate/vb_nots.log|300\n" as *u8)
95
96 // A ruler with NO green words. Every detector would score CONSTANT-NONGREEN and the whole fleet
97 // would read as an offender, so the loader must refuse rather than publish that.
98 gk_write(vg_p(VG_DIR, "nogreen.conf" as *u8), "vkey|verdict=\ntskey|ts=\nred|RED\next|log\nparam|min_runs_series|2\nparam|max_files|64\nparam|path_stride|256\n" as *u8)
99
100 gk_rm(vg_p(VG_DIR, "base.txt" as *u8))
101 gk_rm(vg_p(VG_DIR, "wl.tsv" as *u8))
102 gk_rm(vg_p(VG_DIR, "van.tsv" as *u8))
103 return 0
104}
105
106func vg_series_of(conf: *u8, voc: *i64, name: *u8, sr: *i64) -> *u8 {
107 return vl_series(vg_p(VG_STREAMS, name), conf, voc, sr)
108}
109
110func main(argc: i64, argv: *i64) -> i64 {
111 gv_head("nx_verdictlog_gate -- FM3 alert-quality scoring and FM4 two-vantage agreement, one ruler, one referee" as *u8)
112 let ctr: *i64 = gv_ctr()
113 vg_setup()
114
115 let clen: *i64 = sys_mmap(VL_SMALL) as *i64
116 let voc: *i64 = sys_mmap(VL_C_LEN * 8) as *i64
117 let conf: *u8 = vl_conf_load(vg_p(VG_DIR, "ruler.conf" as *u8), clen, voc)
118 gv_check("fixture-ruler-loads-and-declares-its-vocabulary" as *u8, (conf as i64) != 0, ctr)
119 if (conf as i64) == 0 {
120 return gv_verdict("nx_verdictlog_gate" as *u8, ctr, "the fixture ruler did not load, so no tooth below could examine anything" as *u8)
121 }
122
123 // ---------------------------------------------------------------------------------------------
124 // ANTI-VACUITY FIRST. A trivial implementation that returns the same answer for everything
125 // passes any tooth that only asks "did it produce a bucket". These two ask whether the ruler
126 // DISCRIMINATES: the same corpus must yield more than one bucket, and the scored streams must
127 // not all land in the same firing-rate bin.
128 // ---------------------------------------------------------------------------------------------
129 let tot: *i64 = sys_mmap(VL_T_LEN * 8) as *i64
130 let rcfix: i64 = vl_alert_scan(vg_p(VG_DIR, "ruler.conf" as *u8), VG_STREAMS, vg_p(VG_DIR, "wl.tsv" as *u8), tot)
131 gv_check("fixture-census-ran-and-examined-a-nonzero-population" as *u8, rcfix == 0, ctr)
132 gv_check("anti-vacuity-the-ruler-produced-MORE-THAN-ONE-bucket-on-one-corpus" as *u8,
133 vl_bucket_distinct(tot) > 1, ctr)
134 gv_check("anti-vacuity-the-firing-rate-signal-does-NOT-saturate-into-one-bin" as *u8,
135 vl_hist_distinct(tot) > 1, ctr)
136
137 // ---------------------------------------------------------------------------------------------
138 // FM3 -- the partition, its sum, and the axis that is deliberately not part of it.
139 // ---------------------------------------------------------------------------------------------
140 gv_check("fm3-every-fixture-file-was-enumerated-and-scored" as *u8, tot[VL_T_FILES] == VG_FIX_FILES, ctr)
141 gv_check("fm3-partition-SUMS-to-the-files-enumerated" as *u8, vl_bucket_sum(tot) == tot[VL_T_FILES], ctr)
142 gv_check("fm3-latched-is-a-SEPARATE-AXIS-and-its-count-is-not-inside-the-partition" as *u8, tot[VL_T_LATCHED] == VG_FIX_LATCH, ctr)
143 gv_check("fm3-offenders-are-CONSTANT-NONGREEN-union-LATCHED" as *u8, tot[VL_T_OFFEND] == VG_FIX_OFFEND, ctr)
144 gv_check("fm3-scored-informative-streams-counted" as *u8, tot[VL_T_BUCKET0 + VL_B_SCORED] == VG_FIX_SCORED, ctr)
145
146 // Per-stream arithmetic, each asserting the fixture reached its condition BEFORE the outcome.
147 let sr: *i64 = sys_mmap(VL_R_LEN * 8) as *i64
148 let bsc: *u8 = vg_series_of(conf, voc, "sc.log" as *u8, sr)
149 gv_check("fm3-fixture-sc-reached-its-condition-five-runs-three-green-two-red" as *u8,
150 (sr[VL_R_RUNS] == VG_SC_RUNS) & (sr[VL_R_GREEN] == VG_SC_GREEN) & (sr[VL_R_RED] == VG_SC_RED), ctr)
151 gv_check("fm3-reset-is-the-observed-runs-from-a-nongreen-to-the-next-green" as *u8, sr[VL_R_MAXRESET] == VG_SC_RESET, ctr)
152 gv_check("fm3-detect-bound-is-the-largest-observed-interval-between-runs" as *u8, sr[VL_R_MAXGAP] == VG_SC_MAXGAP, ctr)
153 gv_check("fm3-a-stream-that-returned-to-green-is-NOT-latched" as *u8, vl_latched(sr, voc[VL_C_MINRUNS]) == 0, ctr)
154
155 let bng: *u8 = vg_series_of(conf, voc, "ng.log" as *u8, sr)
156 let ngb: i64 = vl_bucket(sr, voc[VL_C_MINRUNS])
157 gv_check("fm3-fixture-ng-reached-its-condition-never-once-green" as *u8, (sr[VL_R_RUNS] == VG_NG_RUNS) & (sr[VL_R_GREEN] == 0), ctr)
158 gv_check("fm3-a-detector-that-has-never-been-green-is-CONSTANT-NONGREEN-and-an-offender" as *u8,
159 (ngb == VL_B_CONSTNG) & (vl_is_offender(ngb, vl_latched(sr, voc[VL_C_MINRUNS])) == 1), ctr)
160 gv_check("fm3-precision-of-a-constant-output-is-reported-UNINFORMATIVE-not-invented" as *u8,
161 gk_streq(vl_precision(ngb), "UNINFORMATIVE-CONSTANT" as *u8) == 1, ctr)
162 gv_check("fm3-detect-bound-ABSTAINS-when-the-stream-carries-no-timestamp" as *u8, sr[VL_R_TSRUNS] == 0, ctr)
163
164 let bgr: *u8 = vg_series_of(conf, voc, "gr.log" as *u8, sr)
165 let grb: i64 = vl_bucket(sr, voc[VL_C_MINRUNS])
166 gv_check("fm3-fixture-gr-reached-its-condition-always-green" as *u8, (sr[VL_R_RUNS] == VG_GR_RUNS) & (sr[VL_R_RED] == 0), ctr)
167 gv_check("positive-control-a-KNOWN-GOOD-always-green-detector-is-NOT-flagged-as-an-offender" as *u8,
168 (grb == VL_B_CONSTGR) & (vl_is_offender(grb, vl_latched(sr, voc[VL_C_MINRUNS])) == 0), ctr)
169 gv_check("fm3-recall-of-a-never-fired-detector-is-reported-UNVERIFIED-not-perfect" as *u8,
170 gk_streq(vl_recall(grb, sr), "UNVERIFIED-NEVER-FIRED" as *u8) == 1, ctr)
171
172 let blat: *u8 = vg_series_of(conf, voc, "lat.log" as *u8, sr)
173 let latb: i64 = vl_bucket(sr, voc[VL_C_MINRUNS])
174 gv_check("fm3-a-stream-can-be-SCORED-INFORMATIVE-and-LATCHED-at-once-which-is-why-latched-is-an-axis" as *u8,
175 (latb == VL_B_SCORED) & (vl_latched(sr, voc[VL_C_MINRUNS]) == 1), ctr)
176
177 let bunk: *u8 = vg_series_of(conf, voc, "unk.log" as *u8, sr)
178 let unkb: i64 = vl_bucket(sr, voc[VL_C_MINRUNS])
179 gv_check("neg-control-an-UNDECLARED-verdict-word-lands-in-its-own-bucket" as *u8, unkb == VL_B_UNKVOCAB, ctr)
180 gv_check("neg-control-an-UNDECLARED-verdict-word-is-NOT-counted-as-a-firing" as *u8,
181 (sr[VL_R_UNK] == 1) & (sr[VL_R_RED] == 0) & (sr[VL_R_ABST] == 0), ctr)
182
183 let bul: *u8 = vg_series_of(conf, voc, "unklatch.log" as *u8, sr)
184 let ulb: i64 = vl_bucket(sr, voc[VL_C_MINRUNS])
185 gv_check("fm3-fixture-unklatch-reached-its-condition-an-open-episode-under-an-undeclared-tail" as *u8,
186 (ulb == VL_B_UNKVOCAB) & (sr[VL_R_LATCHED] == 1), ctr)
187 gv_check("neg-control-a-stream-whose-DIALECT-is-UNREADABLE-is-UNSCORED-on-the-latch-axis-too-not-an-offender" as *u8,
188 (vl_latched(sr, voc[VL_C_MINRUNS]) == 0) & (vl_is_offender(ulb, vl_latched(sr, voc[VL_C_MINRUNS])) == 0), ctr)
189
190 let bsnap: *u8 = vg_series_of(conf, voc, "snap.log" as *u8, sr)
191 let snapb: i64 = vl_bucket(sr, voc[VL_C_MINRUNS])
192 gv_check("neg-control-a-ONE-RUN-snapshot-is-not-scored-as-a-series" as *u8, snapb == VL_B_SNAPSHOT, ctr)
193 gv_check("neg-control-a-ONE-RUN-snapshot-carrying-a-single-red-is-NOT-called-latched" as *u8,
194 (sr[VL_R_LATCHED] == 1) & (vl_latched(sr, voc[VL_C_MINRUNS]) == 0), ctr)
195
196 let bmiss: *u8 = vl_series(vg_p(VG_DIR, "nosuch_a.log" as *u8), conf, voc, sr)
197 gv_check("neg-control-an-ABSENT-stream-is-UNREADABLE-and-not-merely-silent" as *u8, (bmiss as i64) == 0, ctr)
198
199 // ---------------------------------------------------------------------------------------------
200 // FM3 -- the ratchet, bite-proven in THREE directions.
201 // ---------------------------------------------------------------------------------------------
202 let basep: *u8 = vg_p(VG_DIR, "base.txt" as *u8)
203 let wl2: *u8 = vg_p(VG_DIR, "wl2.tsv" as *u8)
204 let rmiss: i64 = vl_alert_ratchet(vg_p(VG_DIR, "nosuch_worklist.tsv" as *u8), basep)
205 gv_check("neg-control-a-ratchet-with-no-worklist-is-UNMEASURED-not-ALLOW" as *u8, rmiss == VL_RATCHET_UNMEAS, ctr)
206
207 gk_write(wl2, "CONSTANT-NONGREEN\t0\t/one\truns=2\nSCORED-INFORMATIVE\t0\t/two\truns=2\n" as *u8)
208 let r1: i64 = vl_alert_ratchet(wl2, basep)
209 gv_check("fm3-ratchet-SELF-BASELINES-on-first-sight-so-adopting-it-cannot-turn-the-fleet-red" as *u8,
210 (r1 == VL_RATCHET_ALLOW) & (gk_exists(basep) == 1), ctr)
211 let h0: i64 = vl_fnv_file(basep)
212
213 gk_write(wl2, "CONSTANT-NONGREEN\t0\t/one\truns=2\nCONSTANT-NONGREEN\t0\t/three\truns=2\nSCORED-INFORMATIVE\t0\t/two\truns=2\n" as *u8)
214 let r2: i64 = vl_alert_ratchet(wl2, basep)
215 let h1: i64 = vl_fnv_file(basep)
216 gv_check("fm3-ratchet-REFUSES-on-a-rise-and-names-the-new-offender" as *u8, r2 == VL_RATCHET_REFUSE, ctr)
217 // ASSERTED BY CONTENT, NEVER BY SIZE. A same-size baseline rewrite sails straight past a byte
218 // count, and this is the one tooth standing between the ratchet and laundering itself green.
219 gv_check("neg-control-ratchet-does-NOT-rewrite-its-baseline-on-a-rise-proven-by-CONTENT-HASH-not-size" as *u8,
220 (h1 == h0) & (h0 != (0 - 1)), ctr)
221
222 gk_write(wl2, "SCORED-INFORMATIVE\t0\t/two\truns=2\n" as *u8)
223 let r3: i64 = vl_alert_ratchet(wl2, basep)
224 let h2: i64 = vl_fnv_file(basep)
225 gv_check("fm3-ratchet-TIGHTENS-on-a-fall-and-the-baseline-content-actually-changes" as *u8,
226 (r3 == VL_RATCHET_ALLOW) & (h2 != h0), ctr)
227
228 // ---------------------------------------------------------------------------------------------
229 // FM4 -- the accept rule, conjunct by conjunct.
230 // ---------------------------------------------------------------------------------------------
231 let res: *i64 = sys_mmap(VL_NVOUT * 8) as *i64
232 let rcv: i64 = vl_vantage_scan(vg_p(VG_DIR, "ruler.conf" as *u8), vg_p(VG_DIR, "van.tsv" as *u8), res)
233 gv_check("fm4-the-vantage-pass-ran-over-every-declared-subject" as *u8, rcv == 0, ctr)
234 var vsum: i64 = 0
235 var vi: i64 = 0
236 while vi < VL_NVOUT { vsum = vsum + res[vi]; vi = vi + 1 }
237 gv_check("fm4-outcome-partition-SUMS-to-the-declared-subjects" as *u8, vsum == VG_VAN_ROWS, ctr)
238 gv_check("fm4-two-vantages-that-agree-inside-the-window-report-AGREE" as *u8, res[VL_V_AGREE] == 1, ctr)
239 gv_check("fm4-two-vantages-that-differ-inside-the-window-report-DISAGREE" as *u8, res[VL_V_DISAGREE] == 1, ctr)
240 // THE CORE OF THE ACCEPT RULE. Both out-of-window rows are present at once -- one where the two
241 // vantages AGREE and one where they DIFFER -- so neither answer can be reached by luck.
242 gv_check("neg-control-outside-the-window-is-UNOBSERVABLE-and-never-AGREE-or-DISAGREE-either-way" as *u8,
243 (res[VL_V_U_WINDOW] == 2) & (res[VL_V_AGREE] == 1) & (res[VL_V_DISAGREE] == 1), ctr)
244 gv_check("neg-control-a-MISSING-vantage-ABSTAINS-and-names-which-side-is-missing" as *u8,
245 (res[VL_V_U_AMISS] == 1) & (res[VL_V_U_BMISS] == 1), ctr)
246 gv_check("neg-control-a-vantage-that-ABSTAINS-does-not-become-a-DISAGREE" as *u8, res[VL_V_U_ABSTAIN] == 1, ctr)
247 gv_check("neg-control-a-vantage-with-no-TIMESTAMP-cannot-be-placed-in-time-and-ABSTAINS" as *u8, res[VL_V_U_BNOOBS] == 1, ctr)
248
249 // ---------------------------------------------------------------------------------------------
250 // FAIL-CLOSED and ZERO-SUBJECT behaviour.
251 // ---------------------------------------------------------------------------------------------
252 let tot2: *i64 = sys_mmap(VL_T_LEN * 8) as *i64
253 let rcng: i64 = vl_alert_scan(vg_p(VG_DIR, "nogreen.conf" as *u8), VG_STREAMS, vg_p(VG_DIR, "wl3.tsv" as *u8), tot2)
254 gv_check("neg-control-a-ruler-with-no-GREEN-words-REFUSES-instead-of-scoring-the-whole-fleet-as-offenders" as *u8, rcng == 3, ctr)
255 let rcempty: i64 = vl_alert_scan(vg_p(VG_DIR, "ruler.conf" as *u8), VG_EMPTY, vg_p(VG_DIR, "wl4.tsv" as *u8), tot2)
256 gv_check("neg-control-a-census-that-examined-ZERO-files-does-NOT-return-the-code-of-a-complete-run" as *u8, rcempty == 3, ctr)
257
258 // ---------------------------------------------------------------------------------------------
259 // THE PRODUCTION CONTROL. A rule proven only on planted fixtures is not calibrated on real data;
260 // this runs the shipped ruler over the shipped conf and the real status directory and asserts it
261 // examined a nonzero population. It ABSTAINS rather than passing when the conf is not where this
262 // tree keeps it -- "I could not look" is not "it is broken", and it is not a pass either.
263 // ---------------------------------------------------------------------------------------------
264 var pconf: *u8 = "buildroot/knowledge/verdictlog.conf" as *u8
265 var pdir: *u8 = "knowledge/status/" as *u8
266 if argc >= 3 { pconf = argv[1] as *u8; pdir = argv[2] as *u8 }
267 let have: i64 = gk_exists(pconf)
268 gv_need("production-ruler-present-in-this-tree" as *u8, have, ctr)
269 if have == 1 {
270 let tot3: *i64 = sys_mmap(VL_T_LEN * 8) as *i64
271 let rcp: i64 = vl_alert_scan(pconf, pdir, vg_p(VG_DIR, "prod.tsv" as *u8), tot3)
272 gv_check("production-control-the-shipped-ruler-scored-a-NONZERO-population-of-real-streams" as *u8,
273 (rcp == 0) & (tot3[VL_T_FILES] > 0), ctr)
274 gv_check("production-control-the-real-partition-SUMS" as *u8, vl_bucket_sum(tot3) == tot3[VL_T_FILES], ctr)
275 }
276
277 return gv_verdict("nx_verdictlog_gate" as *u8, ctr, "FM3 alert-quality scoring and FM4 two-vantage agreement, refereed against runtime fixtures and a production control" as *u8)
278}