Repository navigation
Follow or refuse the folder a line moves to (#163, part 1) - #182
Merged
Merged
Conversation
A pure move, to make room for the folder family: shellwords.ts is at its size cap. Dialect, State, variables, child and assign go to line-state.ts, unchanged but for `export`. Checked with a script that every removed line is in the new file and every added line is an import or a re-export, with a control that reports a mutated line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cd -- x, cd -P x, pushd x, Set-Location x, sl x, cd -Path x and friends passed with no objection, so the wrong pin file and the wrong link applied, for every CLI. folder.ts now reads each spelling as real Git Bash and PowerShell 5.1 do, a folder set by a variable on the line, and one from the hook's environment (owner's decision 4). Anything else makes the call's cwd UNKNOWN_FOLDER, and guard stops it as "can't tell" unless it is exempt, whether or not a pin file is in sight, since the folder it goes to may have one. Also read now: a command either shell rejects leaves the folder where it was; bash's pipe sides and background jobs keep their folder; Invoke-Expression runs in the session; a PowerShell block or ( ) that moves the folder makes what follows unknown; /c/x in Git Bash on Windows is C:/x, which used to read as C:\c\x, and /tmp is %TEMP%; env -C, sudo -D, pnpm -C, yarn --cwd and Start-Process -WorkingDirectory with a folder only known when it runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#163) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner's decision. A line that moves to a folder cloudpin can't read stops a later non-exempt call as "can't tell" only if findConfig finds a pin file from the last folder the line knew. A pin file it can't read counts as in sight. With none in sight cloudpin does nothing, as DESIGN.md promises for a folder with no pin file: on 30 days of real commands every stop was of that kind. The last known folder travels in its own field, knownCwd, so UNKNOWN_FOLDER never reaches a path lookup and a request without it stops. cloudpin switch still asks and names no pins, and explain says why it lets the line run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHANGELOG.md was at its 20,000-byte cap. 1.2.0 moves, byte for byte, and docs/changelog-1.0-1.1.md is renamed docs/changelog-1.0-1.2.md, newest first. 1.2.1 stays: test/release-docs.test.ts wants the current version's entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #163 (PR 1 of 5, the folder family). Design:
docs/superpowers/specs/2026-11-04-fail-closed-design.md, which this adds with the owner's decisions.The bug.
cd sub && gh ...was read correctly, butcd -- sub,cd -P sub,pushd sub,Set-Location suband others were read as staying put, so the call was checked against the wrong pin file, for every CLI.The fix: follow or refuse.
cd -P/-L/-e/--,pushd,popd,cd -, barecd,~,builtin cd,command cd, a variable set on the line, and one from the hook's environment.cd,chdir,sl,Set-Location,pushd,Push-Location,popd,Pop-Location, with-Path,-LiteralPath,-PSPath.$(...), backticks, an unset variable, a glob or brace,cd a b, stack numbers,CDPATHset, PowerShell's barecd, provider paths and blocks that move the folder. Exempt calls still pass.DESIGN.mdpromises. Socd "$REPO" && az ...from a folder with no pin file in sight passes, andTHREAT_MODEL.mdsays so./c/xwas read asC:\c\x.Argument parsing state moved to
src/line-state.tsfirst, in a commit of its own with a move proof, becauseshellwords.tswas over the size cap.Also:
CHANGELOG.mdmoves 1.2.0 todocs/changelog-1.0-1.2.mdto stay under its limit, and ROADMAP lists #163, #168, #180 and #181 with 1.4.0's date.Evidence
npm run typecheckexit 0;npx vitest run: 3465 passed, 19 skipped.Not tested
pwsh(not installed; PowerShell 7 differs on barecdandcd -, so those stay refused), macOS and Linux shells. Other agents use the same parser but were not run.Limits
A conditional
cdis read as if it ran (test -d a && cd a; gh).cd missing; ghis read as moved.iex $cor a bare$ccould move the folder unseen; that is PR 3's family.🤖 Generated with Claude Code