Repository navigation
Declare module layers as a family; CI writes the layer report - #3184
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W
LAYERS held each layer's identity as a name string, its order as tuple position and "nothing imports it" as a top flag. Layer is now a DeclaredFamily: each layer is a class built on the layers it may import, so an import is legal exactly when the importing layer subclasses its target, a top layer is one nothing is built on, and names come from the classes. The longest prefix claims a unit instead of the first in the tuple. Unclaimed units still take the highest layer they import, by declaration order. The report is byte-identical but for the sentence naming the layer classes. docs/layout/MODULE_LAYERS.md drifted 886 lines within hours of its last regeneration, and nothing reads it. It is deleted; the merge queue's --check step writes the report to its job summary with --report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W
Hook console scripts (agent_comms_hooks.*) rooted the walk, but their files were never parsed, so a module only a hook imports was listed as a deletion candidate: agent_comms.pattern_sources, which agent_comms_hooks/reread.py imports. The script packages now come from the same [project.scripts] table and are read for reachability only, never as layer units. Violations (1,293), layers and unit edges are unchanged; unreached loses pattern_sources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W
…er-family # Conflicts: # .github/workflows/debt-ratchet.yml # tools/module_layers.py
# Conflicts: # .github/workflows/debt-ratchet.yml # tools/module_layers.py
The merge of main brought back `> docs/layout/MODULE_LAYERS.md` in the usage lines; this branch deleted that committed copy because --check --report writes the report to the job summary of the tree it ran on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W
trissim
marked this pull request as ready for review
October 25, 2026 04:19
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
debt-tools at 774f082, every finding: |
trissim
enabled auto-merge
October 25, 2026 04:20
…is no fact Each override assigned a fixed-length tuple, so mypy typed every layer built on another as a conflicting tuple length (debt-tools: grew TypeErrors: tools/module_layers.py +5). A frozenset declares what claim reads, a set of prefixes, and mypy now reports no error in the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W
trissim
added a commit
that referenced
this pull request
Oct 25, 2026
…e base job Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V
trissim
added a commit
that referenced
this pull request
Oct 25, 2026
The probe was declared at module level in tests/test_install_worker_holds.py, so it stayed in RuntimeProbe.__registry__ for every later test in the worker and OutgoingWire read it as an installer probe outside the package. Declare it inside the one test that uses it and pop it from the registry in finally. test_repairs' tree() fixture now writes the pyproject.toml scripts entry Package needs since #3184. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W
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.
Stacked on #3170 (
ratchet/repair); retarget to main once it lands.What was slop.
tools/module_layers.pykept the layer order as hand-written name lists and an index table: a roster restating the layers (MEMB-1), withmay_importdecided by comparing positions in that roster. Anddocs/layout/MODULE_LAYERS.mdwas a committed copy of the tool's output that had drifted 886 lines from the tree it claimed to describe, and nothing read it.What replaces it.
class Layer(DeclaredFamily): each layer is a class built on the layers it may import (Wire ← Registry ← Coordination ← Context ← Turns ← Runtime; UiModel, Cli and Commander on Runtime).may_importisissubclass. Each layer declares its moduleprefixes; the longest claim wins. An unclaimed unit rises to the highest layer it imports.--check --report "$GITHUB_STEP_SUMMARY"), so it always describes the tree it ran on. The committed copy is deleted.agent_comms_hooks, derived from[project.scripts], never named). Before,agent_comms.pattern_sources(imported byagent_comms_hooks/reread.py) was listed as a deletion candidate.Evidence.
pattern_sourcesand nothing else.--check: 813 client imports of 119 units, 0 missing.Merged onto main (after #3170)
--previous/InstallerZip with--base/OutgoingWire; the CI step now runs--check --base "$BASE" --report "$GITHUB_STEP_SUMMARY", both flags kept.wire_basein tests/test_module_layers_clients.py) wrote an empty pyproject.toml.Package.modulesnow reads[project.scripts]and raises on a tree with none, as no real Core revision is; the fixture declaresac = "agent_comms.cli:main". 5 layer tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q8rVa3cPyXzpCKyR8XvM8W