Repository navigation
docs: architecture area files are read deliberately — drop the unwired PreToolUse hook (abilityai/trinity#2642) - #2644
Merged
Conversation
…ed PreToolUse hook, state the rule in the core (#2642) The #2306 split made `scripts/docs/architecture_context_hook.py` the mechanism that loads an area file into a session, and the core said "correct loading does not depend on remembering to look". The hook was wired nowhere — no settings.json in the dev-tooling submodule, none on any core-team machine or remote agent — so loading depended entirely on remembering, and nothing documented that as the rule. Ambient injection is also the wrong shape: a hook fires on the first edit, after the reasoning that needed the area file has already happened. - docs/memory/architecture.md: the Architecture Map states the deliberate-read rule (read the named area file before changing a path in "Owns", as an explicit step); the hook sentence and the "Hook setup" subsection are gone. 181 → 160 lines, under the 500 budget. - CLAUDE.md rule 7 no longer promises a PreToolUse hook. - scripts/docs/architecture_context_hook.py deleted. - scripts/docs/architecture_map.py: the one reader of the map table — parse_map + owner_for (most-specific-wins) — so the map-lint tests keep running and the companion dev-tooling skills (trinity-dev#23) can resolve path → area file without a second copy of the map. - tests/unit/test_2306_architecture_split.py: map-lint half kept (bijection, owned paths, cited consequence, parse agrees with the table, no hardcoded map); hook subprocess/session-state tests dropped; new guards that the core states the rule and no surface promises the retired hook. Fixes #2642 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LJ3g5tgWJiRBkqhp2vNK15
vybe
approved these changes
Sep 9, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
merge-train (2026-09-09): validated at lane B — /validate-pr + /review clean, test_2306_architecture_split (18) and test_2008 (7) pass locally, CI pytest matrix green. Below the train floor, so merged individually.
6 tasks done
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.
Summary
PreToolUsehook that loads the owning area file on first edit. It was wired nowhere (nosettings.jsonin the dev-tooling submodule, none on any core-team machine or remote agent), and a hook fires after the reasoning that needed the file anyway. Decision from docs: architecture area files are read deliberately — drop the unwired PreToolUse hook, state the rule in the core #2642: loading is deliberate, not ambient.CLAUDE.mdrule 7 no longer says a hook will point you at the area file.scripts/docs/architecture_context_hook.pyis deleted. Its map parser moves toscripts/docs/architecture_map.py(parse_map+ most-specific-winsowner_for, plus a tiny CLI) so the map-lint tests keep running and the companion dev-tooling skills (abilityai/trinity-dev#23) can resolve path → area without a second copy of the map.Changes
docs/memory/architecture.md— Architecture Map intro rewritten; "Hook setup" removedCLAUDE.md— rule 7 wordingscripts/docs/architecture_context_hook.py— deletedscripts/docs/architecture_map.py— new: the one reader of the map tabletests/unit/test_2306_architecture_split.py— map-lint half kept (bijection, owned paths exist, cited consequence, parse agrees with the published table, no hardcoded map in the module, most-specific owner resolution); hook subprocess / session-state tests dropped; new guards that the core states the deliberate-read rule and that no surface (core,CLAUDE.md, the deleted script) promises the retired hookTest Plan
pytest tests/unit/test_2306_architecture_split.py— 18 passedpytest tests/unit/test_2008_dead_credentials_update.py(also reads the core) — passespython3 scripts/docs/architecture_map.py src/backend/services/cleanup_service.py→reliability.md(not thebackend.mdcatalog)architecture_context_hook/Hook setupoutsidedocs/archiveDEVELOPMENT_WORKFLOW.mdMemory Files tree + tiered-docs table live there)Fixes #2642
🤖 Generated with Claude Code
https://claude.ai/code/session_01LJ3g5tgWJiRBkqhp2vNK15