Skip to content

fix(install-settings): say when a guarded hook is being skipped - #336

Open
chuycepeda wants to merge 1 commit into
mainfrom
fix/installer-missing-hooks
Open

chuycepeda wants to merge 1 commit into
mainfrom
fix/installer-missing-hooks

Conversation

@chuycepeda

Copy link
Copy Markdown
Member

Closes #334. Thanks to its reporter for a precise repro with a control.

What

Every AIOS hook is written as [ ! -f FILE ] || CMD, so a missing file is skipped instead of blocking every prompt. The price was silence: nothing said a hook stopped running.

  • install-settings.py now prints ! missing <event> <path> for each guarded hook or status line whose file is gone, in the dry run and --apply.
    • Paths are read as the shell reads them: $HOME and ${HOME} expand unquoted and inside double quotes, not inside single quotes.
    • ~ expands only when unquoted. A quoted ~ is reported with why the shell skips it.
    • Globs, relative paths, other variables and Git Bash drive paths are not judged.
    • Hooks the installer is about to repoint (~ move) are not reported.
  • ! link when ~/aios does not lead to the framework while some hook goes through it. The line covers a missing link and a dangling one, with the fix: move it aside if needed, then ln -sn. When ~/aios leads to another copy of AIOS, a note says so instead.
  • /aios:update Step 6.85 runs the dry run on every update and relays the ! missing lines. A hook goes missing on the runs that rename or remove one, not only when the installer changes. The step treats the path as data, checks the file is really gone before offering to remove the hook, and changes nothing without a yes.
  • Event keys and paths that contain control characters are never printed, so settings content cannot forge an installer line that the update step would relay.
  • Unusual settings shapes (an event that is not a list, entries that are not objects) no longer crash the installer.

Review and tests

  • Two subagent reviewers (correctness, security), then one focused re-review of the fixes. Every finding is fixed: none was a security hole; the rest were false positives and negatives, a forged-line vector, a link line the update could never reach, and two tests that could not fail.
  • tests/install-settings.test.sh: 69/69. The new cases fail on the old code: the missing hook, the missing status line, the link line, the other-copy note, Step 6.85, and the absolute-root case.
  • Local CI: every step that can run on macOS passes; the Windows, bash 3.2 and summary lanes run on GitHub.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ri8aqK7pwGNSj7zCjcvetU

Every AIOS hook is guarded so a missing file is skipped instead of
blocking every prompt, and nothing said when that happened. The
installer now prints `! missing <event> <path>` for each guarded hook
or status line whose file is gone, and `! link` when ~/aios does not
lead to the framework while some hook goes through it (a note when it
leads to another copy). /aios:update relays the missing lines on every
run (Step 6.85). Paths and event keys with control characters never
print, so settings content cannot forge an installer line.

Closes #334

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ri8aqK7pwGNSj7zCjcvetU
@chuycepeda chuycepeda added this to the v0.8.19 milestone Nov 18, 2026
@chuycepeda chuycepeda modified the milestones: v0.8.19, v0.8.20 Nov 18, 2026
@chuycepeda

Copy link
Copy Markdown
Member Author

Held for v0.8.20 (end of this week), merged together with #330: nothing is broken in 0.8.19 because every old hook path still forwards, so the risk this guards arrives only when #330 removes those paths. Before merge: move the CHANGELOG line into the v0.8.20 entry and credit the author of #335 (closed as a duplicate of this) as co-author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install-settings.py: report a guarded hook whose file is missing

1 participant