Skip to content

feat(codebase-readiness, agent-ready): score and install regression-aware quality gates - #44

Merged
dgalarza merged 2 commits into
mainfrom
feature/agent-quality-ratchets
Aug 27, 2026
Merged

feat(codebase-readiness, agent-ready): score and install regression-aware quality gates#44
dgalarza merged 2 commits into
mainfrom
feature/agent-quality-ratchets

Conversation

@dgalarza

@dgalarza dgalarza commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

Extends the two existing skills so that regression-aware quality gates are scored by codebase-readiness and installed by agent-ready. No new plugin. (The earlier quality-ratchet plugin on this branch has been removed; nothing from it was kept.)

A regression-aware gate: the project's native complexity / duplication / dead-code tools, a baseline that lets legacy debt stay, PR CI that blocks new or worsened debt relative to the merge-base, the same commands locally and in CI, a human-reviewed baseline, and tests of the gate itself.

codebase-readiness → 1.8.0

  • references/quality-gates.md (new, shared): defines the gate, a single Gate Maturity Level (L0 none → L1 report-only → L2 threshold → L3 regression-aware blocking → L4 governed) determined once in Phase 1 and recorded in the snapshot, native tooling per language, anti-patterns, and a credit-ownership table so the four dimensions never double-count:
    • Code Clarity — which structural properties are covered (complexity, duplication, reliable dead-code), more credit when each is blocked at L3+
    • Consistency — lint-debt treatment (pruned/shrinking todo or baseline vs growing baseline / inline suppressions)
    • Feedback Loops — actionability, reproducibility, gate tests (PR annotations / changed-files scoping, local == CI command, self-test)
    • Change Safety — blocking semantics and baseline governance (L3 blocking, reasons + review + pruning + CODEOWNERS)
  • Top-band credit in every dimension requires CI that blocks new/worsened debt; report-only tooling is explicitly capped.
  • recon.sh gains a === QUALITY GATES === section (tooling, baseline files with grow/shrink history, soft-fail and merge-base markers in CI, local commands, gate tests, CODEOWNERS).
  • Four dimension guides updated (examine bullets, evidence commands, band notes, modifiers, output lines); SKILL.md wires the shared reference into the three relevant agent prompts and adds the snapshot field; report template gains a Gate Maturity section; README dimension table updated.

agent-ready → 1.5.0

  • New quality-gates mode (SKILL.md), integrated into scaffold (Step 8) and audit (Quality Gate section: governed / ungoverned / report-only / absent, plus auto-fix offers), with the check command and three directives added to the AGENTS.md template's Definition of Done / conventions.
  • references/quality-gates-pattern.md: the cross-language contract (report / check / baseline), two routes — Option A native baseline/diff modes (golangci-lint new-from-merge-base, detekt --baseline, PHPStan baseline + reportUnmatchedIgnoredErrors, RuboCop todo regenerated) and Option B a stdlib engine — with adapter recipes for TS/JS, Ruby, Python, Go, JVM, Rust, PHP, the baseline review protocol, CI shape, and debt-fixture snippets.
  • assets/quality-gate.py: fingerprint baseline engine (identity ignores line numbers and numeric values; first integer in a message is tracked as a metric so a higher complexity value counts as worsened); merge-base-aware --changed-only and changed-file attribution; GitHub annotations; tool failure ≠ pass.
  • Baseline governance: baseline requires --reason, prints a review summary (by rule / top files), supports --dry-run, is refused under CI, and writes the baseline unreviewedcheck fails until a human runs --approve --reviewed-by NAME. Stale entries fail check until baseline --prune removes them (prune only tightens, so agents may run it). CODEOWNERS on the baseline file is required by the mode.
  • assets/quality-gate-ci-template.yml (fetch-depth 0, base fetch, no continue-on-error, runs the self-test), assets/quality-gates-guide-template.md (docs/guides/quality-gates.md), assets/quality-gate-test-template.sh (proves clean tree passes / synthetic debt fails / stale entry pruned, on a temp copy of the baseline).
  • tests/test_quality_gate.py: 18 unit tests for the engine — legacy passes after review, line moves don't create new findings, new / worsened-metric / worsened-count fail, stale → prune → pass, prune tightens metrics and the ratchet holds, --reason required, refused in CI, unreviewed fails, extend resets review, dry-run writes nothing, --changed-only scoping via merge-base, tool failure is an error, jsonl format. Wired into CI as a test-templates job.

Validation

  • quick_validate.py passes for both skills; all plugin.json + marketplace.json parse; both workflow YAMLs parse
  • python3 -W error -m unittest discover -s plugins/agent-ready/tests → 18/18
  • recon.sh syntax-checked and run (new section produces output on this repo)
  • Test template exercised end-to-end against the engine in a scratch git repo with a fake analyzer → 5/5 assertions
  • Versions bumped in both plugin.json files and marketplace.json

Not done

  • Do not merge; no release tag cut

@dgalarza dgalarza changed the title feat(quality-ratchet): add quality ratchet plugin feat(codebase-readiness, agent-ready): score and install regression-aware quality gates Aug 27, 2026
@dgalarza
dgalarza force-pushed the feature/agent-quality-ratchets branch 2 times, most recently from 0dd0af7 to e128bf9 Compare August 27, 2026 11:41
…ates

Score whether a codebase blocks new or worsened structural debt, not just
whether tooling exists.

- New shared reference references/quality-gates.md: what a regression-aware
  gate is (complexity, duplication, reliable dead-code checks, baseline
  treatment of legacy debt, blocking merge-base-aware PR CI, reproducible
  local commands, tests of the gate), a single Gate Maturity Level (L0-L4),
  native tooling per language, and a credit-ownership table so Code Clarity
  (structural coverage), Consistency (lint-debt treatment), Feedback Loops
  (actionability, reproducibility, gate tests), and Change Safety (blocking
  semantics, baseline governance) each score one distinct slice. Top-band
  credit everywhere requires CI that blocks; report-only tooling is capped.
- recon.sh: QUALITY GATES section (tooling, baseline files with grow/shrink
  history, soft-fail and merge-base markers in CI, local commands, gate
  tests, CODEOWNERS) ending in a heuristic 'Suggested Gate Maturity Level'
  line; detect flat ESLint/Biome configs; exclude build output from counts
- SKILL.md: the Quality gates line is copied from recon into the snapshot
  and required before agents launch; shared reference wired into the Test &
  CI, Code Quality, and Architecture agent prompts; report snapshot must
  match the agents' snapshot; Phase 6 points L0-L2 codebases at agent-ready
  quality-gates mode
- Dimension guides: examine bullets, evidence commands, band notes,
  modifiers, and output lines for the four affected dimensions
- Report template: Gate Maturity section mirroring the snapshot line and a
  verification-cost row; README dimension table
- Bump to 1.8.0
Install a regression-aware quality gate using the project's native tools:
legacy debt is inventoried in a human-reviewed baseline and allowed to stay;
new or worsened complexity, duplication, or dead code fails merge-base-aware
PR CI; stale entries must be pruned so the baseline only shrinks.

- SKILL.md: quality-gates mode (detect tools, prefer native baseline/diff
  modes such as golangci-lint new-from-merge-base, detekt, PHPStan, RuboCop
  todo, otherwise install the stdlib engine; report/check/baseline commands
  via the task runner; CI; CODEOWNERS; docs; self-test), integrated into
  scaffold (Step 8) and audit (Quality Gate section and auto-fix offers);
  startup suggests the mode when the assessment is L0-L2
- references/quality-gates-pattern.md: the cross-language contract with
  adapter recipes for TS/JS, Ruby, Python, Go, JVM, Rust, PHP, the baseline
  review protocol, CI shape, and debt-fixture snippets
- assets/quality-gate.py: fingerprint baseline engine (identity ignores line
  numbers and numeric values; first integer tracked as a metric so a higher
  value is 'worsened'); --changed-only via merge-base; GitHub annotations;
  tool failure is not a pass. baseline requires --reason, prints a review
  summary, supports --dry-run, is refused in CI, and stays unreviewed (check
  fails) until --approve --reviewed-by; --prune only tightens
- assets: CI template, docs guide template, self-test template proving a
  clean tree passes, synthetic debt fails, and stale entries are pruned (on
  a temp baseline copy marked reviewed, so it runs before approval)
- AGENTS.md template: Definition of Done and directives; docs structure
  template gains guides/quality-gates.md
- tests/test_quality_gate.py (19 unit tests) run in CI via a test-templates
  job; README; bump to 1.5.0
@dgalarza
dgalarza force-pushed the feature/agent-quality-ratchets branch from 388af14 to 73e0ec5 Compare August 27, 2026 19:38
@dgalarza
dgalarza merged commit 0a2002b into main Aug 27, 2026
3 checks passed
@dgalarza
dgalarza deleted the feature/agent-quality-ratchets branch August 27, 2026 21:01
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