Skip to content

fix(hooks): pre-tool.sh reset --hard guard reads git status from the hook's cwd, not the command's target worktree #1228

Closed

Description

@admarble

Tier: judgment Graph: tracker #1236 (label graph-2026-09-prerelease)

Moved from admarble/varius#65 — pre-tool.sh is sequant-managed, so the fix has to land here. Still present at a12c441d (hooks/pre-tool.sh:834, same line in templates/hooks/ and .claude/hooks/).

What

.claude/hooks/pre-tool.sh's git reset --hard guard (~line 525) blocked this command:

cd "$WT" && git reset --hard origin/feature/42-... && git merge origin/master

with:

HOOK_BLOCKED: git reset --hard would lose local work:
  - 16 uncommitted file(s)

The target worktree was completely clean — git status --short in it printed nothing.

Root cause

The guard runs git status --porcelain with no -C, so it evaluates the hook's own cwd (the main checkout), not the directory the command targets. PreToolUse runs outside and before the command's shell, so the cd "$WT" prefix has not happened yet — a fact fullsolve/SKILL.md already documents in its Phase 0.3 note ("PreToolUse runs outside and before your command's shell, so nothing a skill bash block exports is visible to it"). The guard just doesn't account for it.

Proof: the main checkout has exactly 16 dirty files, matching the block message digit for digit:

$ git status --porcelain | wc -l
16

Why it matters here specifically

Those 16 files are sequant's own drift artifacts — modified .claude/skills/*/SKILL.md, .sequant-manifest.json, untracked .sequant/ and .claude/.local/. They are permanently present in this checkout. So the guard currently blocks every cd <worktree> && git reset --hard in this repo, unconditionally, regardless of the worktree's real state. The safety check is inverted from its intent: it fires hardest in exactly the isolated worktrees that are safest to reset.

Compounding cost (hit live during #42): with reset --hard blocked and force-push blocked, a routine post-rebase push had no in-session path at all — it had to be handed to the human to run manually.

Fix sketch

Resolve the target directory from the command's own cd/git -C prefix and run the status check there:

TARGET_DIR=$(extract_cd_or_dashC_target "$COMMAND")   # fallback: $PWD
UNCOMMITTED=$(git -C "${TARGET_DIR:-.}" status --porcelain 2>/dev/null | wc -l | tr -d ' ')

Check 1 (unpushed commits) and Check 3 (MERGE_HEAD) have the same defect — both resolve against the hook's cwd — so all three want the same treatment.

Non-goals

  • Relaxing the guard. Blocking a genuinely destructive reset --hard is correct; this is about evaluating the right repository.

Found during admarble/varius#42 (PR admarble/varius#63).

  • Fix pattern already in the file. resolve_cd_target (used by the commit guard since 2026-09-20, pre-tool.sh:575) resolves cd/segment-start cd targets. Reuse it, plus a git -C <dir> extraction, for all three reset-hard checks, with fallback to the hook cwd.

Probe (2026-09-30, main @ 9da8aeb8, hooks/pre-tool.sh driven with a real payload)

Command Hook cwd Today Correct
git reset --hard dirty repo BLOCKED BLOCKED
git -C <dirty> reset --hard clean repo allowed BLOCKED
cd <clean> && git reset --hard dirty repo BLOCKED (this report) allowed
cd <dirty> && git reset --hard clean repo allowed BLOCKED

The false allows are the more serious half. git -C <dir> reset --hard never matches the trigger (seg_match 'git reset.*(--hard|origin)' requires git reset to be adjacent), and a cd <dirty> prefix is evaluated against the clean hook cwd. So the fix must widen the trigger to accept git -C <dir> reset, as well as resolve the target directory. That's why the tier is judgment.

Acceptance Criteria

  • AC-1: cd <clean-worktree> && git reset --hard origin/x is allowed while the hook cwd (the main checkout) is dirty. Evidence: npx vitest run __tests__/pre-tool-hook.integration.test.ts, using a sandbox main checkout plus a linked worktree; mutation-verified by reverting Check 2 to a cwd-relative git status
  • AC-2: cd <dirty-worktree> && git reset --hard and git -C <dirty-worktree> reset --hard are both blocked, including when the hook cwd is clean. Evidence: npx vitest run __tests__/pre-tool-hook.integration.test.ts
  • AC-3: A bare git reset --hard in a dirty cwd is still blocked, and every existing golden-corpus verdict is unchanged. Evidence: npx vitest run __tests__/hook-corpus.integration.test.ts
  • AC-4: Check 1 (unpushed commits), Check 3 (MERGE_HEAD) and the remediation text's branch name all evaluate the same resolved target directory. Evidence: npx vitest run __tests__/pre-tool-hook.integration.test.ts, covering a worktree mid-merge reached with a cd <wt> prefix (BLOCKED) and a main checkout mid-merge with a cd <clean-wt> prefix (allowed)

Non-Goals

  • Relaxing the guard. Blocking a genuinely destructive reset is correct; this is about evaluating the right repository.

🤖 Generated with Claude Code

May touch

  • hooks/pre-tool.sh, .claude/hooks/pre-tool.sh, templates/hooks/pre-tool.sh (keep all three byte-identical)
  • __tests__/pre-tool-hook.integration.test.ts
  • __tests__/fixtures/hook-corpus.jsonl (add entries only; don't change existing verdicts)

File overlap: none with the other #1236 nodes.

Activity

  1. added
    graph-2026-09-prerelease
    on Sep 30, 2026
  2. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    Context for the run (re-checked against main @ 9da8aeb8, 2026-09-30; graph tracker #1236, wave 1)

    The body now carries a probe table and retargeted ACs. Read it first: the trigger regex has to widen, not just the git calls.

    Current code (hooks/pre-tool.sh, identical in .claude/hooks/ and templates/hooks/):

    • :820: trigger seg_match 'git reset.*(--hard|origin)'. It never matches git -C <dir> reset ….
    • :821: CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD). This feeds Check 1 and the remediation text (git push origin $CURRENT_BRANCH).
    • :826: Check 1, git log origin/$CURRENT_BRANCH..HEAD.
    • :833: Check 2, git status --porcelain.
    • :840: Check 3, GIT_DIR=$(git rev-parse --git-dir) then $GIT_DIR/MERGE_HEAD. In a linked worktree MERGE_HEAD lives in the per-worktree gitdir, so this must run with -C <target>.
    • All four run in the hook process's own cwd.

    Target resolution: mirror the #1199 commit guard exactly (:1212-1214):

    TARGET_DIR=$(resolve_cd_target "$TOOL_INPUT")      # :575, already used by the commit guard
    # plus: if the reset segment is `git -C <dir> reset …`, <dir> wins (resolve it relative to the cd target / cwd)
    TARGET_DIR="${TARGET_DIR:-${HOOK_CWD:-$PWD}}"
    • HOOK_CWD is the payload's cwd, which is the command's own directory. A bare $PWD fallback is wrong.
    • Then run every check with git -C "$TARGET_DIR" ….
    • If TARGET_DIR isn't a git repo, keep today's behaviour for that case and don't silently allow.

    Trigger: widen it so git -C <dir> reset --hard (and git -C <dir> reset … origin…) match. Keep the #763 property that quoted or heredoc text never triggers. $SEGMENTS is already sanitized, so match against it just as seg_match does today.

    Tests:

    • AC-1, AC-2 and AC-4 go in __tests__/pre-tool-hook.integration.test.ts. Reuse the feat(worktree): configurable worktree root #1199 sandbox pattern in that file (a main checkout plus a linked worktree at custom-root/issue-1199). For AC-4's mid-merge state, write MERGE_HEAD under git -C <wt> rev-parse --git-dir.
    • AC-3 is the existing golden corpus. Run __tests__/hook-corpus.integration.test.ts, which snapshots every verdict, so any changed existing entry is a regression. You may add corpus entries, but you may not change existing verdicts.
    • AC-1 asks for its own mutation: revert Check 2 to a cwd-relative git status and confirm exactly the AC-1 test fails. Record the marker.
    • Keep the three hook copies byte-identical (cmp).

    PR body: say that the hook change reaches plugin users only after the plugin version bump in the next release.

    Standard block:

    • No full npm test in exec or in qa. This applies to the qa phase as well as exec. Run targeted suites in the foreground with a timeout: timeout 600 npx vitest run __tests__/pre-tool-hook.integration.test.ts __tests__/hook-corpus.integration.test.ts. Global setup runs npm run build first.
    • Commit WIP early, and always before any mutation.
    • A mutation marker's failedTest starts with the test file path.
    • PR body: Closes #1228. Use Refs only for the tracker, tracker(graph): pre-release fixes before the next release after 2.18.0 (4 nodes) #1236.
    • Skill snippets that read .sequant/settings.json must handle JSONC (not expected to apply here).
    • Add a CHANGELOG ### Fixed entry under [Unreleased].
  3. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, 2 directories)

    AC Quality Check

    All four ACs are single-line with a runnable Evidence: clause, and none is vacuous on main @ 9da8aeb8. AC-1 and AC-2 fail today per the probe table in the body (a false block and two false allows). AC-4's cd-into-a-mid-merge-worktree case is a false allow today. AC-3 passes today, which is expected because it is the regression guard.

    • ⚠️ AC-2 hides a quoted -C path. The literal case git -C <dirty-worktree> reset --hard is unquoted, but $SEGMENTS blanks double-quoted regions. git -C "$WT" reset --hard origin/x sanitizes to git -C reset --hard origin/x (probed with emit_segments). So the -C path has to come from the raw command, the way resolve_cd_target reads it, not from $SEGMENTS. A dynamic path ($, backtick, backslash) fails open to the fallback directory, which is today's behaviour.

    Scope Assessment

    Non-Goals: Relaxing the guard. Blocking a genuinely destructive reset stays correct.

    Metric Value Status
    Feature count 1 (reset guard target resolution) ✅
    AC items 4 ✅
    Directory spread 2 (hooks/ ×3 mirrors, __tests__/) ✅

    Verdict: ✅ SCOPE_OK


    Acceptance Criteria

    AC-1: cd <clean-wt> && git reset --hard origin/x is allowed while the main checkout is dirty

    Verification: Integration Test (__tests__/pre-tool-hook.integration.test.ts)
    Scenario: Given a sandbox main checkout with an untracked file and a clean linked worktree. When the hook runs from the main checkout (process cwd and payload cwd = main) with cd <wt> && git reset --hard origin/x. Then exit 0 with no HOOK_BLOCKED.
    Assumptions: origin/x doesn't need to exist, because the guard never resolves the ref. Mutation: revert Check 2 to a bare git status --porcelain, and only this test fails. Record <!-- SEQUANT_MUTATION: {"ac":"AC-1",…,"failedTest":"__tests__/pre-tool-hook.integration.test.ts > … > …"} -->.

    AC-2: cd <dirty-wt> && git reset --hard and git -C <dirty-wt> reset --hard both block, even with a clean hook cwd

    Verification: Integration Test
    Scenario: Given a clean main checkout and a linked worktree with an untracked file. When either form runs from main. Then exit 2 with HOOK_BLOCKED: git reset --hard would lose local work and 1 uncommitted file(s).
    Assumptions: The trigger has to widen. Today seg_match 'git reset.*(--hard|origin)' never sees git -C <dir> reset. Add a quoted-path variant (git -C "<dirty-wt>" reset --hard) so the raw-command extraction is pinned too.

    AC-3: A bare git reset --hard in a dirty cwd still blocks, and every golden-corpus verdict is unchanged

    Verification: Integration Test (__tests__/hook-corpus.integration.test.ts)
    Scenario: Given the 339-entry corpus, 11 of which mention reset. When it is replayed. Then the snapshot matches, and new entries are add-only.
    Assumptions: The corpus cd targets are /Users/user/… paths that don't exist, or dynamic (cd $W, cd $S). So resolve_cd_target returns empty and falls back to the replay sandbox, which keeps existing verdicts. If one flips, that is a regression, not a snapshot update.

    AC-4: Check 1, Check 3 and the remediation branch name all use the resolved target

    Verification: Integration Test
    Scenario: Case 1: the worktree is mid-merge (MERGE_HEAD written under git -C <wt> rev-parse --git-dir), and cd <wt> && git reset --hard runs from a clean main. The command is blocked with Unfinished merge in progress. Case 2: main is mid-merge but otherwise clean, and cd <clean-wt> && git reset --hard is allowed.
    Assumptions: In a linked worktree, git rev-parse --git-dir returns an absolute per-worktree path. In the main checkout it returns a relative .git, so it has to be anchored: git -C "$T" rev-parse --absolute-git-dir, or $T/$GIT_DIR. Add an assertion that the remediation line reads git push origin feature/…, which pins CURRENT_BRANCH.


    Implementation Plan

    Phase 1: Hook (hooks/pre-tool.sh, then cp to .claude/hooks/ and templates/hooks/)

    1. Add resolve_git_c_target <tool_input> next to resolve_cd_target (:575). It prints the <dir> of a raw git -C <dir> reset occurrence and applies the same quote-strip, the same fail-open on $/backtick/backslash, and the same -d check. It runs on the raw command because $SEGMENTS blanks quoted paths. Resolve a relative <dir> against the cd target, or else against HOOK_CWD.
    2. Widen the trigger (:820) to seg_match 'git( -C +[^ ]*)? +reset.*(--hard|origin)', or an equivalent ERE. It has to tolerate the blank that a sanitized quoted path leaves behind. The match stays on $SEGMENTS, so the fix(hooks): ^gh (issue|pr) prefix skip disarms all 5 pre-tool guards for compound commands, and re-breaks on any cd prefix #763 guarantee still holds: quoted text and heredoc text never trigger it.
    3. Resolve the target by mirroring the feat(worktree): configurable worktree root #1199 commit guard (:1212): RESET_DIR = -C dir if found, else resolve_cd_target, else ${HOOK_CWD:-$PWD}. If git -C "$RESET_DIR" rev-parse --git-dir fails, meaning the target is not a repo, fall back to ${HOOK_CWD:-$PWD}. That is today's evaluation, and it never silently allows.
    4. Retarget all four git calls (:821, :826, :833, :840) to git -C "$RESET_DIR" …. Check 3 uses --absolute-git-dir so MERGE_HEAD resolves correctly from a hook process running in another directory.
    5. cmp all three copies.

    Phase 2: Tests

    1. Add a new describe.each(HOOK_COPIES) block for fix(hooks): pre-tool.sh reset --hard guard reads git status from the hook's cwd, not the command's target worktree #1228 in pre-tool-hook.integration.test.ts. Reuse the feat(worktree): configurable worktree root #1199 sandbox shape: a main checkout plus a linked worktree at a custom root, and a runner that sets both the process cwd and the payload cwd. Cover AC-1, AC-2 (unquoted, quoted, and cd forms), and AC-4 (both merge cases plus the branch in the remediation text). Toggle dirty/merge state per test (beforeEach), or use separate worktrees, so the cases don't bleed into each other.
    2. Optionally, add corpus entries for the new shapes (add-only), then run timeout 600 npx vitest run __tests__/pre-tool-hook.integration.test.ts __tests__/hook-corpus.integration.test.ts. No full npm test, in either exec or qa.
    3. Commit WIP, then run the AC-1 mutation and record the marker with a failedTest that starts with the file path.

    Phase 3: Release notes

    1. Add a CHANGELOG [Unreleased] → ### Fixed entry. The PR body says Closes #1228 and Refs #1236, and notes that plugin users only get the hook change after the next release's plugin version bump. Both hooks fire: the repo copy and the plugin-cache copy.

    Design Review

    1. Where does this logic belong? In the pre-tool.sh reset guard, next to the existing resolve_cd_target/in_linked_worktree helpers. The mirror copies stay byte-identical.
    2. What's the simplest correct approach? Resolve one directory, then pass it to every git call with -C. I rejected parsing a full shell (the "reimplementing the shell" argument from bug(hooks): pre-tool.sh No-Changes Guard only recognizes single-line 'cd path && git commit', silently blocking real multi-line commits #963) and moving the guard to TS (hooks are excluded from TS consolidation). Neither choice between designs is an ADR-level decision, so no ADR is needed.
    3. What existing pattern does this follow? The feat(worktree): configurable worktree root #1199 commit guard (COMMIT_DIR=$(resolve_cd_target …); ${COMMIT_DIR:-${HOOK_CWD:-$PWD}}) and the bug(hooks): pre-tool.sh No-Changes Guard only recognizes single-line 'cd path && git commit', silently blocking real multi-line commits #963 fail-open-on-dynamic rule.
    4. What would a senior reviewer challenge?
      • "Doesn't fail-open weaken a safety guard?" No. Fail-open here means falling back to today's cwd evaluation, never to allowing.
      • "Why not reuse $SEGMENTS for -C?" It blanks quoted paths, as shown above.
      • "Does the widened regex catch prose?" No, because it still matches against sanitized segments. Pin it with a gh issue comment --body "git -C x reset --hard" allow case.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Sibling sites (surfaced, not widened): resolve_cd_target has two latent limits that the reset guard now inherits. (a) It takes the last cd in the command, so in cd <dirty> && git reset --hard && cd <clean> the guard evaluates <clean>, which is a false allow. (b) It tests a relative target with -d against the hook process cwd, not HOOK_CWD. Both already affect the commit guard. See Open Questions.
    • Plugin reach: repo edits don't reach plugin-cache users until a version bump. This belongs in the PR note, not an AC.

    Derived ACs

    Source Derived AC Priority
    #763 invariant AC-5: gh issue comment 1 --body "git -C /x reset --hard" stays allowed (the widened trigger ignores quoted text). Evidence: npx vitest run __tests__/pre-tool-hook.integration.test.ts Medium
    Robustness AC-6: git -C "$WT" reset --hard (dynamic) evaluates the fallback directory, matching today. Evidence: same suite Low

    Open Questions

    1. "Last cd wins" in resolve_cd_target. Recommendation: leave it as it is for this issue, add a comment in the reset guard, and file a follow-up covering both guards. Impact if wrong: a cd <dirty> && git reset --hard && cd <clean> chain gets through. That is rare, but it is a false allow.
    2. Relative cd target resolved against the process cwd. Recommendation: fix it inside resolve_cd_target only if a relative case turns up in the new tests. Otherwise make it the same follow-up. Impact if wrong: a relative cd sub && git reset --hard from a payload cwd different from the process cwd evaluates the wrong directory, which exec can't reproduce in real Claude Code, where the two cwds match.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: enabled
    Reasoning: This is a judgment-tier bug fix in a safety guard, and the owner's context comment already fixes the test design, so testgen would be ceremony. The quality loop is on because the trigger regex widens, and a regression there shows up as a corpus verdict flip.


    Label Review

    Current: graph-2026-09-prerelease
    Recommended: add bug, planned
    Reason: It's a defect fix in hooks/, and it's labeled planned once this spec posts.

  4. added
    planned
    bug
    on Sep 30, 2026
  5. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #1228

    AC Coverage

    AC Source Status Notes
    AC-1 Original MET "AC-1: allows cd …" passes ×3 hook copies; mutation marker recorded
    AC-2 Original MET 4 forms (cd, -C, quoted -C, relative -C under cd) block with branch feature/1228-dirty in remediation
    AC-3 Original MET hook-corpus suite green; corpus diff is add-only (2 new #1228 entries, no existing verdict changed)
    AC-4 Original MET worktree mid-merge blocks; main mid-merge + cd <clean-wt> allows; remediation branch pinned. Check 1 retarget verified by code review only (see gaps)
    AC-5 Derived MET quoted body text never triggers
    AC-6 Derived MET dynamic -C "$WT" falls back to payload cwd

    Coverage: 6/6 met

    CI Status

    Check State Impact
    test IN_PROGRESS ⏳ PENDING (required check)
    canary, typecheck, Hooks Validation, validate-*, Plugin Structure, node-floor-guard, tautology-advisory, Setup Directory Creation SUCCESS ✅

    CI Summary: 9 passed, 1 pending (test), 0 failed

    Local verification (run this pass)

    • timeout 600 npx vitest run __tests__/pre-tool-hook.integration.test.ts __tests__/hook-corpus.integration.test.ts → 2 files, 1448/1448 passed, exit 0
    • cmp across hooks/, .claude/hooks/, templates/hooks/ → byte-identical
    • Full npm test not run (per the issue's standard block)

    Code Review

    Strengths: mirrors the #1199 commit guard's target order; -C path is read from the raw command (sanitized $SEGMENTS blanks quoted paths) while the trigger still matches sanitized segments (#763 preserved); non-repo target falls back to payload cwd then process cwd (never a silent allow); --absolute-git-dir fixes the relative-.git trap for Check 3; GIT_DIR → RESET_GIT_DIR avoids env shadowing.

    Issues / gaps (non-blocking):

    • Motivating example still blocks. The issue's verbatim command cd "$WT" && git reset --hard origin/feature/42-… && git merge origin/master with a dirty main checkout → still HOOK_BLOCKED (probed). This is the spec's intended bug(hooks): pre-tool.sh No-Changes Guard only recognizes single-line 'cd path && git commit', silently blocking real multi-line commits #963 fail-open for a dynamic path, and literal paths now work, but the reporter's exact shape isn't fixed.
    • Check 1 retarget untested. No test puts a target on main with unpushed commits while the hook cwd differs; only code review covers it.
    • Pre-existing trigger gaps (unchanged, probed on origin/main too): git -C <dirty> -c x=y reset --hard, git -c … -C <dirty> reset --hard, git --git-dir=… reset --hard never trigger. Same for last-cd/last--C wins (noted in PR).

    Adversarial Re-Read

    Findings: Ran 10 hand probes against a real main+worktree sandbox: literal/quoted cd → allowed when target clean; echo '…git -C … reset --hard' allowed; git -C wt log && git reset --hard evaluates cwd (correct: the -C isn't on the reset); --soft not triggered; relative -C ../wt resolved. Gaps are the three above. Non-goal (relaxing the guard) not violated.

    Status: Gaps Found

    Trust-Boundary Check

    Finding: Clean — diff implements only product requirements; no agent-directed external-text instruction was acted on.
    Status: Clean

    Behavior-Rule Survival Check

    Status: N/A — no AC triggers the heuristic.

    Declared-Evidence Execution

    AC Evidence Executed? Result
    AC-1/2/4/5/6 npx vitest run __tests__/pre-tool-hook.integration.test.ts Yes ✅
    AC-3 npx vitest run __tests__/hook-corpus.integration.test.ts Yes ✅

    Status: Complete

    Mutation Verification

    AC Gate Test? Marker Status
    AC-1 Yes (mutation required by AC text) __tests__/pre-tool-hook.integration.test.ts > … > AC-1: allows … Verified (file in diff)

    Status: Verified

    CHANGELOG Verification

    Result: [Unreleased] → ### Fixed entry present with (#1228); notes the plugin-bump reach.

    Risk Assessment

    • Likely failure mode: A reset whose target is dynamic (cd "$WT") still evaluates the hook cwd — both the false block (dirty main) and false allow (clean main, dirty target) persist for that shape.
    • Not tested: Check 1 on a retargeted main with unpushed commits.
    • Sibling sites considered: the feat(worktree): configurable worktree root #1199 commit guard shares resolve_cd_target's last-cd-wins and process-cwd -d limits.
    • Sibling-line audit: all four git calls in the reset block retargeted (branch, Check 1, 2, 3).

    Verdict: NEEDS_VERIFICATION

    All ACs are met locally, but the required test CI check is still IN_PROGRESS on 3cd15fa2. Once it is green, this is AC_MET_BUT_NOT_A_PLUS (non-blocking gaps above), not READY_FOR_MERGE.

    Next Steps

    1. Re-run /qa 1228 once test reports.
    2. Optional: add a Check 1 retarget test.
    3. File one follow-up for the guard's remaining target limits (dynamic cd, other git global options, last-cd wins).
  6. added
    needs-verification
    on Sep 30, 2026
  7. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

  8. added a commit that references this issue on Sep 30, 2026
  9. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    Runner verification: PR #1237 (QA NEEDS_VERIFICATION; QA's review body wasn't recorded, only the verdict line). I drove the real hook with payloads against a sandbox main checkout and linked worktrees. Both false allows are closed (git -C <dirty> reset --hard, and cd <dirty> && … from a clean cwd), and the reported false block is fixed for literal cd <wt>.

    Design point for the owner: the report's exact command, cd "$WT" && git reset --hard …, is still blocked when the main checkout is dirty. A variable target can't be resolved before the command's shell runs, so the guard checks the command's cwd. That fails closed on purpose. The block message now prints Checked: <dir> and says only literal targets resolve, so the fix for the user is to write the path literally. I repeated the AC-1 mutation myself. Full table in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggraph-2026-09-prereleaseneeds-verificationplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions