Repository navigation
security-adversarial: BASELINE_COMMIT git-show oracle fails opaquely on a shallow clone (issue #149) - #150
Conversation
…on a shallow clone (issue #149) scripts/benchmark-ticket-codec.mjs's withReference() hardcodes BASELINE_COMMIT and fetches a reviewed historical reference via `git show <sha>:<path>`, deliberately refusing any arbitrary revision argument. On a shallow clone that doesn't reach that commit (reproduced live on this session's own fresh checkout), the 3 "pinned reviewed reference" governance tests failed with a bare execFileSync stderr dump instead of a diagnosis. This repo's own CI already works around the identical fragility with `fetch-depth: 0` (.github/workflows/ci.yml, dream-nightly.yml) but no other checkout path is protected. Adds hasCommit()/tryFetchCommit(): before the existing git show, self-heal by fetching exactly the hardcoded BASELINE_COMMIT literal (never a caller-supplied ref, so the "no arbitrary revision" property is unchanged) with `git fetch --depth 1 origin <sha>`; if that still doesn't resolve, raise a clear, actionable error instead of the opaque one. Content-addressed fetch of a fixed SHA cannot be redirected to different content. npm test 769+150->769+152 (+2 new regression tests), 3 previously-failing governance tests now pass, 0 regressions elsewhere. typecheck/lint clean. Independent adversarial critic (separate subagent context): CLEAR, no reward-hacking or security weakening; one nitpick (silence git cat-file -e's stderr) adopted. Darwin: blocked by this session's own sandbox policy (unpinned external code), corroborating the already-tracked evaluatorEntrypoints.darwin finding. Report: docs/dream-cycle/2026-10-03-security-adversarial-report.md Witness: 3c3dc0728d1b327253b66d0021e80ffd0d5084056644f7f424baf31206ba416f Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NNkaaVC27NoJSbhxb782x5
…heal Ledger row for 2026-10-03: issue #149, PR #150, ACCEPT, witness 3c3dc072. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NNkaaVC27NoJSbhxb782x5
# Conflicts: # docs/dream-cycle/LEDGER.md
…fc3222 Merged main into this draft (merge commit 7807661, no rebase/force-push), re-ran the real evaluator and a fresh independent critic/reward-hack pass on the unchanged diff, refreshed the report's Evaluation Receipt and Witness. ACCEPT still holds; stays draft because dependency-audit is red on this head for a pre-existing, unrelated reason (issue #197). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aoR1LqtwDHBLDLMWxRcUa
Dream Cycle consolidation — 2026-10-24MODE=CONSOLIDATE (STEP 1.5): 20 open Action. Merged Re-evaluation on the new head. Real evaluator ( Fresh critic + reward-hack pass (this round, independently re-derived from the live diff, not a reread of the prior verdict). Confirmed CI on the pushed head. Decision. ACCEPT still holds and the fresh critic is clear, but not every required check on the new head is green ( No merge, no close, no force-push, no self-promotion. Generated by Claude Code Generated by Claude Code |
…cted) Intent/result receipts for tonight's external side effects (1 push, 1 PR comment, 1 issue comment) per the schedule contract (ruvnet/core-memory AGENTS.md rule 5, issue #187). Reconstructed after the fact from this session's own tool-call record, same as the 2026-10-21 precedent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aoR1LqtwDHBLDLMWxRcUa
Closes #149.
Hypothesis
Given a git checkout whose local history does not reach the hardcoded
BASELINE_COMMIT(35c9fd31ec0369f1c4b0ac7d5eda13d766bbb8cf) thatscripts/benchmark-ticket-codec.mjs'swithReference()fetches viagit show <sha>:<path>— the realistic case for a shallow clone (reproduced live on this session's own fresh checkout) — adding a self-heal step (git fetch --depth 1 origin <BASELINE_COMMIT>, the literal constant only, never a caller-supplied ref) before the existinggit showshould make the previously-failing governance tests pass with network access toorigin, and produce a clear, actionable diagnostic instead of an opaque stderr dump without it — without ever makingBASELINE_COMMITconfigurable. Confirmed.Candidate
scripts/benchmark-ticket-codec.mjs: addshasCommit(commit)(exported,git cat-file -e <commit>^{commit}, stderr silenced) andtryFetchCommit(commit)(private,git fetch --depth 1 origin <commit>, best-effort).withReference()now checkshasCommit(BASELINE_COMMIT)first; if missing, attempts the fetch, then asserts again with a clear message naming the remediation (git fetch --depth 1 origin <sha>orfetch-depth: 0, citing.github/workflows/ci.yml's existing precedent) if it still can't resolve.BASELINE_COMMITitself is unchanged — still a hardcoded literal, never configurable; the golden comparison logic (git show, hashing, transpile, differential compare) is untouched.scripts/benchmark-ticket-codec.test.mjs: +2 tests — one confirminghasCommit(BASELINE_COMMIT)is true afterwithReference()'s self-heal runs (regression guard that the pinned commit stays resolvable), one confirminghasCommit('0'.repeat(40))isfalse(a syntactically valid, never-existing object id — exercises the negative/missing-commit branch deterministically, without depending on real network failure to prove it).+32/-0 net new lines in the source file, +14 in the test file. Well under the 300-line target, one conceptual change.
Evaluation Receipt
Real evaluator:
npm test(vitest run && npm run test:governance), run live before and after on this session's own shallow checkout (candidate stashed for the baseline run, then restored):npm run typecheckandnpm run lintclean on the candidate.Baseline
Measured live by
git stash-ing the candidate diff and re-running the identicalnode --test scripts/benchmark-ticket-codec.test.mjs/npm testcommands — not inferred from logs, not simulated.Darwin Lineage
DARWIN=blocked.npx @metaharness/darwin --versionresponded (entrypoint live), but this session's own sandbox permission classifier denied the boundedevolveinvocation as "Code from External"; not worked around. Corroborates the repo's already-trackedevaluatorEntrypoints.darwinunpinned-npxfinding (packages/compile/src/supplychain.ts). Not required for this verdict (Darwin is optional, "only if available" — judged not safely available tonight).Evidence
OBSERVATION (live 3-test baseline failure) → OBSERVATION (
git cat-file -econfirms missing object) → OBSERVATION (CI's ownfetch-depth: 0precedent) → HYPOTHESIS (frozen above) → MEASUREMENT (769/150→147 baseline; 769/152→152 candidate) → INFERENCE (independent critic, separate context) → DECISION (ship; ACCEPT).Reward-Hack Check
Independent adversarial critic (separate subagent, no authorship stake, read the real diff and live
.gitstate directly, not a paraphrase): CLEAR. No fixture/golden-answer/threshold/seed/iteration-count touched. Confirmed content-addressing holds (agit fetchof an exact SHA cannot be redirected to different content without a hash collision). Confirmed no masking of a real reference/candidate mismatch — the comparison logic runs unchanged once the commit resolves. Confirmed the new error message's CI-precedent file/line references are accurate. One nitpick adopted (silencegit cat-file -e's stderr on a miss); non-blocking notes on.gitside-effect visibility left as disclosed, not blocking.Security Review
No prompt-injection/MCP-authority/credential surface touched. Filesystem scope: only new side effect is
git fetch --depth 1 origin <fixed-sha>, writing objects/refs into this checkout's own.git— content-addressed, so the fetched bytes are cryptographically bound to the already-hardcoded SHA; nothing lets a caller substitute a different commit. Network scope: outbound tooriginonly. No production/runtime code path changed.Regression Analysis
0 regressions: vitest count unchanged (769), governance count increased only by the 2 new tests added here, all previously-passing tests still pass. The 3 newly-passing tests were never weakened — they are the exact same assertions, now reached for the first time on this checkout.
ADR
None. Not an architectural decision — a reliability/reproducibility fix to test infrastructure, explicitly out of scope per STEP 19 ("never for parameter changes... minor... tweaks").
Gist
GIST=LOCAL— noghCLI (invalid token this session) or gist-creation MCP tool available. Full report committed atdocs/dream-cycle/2026-10-03-security-adversarial-report.md.Issue
#149
Witness
Reproduce:
node packages/cli/dist/bin.js witness verify-report docs/dream-cycle/2026-10-03-security-adversarial-report.md --commit 23a577082aad39750051dc7ef0ec9d0d72900adfMerge Policy
Human review required. This session never self-merges and never autonomously promotes candidate state. No
automerge-safelabel applied.🤖 Generated with Claude Code
https://claude.ai/code/session_01NNkaaVC27NoJSbhxb782x5
Generated by Claude Code