Skip to content

[Bug]: the pinned top-level module budget is already exceeded on main (150 measured against 147) #5685

Description

@Inference1

What is failing on main

tests/architecture/test_top_level_module_budget.py::test_top_level_module_count_stays_at_the_pinned_budget fails on an unmodified main.

Measured on bfe3c4344 (current main tip at the time of writing):

  • git ls-tree --name-only main loopx/ filtered to *.py → 150 top-level modules.
  • tests/architecture/top_level_module_budget.json still pins max_top_level_modules: 147, with baseline_commit: 9eaacfbf2.
  • So the gate that test(architecture): pin the top-level module count before it grows again #5191 landed to stop the top level from growing is red on main by 3 modules, and every PR based on current main inherits that failure.

For context, #5597 — merged about an hour before this was written — measured 149 at its own base and disclosed the same gate as pre-existing red. The drift is not hypothetical, it is happening between PRs.

Which commits raised it

The top-level additions since the 147 baseline, read with git log --diff-filter=A --name-only -- 'loopx/*.py':

commit new top-level module
9eaacfbf2 (the pinned baseline; #5191 measured 147 here)
9cb6a5433 feat: back up complete machine and Goal configuration checkpoints loopx/configuration_backup.py, loopx/chat_configuration_backup_api.py
d7ad25654 feat(chat): add authorized ordinary workspace conversations loopx/chat_project_context.py
b9df6d1d0 (#5587) fix(workspace): isolate edits and preserve complete current evidence loopx/chat_todo_detail.py

None of those is wrong on its own terms; the count is what RFC monorepo-distribution-split-v0 Section 9 asked to keep visible. This issue exists so the number is decided on purpose rather than inherited as a red test.

What this is not asking for

  • Not an automatic raise of the pin. test(architecture): pin the top-level module count before it grows again #5191's own reasoning is that the budget is the thing that makes growth visible; 147 → 150 without a decision is exactly the drift the gate exists to catch, and the RFC's Appendix A already recorded the same surface moving 143 → 148 while the proposal was being reviewed.
  • Not a claim that these modules belong in subpackages. chat_* → loopx/chat/ is milestone M1 and *_goal_mode → loopx/hosts/ is M2 of that RFC, and both are gated on decisions D1–D4 which the RFC says are not authorised by merging M0.

Options for the owner, with the cost of each

  1. Move M1/M2 forward (the RFC's own remedy): the number goes down and the gate keeps its meaning. This is the only option that reduces the count.
  2. Re-pin to the measured number in a maintainer-owned commit, with the note updated to the commit where the re-pin happened. Cheap, honest, and it costs the "a third spelling of growth is still a regression" signal described in loopx/semantics/vocabulary_v0.json → inventory_ratchets.meaning.
  3. Leave it red and treat the failing id as expected noise. This is the current de facto state, and its cost is that every contributor must diff failure sets against a clean baseline to prove their own PR is neutral — test(architecture): pin the top-level module count before it grows again #5191, refactor(control-plane): decide the stored digest shape in one owner #5252, refactor(lark): decide identifier shapes in one owner #5358 and refactor(lark): decide the sink visibility pair in one owner #5597 each paid that cost in writing.

What I have verified locally

  • The gate is red on an unmodified worktree at bfe3c4344 — same interpreter (uv venv + uv pip install -e ".[test]"), Node pinned to the repository's qualified 22 line, npm ci --ignore-scripts run once.
  • tests/architecture plus tests/canary on that unmodified tree: 24 failed / 1378 passed, of which 22 are tests/architecture/test_contributor_task_board.py (the contributor-task-board anchor rules), 1 is this budget gate, and 1 is tests/canary/test_maintainability_ratchet.py::test_current_repository_debt_is_reviewed_without_line_count_pins. refactor(lark): decide the sink visibility pair in one owner #5597 disclosed three pre-existing reds including this budget gate and the ratchet; the task-board file accounts for the rest.
  • refactor(control-plane): decide the agent-lane progress scope in one owner #5684 (refactor(control-plane): decide the agent-lane progress scope in one owner) deliberately places its new owner inside loopx/control_plane/ rather than at loopx/*.py, so it cannot add to this count.

Refs #5072 (the distribution-split programme this gate belongs to) and #5191 (the PR that landed the pin). No milestone claimed or closed here.

Activity

  1. mikamikasuki commented on Oct 6, 2026

    @mikamikasuki
    Contributor

    Update from the latest canonical main: at 42e55a8, the tracked loopx/*.py count is back at 147. The focused budget test passes (6 passed) on a documentation-only head based directly on that main SHA; the changed files do not touch the module tree or budget test. The 150 count at bfe3c43 is no longer reproducible on current main. I have not changed the budget pin or opened a duplicate PR; please close this report if this current-main readback resolves it for you.

  2. mikamikasuki commented on Oct 6, 2026

    @mikamikasuki
    Contributor

    Rechecked canonical main at a00509b: the top-level loopx/*.py count is 147, matching the pinned budget. The reported 150-module failure is no longer reproducible on current main, so I’m closing this report without a code change.

  3. mikamikasuki commented on Oct 6, 2026

    @mikamikasuki
    Contributor

    Correction: I can confirm the failure is absent on current main, but this account does not have permission to close the report. It remains open for maintainer closeout.

  4. mikamikasuki commented on Oct 7, 2026

    @mikamikasuki
    Contributor

    Current-main recheck: the same budget gate has regressed after the earlier 147-module readback. On unmodified main at da45cfe771e96d20b9c5129a021a8c971ee03324, tests/architecture/test_top_level_module_budget.py reports 1 failed, 5 passed: loopx/ contains 148 top-level Python modules while the fixture still pins 147. The additional module is loopx/chat_explore_results.py, added by merged PR #5743.

    The architecture RFC's M1 moves loopx/chat_* into loopx/chat/ with import compatibility; its open D3 decision assigns the compatibility-shim lifetime to the release owner before M1. Could the release owner or maintainers decide the D3 lifetime and whether to authorize this M1 slice? I can then prepare the migration and regression validation against the agreed compatibility boundary. I have not changed the budget pin, which would mask the growth this gate is intended to surface.

  5. mikamikasuki commented on Oct 7, 2026

    @mikamikasuki
    Contributor

    Rechecked on a clean worktree at exact upstream main 2244b96f1e2e5c90bef43ae4c140c0994bfcc07a: the focused budget gate is 1 failed, 5 passed, with 148 top-level Python modules against the pinned 147. Since baseline 9eaacfbf2ff93d5386cee82ddf0847d9c739e78a, the root-level delta is chat_explore_results.py and chat_todo_detail.py added, with chat_configuration_api.py moved to presentation/configuration_api.py (net +1). The failure detail's workflow_skill_install.py is a lexical diagnostic artifact; that file already exists at the pinned baseline. The architecture RFC still makes the release owner's D3 shim lifetime choice a precondition for M1. Please confirm whether to authorize that migration and select the one- or two-minor-release compatibility window, or identify a different accepted correction. I have not changed the pin or started the migration.

  6. mikamikasuki commented on Oct 8, 2026

    @mikamikasuki
    Contributor

    Latest canonical-main readback: at a1890a37f4f759bc2e39823074bbe78f78e49fdb, the tracked loopx/*.py count is 147, matching the pinned budget. tests/architecture/test_top_level_module_budget.py passes (6 passed) on a worktree based on this exact SHA with only nested Effect-runtime changes; those changes do not affect the top-level module set or this gate. The reported over-budget state is not reproducible on this current main revision. No pin change or patch is warranted from this measurement; maintainer closeout remains appropriate if the report is considered resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions