Repository navigation
Conversation
A `cd ~/x` target made the effective directory unknown, so the external gate resolved every relative token after it against the session cwd — a path the shell never reaches — and a `./`-prefixed token was not projected at all. `~/` is static: bash expands it from HOME before `cd` runs, so the target now folds to `os.homedir()` plus its rest, with the separator kept verbatim for a quoted remainder. A rebound HOME, `~user`, a tilde running into a quoted part (`~"x"`), a slash the shell escapes (`~\/x`), and bare `cd` keep the unknown base. Refs gotgenes#1083
ADR 0009 gains the 2026-10-24 amendment, the completeness contract names the fold, the configuration guide stops calling `cd ~` a non-literal target, and the resolver's architecture entry says how the target folds. Refs gotgenes#1083
…d-tilde cd The `~\/work` token is reported as `$HOME/work` when that directory exists, as it does on GitHub runners, so asserting the whole list failed there. Assert the unknown base instead: the cwd-relative path is present and nothing is spelled from home.
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.
Closes #1083.
A
cd ~/…target used to render the effective directory unknown, so every relative token after it was resolved against the session cwd — a path the shell never reaches and no rule can match — and a./-prefixed token was not projected at all.~/is static: bash expands it fromHOMEbeforecdruns.This folds an unquoted
~/~/…target toos.homedir()plus the rest of the word verbatim, under theShellVariablesrule the token projection already applies.The rest is spelled verbatim rather than through
expandHomePath, whosejoinwould drop the separator a following concatenation part relies on (cd ~/"work").What keeps the unknown base, and why:
HOME(HOME=/tmp cd ~/x), the existingspellsReboundHomerule;~user, which reads the password database rather thanHOME;~"work", because bash ends the tilde-prefix only at an unquoted slash, so that word is the literal~work;~\/work, because the backslash quotes the slash and bash expands nothing;~(cd "~/x",cd '~/x'), which is not a tilde-prefix at all and stays the relative literal it is;cdandcd -.Seven cases cover the fold in
test/access-intent/bash/program-external-accesses.test.ts;~/work && cat ../notes.txtprojects<cwd>/../notes.txtwithout thesrcchange.The existing unknown-base case now uses
cd "$DIR"so it keeps testing what its name says.Checks, from the repo root:
Docs: ADR 0009 amendment (2026-10-24), the completeness contract,
docs/configuration.md, and thebash-path-resolver.tsarchitecture entry.Out of scope, and still unknown:
$HOME/xas acdtarget, barecd, andcd -.