monad-developers / monad-developers/ultrafuzz
Refactor runtime artifact-gate validation below complexity budgets
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 85
- Forks
- 18
- Avg merge
- 11h 10m
- Merged PRs (30d)
- 194
Description
Context
The ratcheted quality gates introduced by #997 measure packages/runtime/src/artifact-gates.ts at 8,934 nonblank/noncomment lines (target: 500). Its largest hotspots include:
verifyCurrentCampaignTimeoutEvidence: cyclomatic 122 and cognitive 116 (target: 15)verifyCoverageProductionInventory: cyclomatic 83 and cognitive 122 (target: 15)verifyFinalReportImplementationCoverage: cognitive 93 (target: 15)
The baseline prevents further growth, but the current structure is difficult to review and test safely.
Proposed work
- Extract cohesive validators by artifact/evidence domain behind small typed interfaces.
- Preserve fail-closed behavior and diagnostic wording with characterization tests.
- Avoid a file swarm or generic helper layer that merely moves branches without reducing complexity.
- Lower the committed metric baseline in each refactoring PR.
Acceptance criteria
- No extracted production function exceeds cyclomatic or cognitive complexity 30 as an intermediate ceiling.
-
artifact-gates.tsfalls below 6,000 measured lines in the first milestone. - Existing artifact-gate tests and release validation remain green.
-
.quality/metric-baseline.jsonis pruned for every resolved hotspot.
Follow-up to #997.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/runtime/src/artifact-gates.ts and inspect verifyCurrentCampaignTimeoutEvidence, verifyCoverageProductionInventory, and verifyFinalReportImplementationCoverage. Read the existing artifact-gate tests, release validation, and .quality/metric-baseline.json before choosing cohesive validator boundaries. Done means preserving fail-closed behavior and diagnostic wording, keeping extracted functions below the stated ceiling, reducing the file below 6,000 measured lines, and pruning resolved baseline entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100