monad-developers / monad-developers/ultrafuzz

Refactor runtime artifact-gate validation below complexity budgets

Open
#998 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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.ts falls below 6,000 measured lines in the first milestone.
  • Existing artifact-gate tests and release validation remain green.
  • .quality/metric-baseline.json is pruned for every resolved hotspot.

Follow-up to #997.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.