Commit Graph

3 Commits

Author SHA1 Message Date
YeonGyu-Kim
72cdab877f fix(scripts): suppress cargo noise and document CLAW_CONFIG_HOME isolation
Two gaps from Gaebal's 21:30 dogfood round:
1. cargo compile noise leaked to stderr during dogfood probes
2. real user config (~/.claw/settings.json) bled in via deprecation
   warnings ("enabledPlugins") even for purely local introspection

Changes:
- Redirect cargo build stderr to /dev/null (-q flag + 2>/dev/null)
  with a fallback re-run on failure so errors remain visible
- Document CLAW_CONFIG_HOME isolation pattern in script output:
    CLAW_ISOLATED=$(mktemp -d)
    CLAW_CONFIG_HOME=$CLAW_ISOLATED $CLAW <cmd> --output-format json
    rm -rf $CLAW_ISOLATED
- With isolation: zero stderr lines for plugins list probe, pure
  JSON stdout, no config warnings

Verified: exit 0, kind:plugin, 0 stderr lines, 0 sessions created.
2026-05-05 06:35:56 +09:00
YeonGyu-Kim
dbb1423164 fix(scripts): inject GIT_SHA in dogfood-build.sh so provenance check passes
cargo build without GIT_SHA env var → option_env!("GIT_SHA") = None
→ version JSON returns git_sha:null → dogfood-build.sh fails its own
provenance check every time.

Fix: pass GIT_SHA=$(git rev-parse --short HEAD) to cargo build.
The script now:
  1. Sets GIT_SHA to current HEAD before cargo build
  2. Reads git_sha from the built binary
  3. Compares against HEAD — fails if still null or mismatched

Also adds latency note: cargo run = ~1s overhead/invocation vs 7ms
for pre-built binary; pre-built is recommended for dogfood loops.

Closes the broken provenance check introduced in the initial
dogfood-build.sh commit.
2026-05-05 06:34:29 +09:00
YeonGyu-Kim
d074d1c046 fix(mcp): exit 1 when JSON envelope contains ok:false (#2995)
* fix(mcp): exit 1 when JSON envelope contains ok:false

mcp info, mcp describe, and mcp list-filter all return
{"action":"error","ok":false,...} but previously exited 0,
requiring automation callers to inspect the envelope field.

After this fix: print_mcp detects ok:false in the rendered JSON
value and calls process::exit(1) after printing, so the exit code
reflects the semantic error in the envelope.

Unaffected: mcp list, mcp show, mcp help all have no ok field and
continue to exit 0 (they are not error paths).

Closes ROADMAP #68 (partial — agents bogus/mcp show nonexistent
found:false remain exit:0 as they use different envelope shapes).

* feat(scripts): add dogfood-build.sh — build from checkout and verify provenance

Builds claw from the current HEAD, then checks that the binary's
git_sha matches git rev-parse --short HEAD. Exits non-zero if the
binary is stale or provenance is opaque (git_sha: null).

Usage:
  CLAW=$(bash scripts/dogfood-build.sh)   # fail-fast if stale
  $CLAW version --output-format json       # provenance confirmed

Addresses ROADMAP #69: dogfooders using a stale installed binary
cannot attribute behavior to specific commits. This script makes
dogfood round zero unambiguous.

Also documents the safe workaround for contributors who have a
stale system-installed binary.
2026-05-05 06:09:11 +09:00