Skip to content

feat(devtools): file-size budgets per package and module #435

Closed

Description

@Sinity

Parent

Part of #401. Pattern application from #429. Complements #419 (oversized contract suites).

Problem

Polylogue has several modules and tests that grew past sustainable size: pipeline_probe.py (1,468 LOC), proof/runners.py (1,339 LOC), several test files at 2,000+ LOC. #419 splits the worst offenders, but nothing prevents the next file from accreting in the same shape.

A YAML budget + lint catches accretion on the first commit that crosses a ceiling.

Target

# docs/plans/file-size-budgets.yaml
defaults:
  source_loc_ceiling: 800
  test_loc_ceiling: 1200

per_package:
  devtools/:
    source_loc_ceiling: 1000   # devtools modules tend to be larger
  tests/unit/:
    test_loc_ceiling: 1200

exceptions:
  - path: devtools/pipeline_probe.py
    ceiling: 1500
    until: "#419"
    reason: "tracked split into pipeline-probe sub-modules"

  - path: polylogue/proof/runners.py
    ceiling: 1500
    until: "#421"
    reason: "tracked split into per-evidence-family runners"

  - path: tests/unit/sources/test_source_laws.py
    ceiling: 2500
    until: "#403"
    reason: "tracked split per #403"

devtools verify-file-budgets walks every file, looks up the ceiling (specific exception → per-package default → global default), fails on any file over budget.

Exceptions name a sunset issue. When the issue closes, the exception fails the lint until it is removed.

Why this matters

Acceptance criteria

  • docs/plans/file-size-budgets.yaml exists with defaults + the current realistic exceptions.
  • devtools/verify_file_budgets.py exists, runs in under 1s, reports overages with file:line cite of the file (not line of the lint).
  • Wired into devtools verify --quick.
  • Exceptions are short-circuited when their until issue closes; lint fails on stale exceptions.

Related

Activity

  1. added
    type:feat
    phase:architecture
    area:devtools
    on Apr 26, 2026
  2. added 8 commits that reference this issue on Apr 26, 2026
    9c264d8
    2062796
    997f4d8
    32e174d
    5bb0c25
    4aaa5ce
    8b52f6a
    b15acbf
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

    area:devtoolsphase:architecturetype:feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions