Repository navigation
Description
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
-
src/draftwright/evaluation/step_analysis.py— 5,896 to 5,651 lines in Extract Double-D STEP evaluation evidence #1982, then 5,308 in Extract turned-step evaluation evidence #2000, 4,753 in Extract pocket evaluation evidence (#1955) #2004, 4,486 in Extract prismatic STEP evidence and split observer registry #2011, 4,293 in Extract groove evidence from STEP evaluator #2014, 3,760 in Extract chamfer and fillet STEP evidence #2016, and 2,717 after the Extract flat and polygonal STEP evidence #2018/Extract hole-family evidence from STEP evaluator #2031 atomic stack. Flat/polygonal and hole-family evidence moved to rank-2 owners; independent review, exact STEP evidence parity, static/focused gates, changed-line coverage, and protected-main CI passed. -
src/draftwright/model/ir.py— 4,305 to 2,922 lines after Extract dimension intent vocabulary from model IR (#1955) #1984, Extract oriented-slot validation from model IR (#1955) #1991, and Extract foundational IR records into focused rank-zero owner #1993. Foundational IR records moved to a focused rank-0 owner; namespace, record identity, live drawing parity, review, coverage, and CI gates passed. -
src/draftwright/annotations/_common.py— 4,466 lines onmainat6ca2c314, 4,087 after the solve-trace recorder moved in Extract annotation solve trace recorder #2013, 3,679 after analytical dimension ink moved in Extract analytical dimension ink helpers #2015, 3,250 after bounded label repair moved in Extract bounded dimension label ink repair #2021, 2,979 after placement geometry moved in Extract shared annotation placement geometry #2022, 3,105 after strip phases in Split shared strip placement into explicit phases #2028, then 2,971 after the postsolve owner moved in Extract strip postsolve owner from shared annotations #2030. Static, focused, exact drawing/lint/trace, independent review, changed-line coverage and CI gates passed. -
src/draftwright/sheet.py— 3,862 to 2,922 lines in Extract Sheet identity and layout-control owners (#1955) #1992 and Extract Sheet view declarations and meet module limit #1996. Feature, layout-control, and view-declaration owners were extracted; public Sheet API, type hints, golden/script parity, review, coverage, and CI gates passed. -
src/draftwright/builder.py— 3,858 to 3,352 lines in Extract finished-drawing build policy from builder #2006, then 2,696 in Extract builder attempts and automatic trials below module size limit #2007. Finished-drawing policy, one-attempt compilation, explicit-scale resolution, assembly preparation, and automatic scale/page trials moved to focused rank-6 owners. Fourteen live drawings, GRM03/04 traces, review, 94% changed-line coverage, and CI passed. The remainingbuild_drawingfunction length belongs to Code health: bring the remaining 33 long functions under 300 lines #1956;build_oncereached 288 lines in Extract Drawing intent, export, and table owners #2009. -
src/draftwright/annotations/holes.py— 3,818 originally, 2,969 after Extract off-axis hole location pass (#1955) #1990. The compiler-approved off-axis location pass moved to a focused rank-4 owner; fresh 14-case live signatures, review, changed-line coverage and CI passed. -
src/draftwright/sheet_emit.py— 3,239 to 2,959 lines after Extract sheet object source helpers (#1955) #1977 (with Split sheet script setup helpers (#1956) #1975). Object-source resolution moved to a focused rank-7 module; parity and CI passed. -
src/draftwright/pmi.py— 3,126 to 2,982 lines in Extract private PMI schema and station proof #1980, rose to 3,051 in Split audit comparison and PMI census into focused stages #1994, then fell to 2,910 in Extract PMI support blockers below module limit (#1955) #2003. PMI support/blocker policy moved to a rank-2 owner; public record identities, exact AP242 reports, review, coverage, and CI passed. -
src/draftwright/annotations/leaders.py— 3,099 lines before Extract greedy feature leader selection phases (#1930) #2027/Extract settled feature-leader fixed ink lowering owner #2036, then 2,758 after the reviewed atomic stack. Fixed-ink lowering moved to a rank-4 owner while shared candidate scoring and ADR 2 placement stayed inleaders.py; exact drawing/STEP lint/trace parity and protected-main CI passed. Code health: extract a placement-candidate type and decompose the >1,000-line functions #1930/Code health: bring the remaining 33 long functions under 300 lines #1956 still own the long leader-placement function.
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
Extract sheet object source helpers (#1955) (#1977)
Extract PMI tables and linear station proof (#1955)
Extract PMI tables and linear station proof (#1955)
Extract Double-D STEP evaluation evidence (#1955)
Cover linear PMI station proof outcomes (#1955)
Extract PMI tables and linear station proof (#1955)
Cover linear PMI station proof outcomes (#1955)
Extract Double-D STEP evaluation evidence (#1955)
Extract dimension intent vocabulary from model IR (#1955)
Extract private PMI schema and station proof (#1980)
Extract dimension intent vocabulary from model IR (#1955)
Extract dimension intent vocabulary from model IR (#1955) (#1984)
Extract Double-D STEP evaluation evidence (#1955)
Extract Double-D STEP evaluation evidence (#1982)
Extract off-axis hole location pass (#1955) (#1990)
9 remaining items
Extract PMI support blockers below module limit (#1955) (#2003)
pzfreo commentedon Sep 28, 2026
#2003 merged as
2ab1ec84after two clean independent P0–P3 reviews and all 17 CI checks. PMI support/blocker helpers moved to rank-2_pmi_support_blockers.py;pmi.pyis 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. Thepmi.pyitem in #1955 is complete; the issue stays open for STEP,_common, and builder modules.Extract pocket evaluation evidence (#1955) (#2004)
Extract builder attempts and automatic trials below module size limit (…
Extract prismatic STEP evaluation evidence (#1955)
Extract prismatic STEP evidence and split observer registry (#2011)
Move solve trace recorder to focused annotation owner (#1955)
Move solve trace recorder to focused annotation owner (#1955) (#2013)
Extract analytical dimension ink from shared annotation solver (#1955)
Extract analytical dimension ink from shared annotation solver (#1955)
Extract analytical dimension ink from shared annotation solver (#1955) (
Extract bounded dimension label ink repair (#1955)
Extract bounded dimension label ink repair (#1955) (#2021)
Extract shared annotation placement geometry (#2022)