4.6 KiB
4.6 KiB
phase, plan, subsystem, tags, status, requires, provides, affects, tech-stack, key-files, decisions, metrics, actuals, plan_head_before, plan_head_after
| phase | plan | subsystem | tags | status | requires | provides | affects | tech-stack | key-files | decisions | metrics | actuals | plan_head_before | plan_head_after | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick-261008-k7s | 01 | sunrise (bootstrap script) |
|
complete |
|
|
|
|
|
|
|
8973da5cc1 |
ddf1178c51 |
Quick 261008-k7s Plan 01: Bootstrap script PATH hint per login shell Summary
The bootstrap script now reads the login shell from SHELL and ends with fish_add_path "<dir>" for fish, an export PATH="<dir>:$PATH" line naming ~/.zshrc or ~/.bashrc for zsh and bash, or today's exact generic hint for anything else. The directory is escaped for the target shell's double quotes.
What was done
Task 1 (tracer, TDD): per-shell hint in new.sh
- RED: added the per-shell and metacharacter cases to TestScriptBehavior. The fish, zsh, bash and both metacharacter cases failed against the old script. The generic, unset and on-PATH cases passed, so the generic text is byte-identical.
- GREEN: added
dq_escapeabovemain. It is a per-character loop over${s:i:1}with acase. It always escapes\,"and$. For shells other than fish it also escapes the backtick and turns!into"'!'". The hint block now does acaseon${SHELL:-}stripped by##*/. The single SC2016 disable directive remains the only one in the file. The header comment notes that SHELL only picks the hint form. - Harness:
SHELL=is placed beforeh.envso a per-case value wins. The newunsetShellmode runsbash -c 'unset SHELL; . "$0" "$@"'. New helpers:expectLacks,hintDir(astrings.NewReplacerwith the same mapping),hint/exportHint/fishHint,expectHintSuffixandmetaGobin. The case floor went from 18 to 32. - TestBootstrapEndToEnd drops the inherited SHELL, pins
SHELL=/bin/bashand also requires(and add it to ~/.bashrc):. - Tracer gate: the verify command re-ran green. A manual paste test confirmed that interactive bash, with history expansion on, and fish both recover the exact directory
/tmp/go bin\x"y$HOME`id`!zfrom the printed lines. zsh is not installed on this host. Its double-quote rules match bash for these characters, and the harness covers its output.
Task 2: docs and gates
- sunrise README: the Overview sentence describes the per-shell hint. A new Features bullet covers the escaping and the literal
$PATH. The Configuration intro notes thatSHELLonly picks the hint form. - docs/setup/installation.md: step 3 describes the per-shell hint. The manual PATH section names
~/.bashrc/~/.zshrcand adds a fishshfence withfish_add_path (go env GOPATH)/bin. - Gates:
go vet ./..., TestDocsTree,summer docs:build --check("no problems found"),check-phase14.3.sh --forbidden("forbidden-surface scan passed") andgo test ./... -short -count=1all passed.scripts/check-phase14.3.shis unchanged and still containsexport PATH="/root/go/bin:$PATH", which matches the bash branch.
Commits
ddf1178: feat(sunrise): print the PATH hint for the user's login shell (all five files; no co-author trailer)
Deviations from Plan
None. The plan was executed as written. The optional gated SUMMERCMS_BOOTSTRAP_CHECK=1 end-to-end run (step 4 of Task 2, not part of acceptance) was not run.
Known Stubs
None.
Self-Check: PASSED
- FOUND: modules/sunrise/new.sh (contains fish_add_path, dq_escape; one shellcheck disable)
- FOUND: modules/sunrise/script_behavior_test.go (contains "SHELL=")
- FOUND: modules/sunrise/sunrise_test.go (contains SHELL=/bin/bash)
- FOUND: modules/sunrise/README.md (contains fish_add_path)
- FOUND: docs/setup/installation.md (contains fish_add_path (go env GOPATH)/bin)
- FOUND: commit
ddf1178