Skip to content

docs: architecture area files are read deliberately — drop the unwired PreToolUse hook (abilityai/trinity#2642) - #2644

Merged
vybe merged 1 commit into
devfrom
feature/2642-deliberate-area-reads
Sep 9, 2026
Merged

vybe merged 1 commit into
devfrom
feature/2642-deliberate-area-reads

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Summary

  • The docs: split architecture.md into a lean always-loaded core + per-area reference files #2306 split promised a PreToolUse hook that loads the owning area file on first edit. It was wired nowhere (no settings.json in 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.
  • The core's Architecture Map now states the rule (read the named area file before changing a path in "Owns", as an explicit step); the hook sentence and the whole "Hook setup" subsection are removed. Core goes 181 → 160 lines, under the 500 budget.
  • CLAUDE.md rule 7 no longer says a hook will point you at the area file.
  • scripts/docs/architecture_context_hook.py is deleted. Its map parser moves to scripts/docs/architecture_map.py (parse_map + most-specific-wins owner_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" removed
  • CLAUDE.md — rule 7 wording
  • scripts/docs/architecture_context_hook.py — deleted
  • scripts/docs/architecture_map.py — new: the one reader of the map table
  • tests/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 hook

Test Plan

  • pytest tests/unit/test_2306_architecture_split.py — 18 passed
  • pytest tests/unit/test_2008_dead_credentials_update.py (also reads the core) — passes
  • python3 scripts/docs/architecture_map.py src/backend/services/cleanup_service.py → reliability.md (not the backend.md catalog)
  • No remaining references to architecture_context_hook / Hook setup outside docs/archive
  • Companion skill-side reconciliation tracked in abilityai/trinity-dev#23 (DEVELOPMENT_WORKFLOW.md Memory Files tree + tiered-docs table live there)

Fixes #2642

🤖 Generated with Claude Code

https://claude.ai/code/session_01LJ3g5tgWJiRBkqhp2vNK15

…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 vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants