AntFleet

Disagreement · d8976a54-anthropic-0

Build skill gate-check uses unsafe shell substitution from JSON

solo Opus
repo 53606958·PR #2·reviewed 1 week ago

Opus finding

Build skill gate-check uses unsafe shell substitution from JSON

lowbughigh
  • .claude/skills/build.md:11-16
The gate-check spawns node to read mode from goals.json and compares the captured stdout to the literal string 'build'. node's console.log will append a newline (stripped by $()), which is fine, but if goals.json is missing/invalid the require() throws and MODE becomes empty; the script then proceeds past the check with `[ "" != "build" ]` which is true, exiting 0 — that part is safe. However if `mode` field is absent, console.log prints 'undefined', again exiting 0 safely. The real risk: relying on `require()` of a JSON file path resolved from cwd silently couples behavior to where the skill is invoked from. If invoked from any subdirectory, require('./memory/goals.json') fails, MODE is empty, and the gate exits saying 'Mode is '' — not in build mode' — which masks a real failure (we wanted build mode but cannot even read goals). Better to fail loudly when goals.json cannot be read.

Recommendation

Use `jq -r .mode memory/goals.json` (or `node -e` with explicit path resolution and process.exit(1) on error) and treat any non-'build'/non-'accumulate' value as an error rather than a silent no-op.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →

From the same review

These findings passed the unanimous gate on the same PR review. The disagreement above was filtered out; the findings below were posted.