Skip to content

Code health: shrink the eight remaining source modules over 3,000 lines #1955

Description

@pzfreo

Part of #1939. Measured on main at 941bbd0c after the first cleanup PRs. #1928 owns drawing.py; #1929 owns annotations/from_model.py. These eight modules originally exceeded the required ~3,000-line exit limit. A fresh main census at 37d25043 finds one oversized module overall: annotations/from_model.py 8,807, owned by #1929. The atomic #2018/#2031 STEP stack brought evaluation/step_analysis.py to 2,717, and the atomic #2027/#2036 leader stack brought annotations/leaders.py to 2,758. Every module in this #1955 worklist is now at most 3,000 lines. annotations/_common.py returned to 2,971 in #2030. drawing.py fell to 1,940 lines in #2012, closing #1928.

Module worklist

Acceptance

  • Every listed source module is at most 3,000 physical lines; verify with a fresh repository census before closing.
  • Each slice preserves successful drawing behavior with live golden corpus and script/CLI parity checks; tests and _LAYERS/architecture docs move with code.
  • No rank-0 import boundary is weakened. ADR text changes, if any become necessary, require maintainer sign-off on exact wording before writing.
  • Keep this worklist checked as slices merge. Code health: extract a placement-candidate type and decompose the >1,000-line functions #1930 and the function-budget follow-on cover long functions, including ones outside these modules.

Activity

  1. 9 remaining items

  2. pzfreo commented on Sep 28, 2026

    @pzfreo
    OwnerAuthor

    #2003 merged as 2ab1ec84 after two clean independent P0–P3 reviews and all 17 CI checks. PMI support/blocker helpers moved to rank-2 _pmi_support_blockers.py; pmi.py is now 2,910 physical lines (90 below the 3,000-line exit limit). Five AP242 report signatures and focused tests matched the baseline; no ADR text or successful drawing behavior changed. Fresh main census: five source modules remain over 3,000 lines, and 29 functions remain over 300 lines. The pmi.py item in #1955 is complete; the issue stays open for STEP, _common, and builder modules.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions