Optional: hooks-deprecation only scans hand-written .amplifier config - #413
Open
Michael J. Jabbour (michaeljabbour) wants to merge 1 commit into
Open
Michael J. Jabbour (michaeljabbour) wants to merge 1 commit into
Michael J. Jabbour (michaeljabbour) wants to merge 1 commit into
Conversation
…ence find_source_files walked every *.yaml under ~/.amplifier, including tool-managed state (module cache, session storage, bundle data stores). On a heavily used machine that took ~6-7 s per session start, blocking the event loop, and matched bundle names that appear only as data, producing false evidence. Scan only top-level .amplifier/*.yaml and .amplifier/bundles/** (depth 4, skipping .git and cache). De-duplicate by real path (os.path.realpath, which does not raise on symlink loops before Python 3.13). Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.
Hi Brian,
An optional suggestion. Take it or leave it, and feel free to close it if it isn't the direction you want.
What I noticed
~/.amplifier.hooks-redactionin its notes, so the check decided I was still using it and logged a warning in every session (468 of 468 over two days).What this change does
.amplifier/, and the hand-written bundles under.amplifier/bundles/(up to 4 folders deep, skipping.gitandcache).find_source_fileschanged. When to warn, how serious it is, and the message itself all stay the same.What I saw on my machine (macOS, Python 3.12)
Trade-offs worth knowing
.amplifier/profiles/folder or a bundle more than 4 folders deep, would no longer count as evidence. Since feat(hooks-deprecation): multi-tombstone + on_session_ready firing + observability event #277, a retired bundle that is actually loaded still triggers the warning on its own, so this only affects the backup file check..amplifier/bundlesfolder is now read.bundles/can still flag itself..ymlfiles andbundle.mdfiles still aren't read.hooks-redaction) retires on 2026-10-01. After that, this mostly matters for future retirements.Tests
ci.ymlrunspytest tests/), so here is the local command:PYTHONPATH=modules/hooks-deprecation python -m pytest -q modules/hooks-deprecation/testsmain, a few of those tests read the real home folder, so the suite took 42 seconds on my machine. With this change it takes 0.1 seconds.Two open questions for you
settings*.yaml?session:startnever reached the model in my sessions. That might deserve its own issue.Thanks,
Michael
🤖 Generated with Claude Code