You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(install): report guarded hooks whose files are missing - #335
A guarded hook ([ ! -f FILE ] || CMD) whose file is gone is a silent no-op by design: the guard exists so a missing file never blocks every prompt with exit 2. But that traded a loud block for silence. After an update renames or removes a hook, or an operator's ~/aios moves, the installer reported "Done" with no hint that hooks had stopped firing.
install-settings.py now checks each guarded hook command it sees, including the status line, and prints in both the dry run and --apply:
! missing <event> <path> this hook is being skipped; its file does not exist
/aios:update reads the installer output aloud, so the missing file becomes visible to the operator. The first path inside the guard bracket is used (not the command path after ||), and ~, $HOME, ${HOME} and quotes are resolved. No behaviour changes — the hook is still skipped, now it is reported.
How it was tested
Added a fixture test to tests/install-settings.test.sh: a settings file with a dangling guarded hook and status line produces ! missing for both in the dry run; a present guarded hook produces no such line.
Red-green verified: the baseline script produced no ! missing lines on the same fixture; the patched script produces all three.
CHANGELOG entry added under a new 2026-11-18 heading with an empty hash: line, per CONTRIBUTING.
make test equivalent for the touched area (shell suite: 54/54)
User-facing changes noted under a new CHANGELOG heading
Commits are signed off (git commit -s) — noted; see below
The commit is authored as bfs2021 <101915083+bfs2021@users.noreply.github.com> and pushed from bfs2021:fix/report-missing-guarded-hooks. DCO sign-off can be added on request via an amended commit if the project requires it.
AI-assisted development and review used for this change.
Thank you for this. It's a clean fix: you read the guard's first bracket instead of the command after ||, red-green tested it, and gave a clear CHANGELOG note.
We'd already started the same fix in #336 when this arrived, and that one also covers a few cases this doesn't: hooks the installer is about to repoint (~ move) aren't reported as missing, /aios:update relays the lines on every run rather than only when the installer changes, and paths or event keys with control characters are never printed. So we're closing this in favour of #336 rather than merging two versions of one change. You'll be credited as co-author on #336 and in its CHANGELOG line.
The duplicate is on us: we took the issue in a comment but never set the in-progress label you'd check first. That's fixed in our process now. We hope you'll send the next one.
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
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.
Fixes #334.
What and why
A guarded hook (
[ ! -f FILE ] || CMD) whose file is gone is a silent no-op by design: the guard exists so a missing file never blocks every prompt with exit 2. But that traded a loud block for silence. After an update renames or removes a hook, or an operator's~/aiosmoves, the installer reported "Done" with no hint that hooks had stopped firing.install-settings.pynow checks each guarded hook command it sees, including the status line, and prints in both the dry run and--apply:/aios:updatereads the installer output aloud, so the missing file becomes visible to the operator. The first path inside the guard bracket is used (not the command path after||), and~,$HOME,${HOME}and quotes are resolved. No behaviour changes — the hook is still skipped, now it is reported.How it was tested
Added a fixture test to
tests/install-settings.test.sh: a settings file with a dangling guarded hook and status line produces! missingfor both in the dry run; a present guarded hook produces no such line.Red-green verified: the baseline script produced no
! missinglines on the same fixture; the patched script produces all three.bash tests/install-settings.test.sh: 54 passed, 0 failed.tests/changelog-entry-shape.test.sh18/18,tests/changelog-read-scope.test.sh13/13,tests/ci-failure-explainer.test.sh18/18.CHANGELOG entry added under a new 2026-11-18 heading with an empty
hash:line, per CONTRIBUTING.make testequivalent for the touched area (shell suite: 54/54)User-facing changes noted under a new CHANGELOG heading
Commits are signed off (
git commit -s) — noted; see belowThe commit is authored as
bfs2021 <101915083+bfs2021@users.noreply.github.com>and pushed frombfs2021:fix/report-missing-guarded-hooks. DCO sign-off can be added on request via an amended commit if the project requires it.AI-assisted development and review used for this change.