fix: identify hooks by parse time index instead of memory address - #14
Closed
usefulish wants to merge 1 commit into
Closed
fix: identify hooks by parse time index instead of memory address#14usefulish wants to merge 1 commit into
usefulish wants to merge 1 commit into
Conversation
FolderHookId was the hook's memory address, which only works while the hook map is built once and never moved or mutated, and gives clones of the same hook different identities. Assign each hook a unique index during deserialization and use that instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
desbma
added a commit
that referenced
this pull request
Jul 15, 2026
Owner
|
Good catch on the fragility, although it is latent rather than a live bug: ids are only ever computed from references into the hook map, which is built once and never mutated. I addressed it differently in d92fa3a: |
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.
FolderHookIdis the hook's memory address, so identity only works while the hook map is built once and never moved or mutated, and clones of the same hook get different identities. Any future map rebuild (config reload) or restructuring would silently break theallow_concurrentbookkeeping.Assign each hook a unique index during
FolderConfigdeserialization (so no parsing path can forget it) and use that as identity.FolderHookIdgets a test-onlyDebugderive for the assertions.Red-green test:
hook_id_is_stable_and_uniquefails on master (a clone gets a different id than the original), passes with the fix.🤖 Generated with Claude Code