43 lines
1.6 KiB
Markdown
43 lines
1.6 KiB
Markdown
# 08. Deep-modules check
|
|
|
|
meta:
|
|
id: pygienium-08
|
|
feature: pygienium
|
|
priority: P2
|
|
depends_on: [pygienium-06]
|
|
tags: [check]
|
|
|
|
objective:
|
|
|
|
- Implement the "deep modules, not shallow ones" check: detect modules with shallow abstractions (thin pass-throughs, single-call wrappers, unnecessary indirection) and recommend/apply consolidation.
|
|
|
|
deliverables:
|
|
|
|
- `src/checks/deep-modules.ts`: `CheckDefinition` with scan + fix tasks
|
|
- Rubric: a module should provide a meaningful abstraction over its implementation; flag pass-through wrappers, one-line re-export modules, shallow classes with trivial getters, unnecessary adapter layers
|
|
- `/pygienium-deep-modules` runs E2E
|
|
|
|
steps:
|
|
|
|
- Author `buildScanTask`: agent identifies shallow modules from recon candidates, writes findings to `pygienium/checks/deep-modules/findings.md`
|
|
- Author `buildFixTask`: consolidate/inline where safe; flag risky consolidations for human review; write changes.md
|
|
- Register the check
|
|
|
|
tests:
|
|
|
|
- Integration: temp module that wraps a single lib call as a pass-through; run with `--fix`; assert it's flagged/removed and changes.md explains the consolidation
|
|
|
|
acceptance_criteria:
|
|
|
|
- `/pygienium-deep-modules` flags shallow modules in findings.md
|
|
- With `--fix`, safe consolidations are applied; risky ones are listed for review, not auto-applied
|
|
|
|
validation:
|
|
|
|
- Inspect `pygienium/checks/deep-modules/{findings.md,changes.md}`
|
|
|
|
notes:
|
|
|
|
- "Deep modules" = John Ousterhout's A Philosophy of Software Design; encode that definition in the rubric
|
|
- Prefer conservative fixes: never auto-delete a module with external importers without confirmation
|