Skip to content

Commit dbfc08a

Browse files
committed
fix: codec_sweep.sh stub honesty check must FAIL THE SCRIPT, not just log
Codex P2 review catch — the "Stub honesty check" block was echoing results[0].stub but always exiting 0, which undermined the anti-#219 safeguard the script claims to enforce. In Phase 0/2 runs, a non-stub or malformed response could look like a successful sweep in automation. Fix: after extracting the flag, case on it: - true → OK, echo success (Phase 0 stub honored) - false → FAIL exit 3, diagnostic message naming two possible causes (server running non-scaffold code OR wrong endpoint hit) - * → FAIL exit 3, points at the malformed response section The fix embodies the session's own principle ("the object does the work" / "stub flag is machine-checkable anti-#219"): a script that claims to check a flag but doesn't exit on failure is exactly the pattern we warn against in CODING_PRACTICES.md. The script now actually enforces what it documents. Cross-ref: PR #239 D3.2; EPIPHANIES.md 2026-04-20 "D0.2 stub flag is anti-#219 defense at the type level"; Codex P2 review 2026-04-21. https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
1 parent b64baad commit dbfc08a

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

scripts/codec_sweep.sh

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,33 @@ echo "$response" | jq '.'
5656

5757
echo
5858
echo "=== Stub honesty check ==="
59-
stub_flag=$(echo "$response" | jq '.results[0].stub // "no results"')
59+
# Per EPIPHANIES.md 2026-04-20 "D0.2 stub flag is anti-#219 defense at
60+
# the type level" — the check MUST fail the script (not just log) when
61+
# the flag is absent or false. Until D2.2 lands real decode-and-compare,
62+
# Phase 0/2 runs return stub:true. A non-stub response here means
63+
# either the wrong endpoint was hit, the response was malformed, or
64+
# (worst case) the server silently shipped non-stub code and this
65+
# script is now pretending synthetic numbers are real.
66+
67+
stub_flag=$(echo "$response" | jq -r '.results[0].stub // "missing"')
6068
echo "results[0].stub = $stub_flag"
61-
echo "Expected: true (Phase 0 stub; D2.2 flips to false when real decode lands)."
69+
70+
case "$stub_flag" in
71+
true)
72+
echo "OK — Phase 0 stub honored. (D2.2 will flip this to false when real decode lands;"
73+
echo " at that point, flip this check too.)"
74+
;;
75+
false)
76+
echo "FAIL — results[0].stub is false but D2.2 has not landed." >&2
77+
echo " This script refuses to treat non-stub output as real during Phase 0." >&2
78+
echo " Either the server is running non-scaffold code (update this check)," >&2
79+
echo " or the request hit the wrong endpoint / unexpected handler." >&2
80+
exit 3
81+
;;
82+
*)
83+
echo "FAIL — results[0].stub missing or unparseable (got: $stub_flag)." >&2
84+
echo " Response may be malformed or an error payload." >&2
85+
echo " Inspect the --- response --- section above." >&2
86+
exit 3
87+
;;
88+
esac

0 commit comments

Comments
 (0)