summaryrefslogtreecommitdiff
path: root/.claude/workflows
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-08-20 18:30:45 +0700
committerhathach <[email protected]>2026-08-20 18:30:45 +0700
commit0fa0ece024fecae0847459b5949c66f40fcc6e11 (patch)
treed1cc160b3a0c34c96869a407c86e0e080c373bf1 /.claude/workflows
parent208ce50e0d5c08eead9c854d73fd397748e1413e (diff)
hil: address Copilot review — loud extraction markers, exit-visible variant warnings
The workflow-logic harness slices hil-validate.js between marker strings (the body is not a module; the runtime wraps it, so markers are the only handle). A renamed marker used to produce a garbage slice and a confusing ReferenceError; it now fails naming the missing marker, proven by mutating the marker and watching the message. The variant-warning loop in hil_ci.sh read variant_names through a process substitution -- the exact exit-status blindness the comment in resolve_build_dirs warns about, two functions earlier in the same file. A plain command-substitution assignment is visible to set -e, so a malformed roster now aborts instead of silently skipping the warnings.
Diffstat (limited to '.claude/workflows')
-rw-r--r--.claude/workflows/test-hil-validate.mjs14
1 files changed, 12 insertions, 2 deletions
diff --git a/.claude/workflows/test-hil-validate.mjs b/.claude/workflows/test-hil-validate.mjs
index 80f37b27d..db73095f6 100644
--- a/.claude/workflows/test-hil-validate.mjs
+++ b/.claude/workflows/test-hil-validate.mjs
@@ -11,8 +11,18 @@
import { readFileSync } from 'node:fs'
const src = readFileSync(new URL('./hil-validate.js', import.meta.url), 'utf8')
-const body = src.slice(src.indexOf('const byBoard ='), src.indexOf('const first = await runBoards'))
- + src.slice(src.indexOf('const summarize ='), src.indexOf('const { pass, wedged, locked } ='))
+// slice by marker, but never silently: a renamed marker must fail with its name, not with a
+// confusing ReferenceError from a garbage slice
+const cut = (start, end) => {
+ const a = src.indexOf(start), b = src.indexOf(end)
+ if (a < 0 || b < 0 || b <= a) {
+ console.error(`FAIL: extraction marker moved — cannot find ${a < 0 ? `'${start}'` : `'${end}'`} in hil-validate.js`)
+ process.exit(1)
+ }
+ return src.slice(a, b)
+}
+const body = cut('const byBoard =', 'const first = await runBoards')
+ + cut('const summarize =', 'const { pass, wedged, locked } =')
const { byBoard, summarize, wedgedFor } = new Function(`${body}; return { byBoard, summarize, wedgedFor }`)()
let failed = 0