Skip to content

docs(spec): plan #1 Source aliases only from the home directory - #19

Merged
dan-petty merged 2 commits into
mainfrom
fix/1-source-aliases-only-from-aliases-zsh
Nov 27, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/1-source-aliases-only-from-aliases-zsh

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

install.sh creates no ~/.aliases.zsh link, so zsh/.zshrc falls back to a path built from $0. During interactive startup $0 is the shell name, so that fallback points at the directory where the shell starts: the aliases are missing after an install, and any directory that holds an aliases.zsh runs its code in the user's shell. The plan makes the installer link the alias file to ~/.aliases.zsh, and makes the startup file source that file only. The check installs into a fresh HOME under one temporary folder and shows that alias ll prints. Then it removes the alias link and starts a zsh in a directory that holds a marker aliases.zsh: the marker stays out. The spec delta shell-aliases states both rules. Each scenario names a live zsh check and a git grep check, and each check fails on the base. Issue #1.

Plans #1

Change: openspec/changes/1-source-aliases-only-from-aliases-zsh/

@devops-cli-service devops-cli-service Bot added type/docs Documentation additions, guides, manuals, or README updates scope/spec OpenSpec changes and specs, such as a plan pull request labels Nov 27, 2026
@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 27, 2026 05:08
- Add the spec delta of the new capability shell-aliases and drop
  skip_specs: the change alters which aliases a shell defines and
  which files it sources.
- Run each hand check with HOME, ZDOTDIR, XDG_CONFIG_HOME and
  GIT_CONFIG_GLOBAL under one temporary directory. With only HOME
  changed, install.sh wrote a temporary path into the tracked
  git/.gitconfig.
- Widen the static check to any $0 or PWD path, correct the order of
  the hand check in the design, the rejected repair with %x, and the
  exception of the Why.
@dan-petty

Copy link
Copy Markdown
Owner

Plan evaluation: fixed in 457698f

I checked the plan against origin/main (3f88543), issue #1 and its comments. I ran each check in a temporary HOME with zsh 5.9.2 and git 2.55. The premise is correct: with the base files, zsh -i -c 'alias ll' prints nothing and exits 1 after ./install.sh. A zsh that starts in a directory with a marker aliases.zsh prints the marker. With the two planned edits, alias ll prints the alias and the marker stays out.

Defects and fixes

  1. skip_specs is not allowed. openspec/config.yaml lets a change skip specs only when it alters no behavior that a consumer observes. This change alters which aliases a shell defines and which files it sources. The reason in the plan ("no behavior test can cover a shell session") is false: the check above runs offline in a temporary HOME. Fix: I removed skip_specs and added specs/shell-aliases/spec.md with two requirements. Each scenario names the live zsh check and a git grep check. Both git grep checks fail on the base and pass after the change.
  2. The hand checks write outside the temporary home. install.sh:38 links ~/.gitconfig to the tracked git/.gitconfig, and install.sh:40 runs git config --global. A run of ./install.sh with only HOME changed added excludesfile = <temporary home>/.gitignore_global to the tracked git/.gitconfig. An implement run could commit that line. Fix: each hand check now sets HOME, ZDOTDIR, XDG_CONFIG_HOME and GIT_CONFIG_GLOBAL under one directory $T, and ends with git status --porcelain -- git/. I tested this form: the tracked file stays the same. Issue fix(install): Stop linking ~/.gitconfig to the tracked file #2 owns the cause.
  3. Task 1.1 used an unclear HOME. Its steps test -L "${HOME}/.aliases.zsh" and zsh -i -c 'alias ll' did not say which HOME to use, so they could read the real home. Fix: each command now names $T.
  4. design.md gave a false order for the check. It said that alias ll still prints after the link is removed. After the change, no alias loads when the link is missing. Fix: the design now gives the real order (alias check, then link removal, then marker check).
  5. design.md gave false evidence against the %x repair. ${${(%):-%x}:A:h} in ~/.zshrc follows the link to the checkout's zsh/ directory. It does not give the home directory. Fix: the rejection now gives the real reason (a second source path that depends on how .zshrc was installed).
  6. The static check was narrow. ! git grep -F 0:A:h passes if a later edit uses ${0:h} or $PWD. The check of the issue, grep -n '\$0', cannot fail on the base. Fix: ! git grep -n -E '\$\{?(0|PWD)' zsh/.zshrc finds lines 37 and 38 on the base and nothing after the change.
  7. The Why said the aliases never load. They load in a shell that starts in the checkout's zsh/ directory (the issue says this, and I saw it). Fix: the Why now states this exception.

Checks

  • Local plan check on 457698f: no problem.
  • openspec validate 1-source-aliases-only-from-aliases-zsh --strict: valid.
  • pre-commit run on the changed files: passed. shellcheck install.sh and zsh -n zsh/.zshrc pass on the base.
  • Semantic PR title passed on 457698f.

Notes

@dan-petty

Copy link
Copy Markdown
Owner

Independent review of head 457698f: no blocker.

  • The hand checks ran with zsh 5.9.2 in a temporary home. They fail on the base and pass after the planned edits. The tracked git/.gitconfig stays unchanged.
  • The plan check and strict OpenSpec validation pass.
  • The body now says that the plan, not this commit, changes the installer, and that the marker check removes the alias link first.
  • The scenarios keep their git grep checks. The stage plan reader accepts no zsh command as a scenario proof (fix(roadmap): accept a shell command as a scenario proof devops-cli#7401).

@dan-petty
dan-petty merged commit 3f318e3 into main Nov 27, 2026
6 checks passed
@dan-petty
dan-petty deleted the fix/1-source-aliases-only-from-aliases-zsh branch November 27, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/spec OpenSpec changes and specs, such as a plan pull request type/docs Documentation additions, guides, manuals, or README updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant