Skip to content

refactor: quality tail (complexity batch 8 + function/file length splits) - #737

Merged
w1ne merged 32 commits into
developfrom
refactor/complexity-tail-8
Sep 19, 2026
Merged

w1ne merged 32 commits into
developfrom
refactor/complexity-tail-8

Conversation

@w1ne

@w1ne w1ne commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Combined quality-ratchet tail: complexity batch 8, the two worker/sheet-metal/beam function-length splits, and the remaining file-length splits, all pure refactors with no behaviour change intended.

Complexity batch 8 (15 functions, all under 20)
normaliseAutoAnnotate 25 (in the new drawingAuto/ layout), runAnimate 25, paramsHandler 24, solveAnalytical 24, tryVec3 24, traceFromImage 24 (+163-line finding), fitPlane 24, whyDidThisFailTool 24, inspectTool 24, addVariableSweep 24, validateConnectorManifest 23, checkOrphanParts 23, validateAssemblyWithMates 23, suggestLimitFix 23, buildEdgeFeatureRef 23.

Function-length splits

  • worker.ts: the 231-line arrow and its 226-line async callback split by message kind; worker protocol byte-identical (new characterisation suite mocks the OCCT module).
  • lowerSheetMetalBend 161 lines; runBeamMode 161 lines + complexity 21.

File-length splits

  • proxy.ts 1024 and planPhases.ts 942 into focused sibling modules; async producers extracted with explicit receiver params so Shape.prototype own-property layout is untouched (MCP drift sentinel green).
  • sketch.ts 883 → sketchReflect/sketchTangency; occtBackend.ts 844 → backendInit/backendMesh; public names re-exported so all import paths keep working.
  • New emit-site modules added to emittedCodesAreCatalogued.test.ts.

Baseline 56 → 31 findings: complexity 45 → 29, file 5 → 1, function 6 → 1. The only remaining entries for a single file are src/modeling/api.ts (createApi 654 lines + 973-line file), which is slice 8 territory. Nothing added, cycle baseline unchanged. Verification for the combined tree: npm run typecheck, npx eslint on all touched files, npm run test:ratchet, npm run qc:lint, npm run qc:build, plus each agent's targeted suites (worker protocol, proxy/reconstruct, sketch/occtBackend, sheet metal, beam mode, and the batch-8 module tests). CI runs the full suite.

w1ne added 30 commits September 19, 2026 20:00
…tail-8

# Conflicts:
#	scripts/lib/qualityBaseline.json
…il-8

# Conflicts:
#	scripts/lib/qualityBaseline.json
@w1ne
w1ne merged commit 7e7440c into develop Sep 19, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant