Skip to content

feat: add GoValidate pack-quality gates - #213

Merged
mohanagy merged 6 commits into
mainfrom
issue-157-pack-quality-gates
May 18, 2026
Merged

mohanagy merged 6 commits into
mainfrom
issue-157-pack-quality-gates

Conversation

@mohanagy

@mohanagy mohanagy commented May 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #157

Summary

  • add a shared docs/benchmarks/govalidate-suite/ directory with deterministic pack-quality gates and a no-model verifier
  • cover the verifier contract and gate schema with benchmark artifact and quality tests
  • update the 2026-05-12 GoValidate benchmark note to use the shared gate flow and verifier command

Test Plan

  • npm run typecheck
  • npm run build
  • npm run test:run

Summary by CodeRabbit

  • New Features

    • Added a CLI verifier to validate benchmark reports against configurable quality gates.
    • Introduced a predefined "docs-artifact" gate with required/forbidden label checks and numeric limits.
  • Documentation

    • Added and updated guides describing quality-gate usage, verifier commands, and reproducibility steps.
  • Tests

    • Added unit and contract tests covering valid/invalid reports, malformed configs, and gate enforcement.

Review Change Stack

mohanagy and others added 5 commits May 18, 2026 21:55
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 18, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ea903f43-829b-49e4-ab1b-db6e0cbb7eae

📥 Commits

Reviewing files that changed from the base of the PR and between ad45242 and 49a81bf.

📒 Files selected for processing (3)
  • docs/benchmarks/govalidate-suite/verify-pack-quality.js
  • tests/unit/benchmark-artifact.test.ts
  • tests/unit/benchmark-quality.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/unit/benchmark-quality.test.ts
  • docs/benchmarks/govalidate-suite/verify-pack-quality.js
  • tests/unit/benchmark-artifact.test.ts

📝 Walkthrough

Walkthrough

This PR adds a shared pack-quality gate catalog and verifier: quality-gates.json and verify-pack-quality.js, integrates the verifier into the 2026-05-12 benchmark README with required/forbidden labels and a command example, and adds tests and fixtures validating gate/config/report behaviors and path handling.

Changes

Pack Quality Gates for Benchmarks

Layer / File(s) Summary
Gate configuration and suite documentation
docs/benchmarks/govalidate-suite/quality-gates.json, docs/benchmarks/govalidate-suite/README.md, tests/unit/benchmark-quality.test.ts
Adds quality-gates.json with a docs-artifact gate (prompt, required_labels, forbidden_labels, max_* ceilings); documents the suite and label-normalization rules; adds runtime tests asserting config entries and numeric/array invariants.
Pack quality verifier implementation
docs/benchmarks/govalidate-suite/verify-pack-quality.js
New Node.js CLI that parses --report and exactly one of --gate/--prompt, loads and strictly validates gate configs, resolves the target gate, validates compare report structure, normalizes labels, enforces required/forbidden labels and numeric ceilings, and emits deterministic PASS/FAIL with appropriate exit codes.
Benchmark README integration and verifier contract tests
docs/benchmarks/2026-05-12-govalidate-report-generation/README.md, tests/unit/benchmark-artifact.test.ts
Updates the benchmark README to reference the shared verifier and quality-gates.json, documents required (IdeaReportController, GenerateIdeaReportService) and forbidden (IdeaReportSharePage, GenerateIdeaReportScript) labels and adds a concrete verifier command; adds fixture builders and comprehensive tests exercising pass/fail cases, malformed inputs, path resolution, and label-normalization edge cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hop through gates of JSON light,
Checking labels in the night,
Deterministic, small, and spry,
No models called — just truth nearby,
A tiny rabbit gives a nod and smiles ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding GoValidate pack-quality gates. It is concise, specific, and clearly summarizes the primary feature being added.
Description check ✅ Passed The PR description includes a clear summary of changes, references the linked issue #157, provides a comprehensive test plan with checkmarks for all three standard test commands, and follows the repository template structure with Summary and Test Plan sections.
Linked Issues check ✅ Passed The PR fully addresses all acceptance criteria from issue #157: adds quality-gates.json configuration with required fields, implements verify-pack-quality.js utility that runs without model calls and exits non-zero on failure, includes documentation in READMEs stating gates are necessary but not sufficient, and all typecheck/build/test steps pass.
Out of Scope Changes check ✅ Passed All code changes are directly aligned with the scope of issue #157: the shared govalidate-suite directory, quality gates configuration, verifier script, benchmark documentation updates, and corresponding tests are all explicitly required by the acceptance criteria.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-157-pack-quality-gates

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/benchmarks/govalidate-suite/verify-pack-quality.js`:
- Around line 166-168: The current check uses Number.isFinite(pack.token_count)
which still accepts negatives and fractions; update the validation in
verify-pack-quality.js to require a non-negative integer by replacing the finite
check with a test like Number.isInteger(pack.token_count) && pack.token_count >=
0 (or Number.isSafeInteger if you prefer), and keep the same fail(`Malformed
compare report: pack.token_count must be a non-negative integer`) call when it
fails; refer to pack.token_count and the existing fail(...) invocation to locate
and update the check.
- Around line 107-113: The validation currently allows gates without a prompt
which breaks prompt-based selection; update the gate validation around the check
that references gate and gateName to require that gate.prompt exists and is a
non-empty string (fail with the existing fail(...) helper if missing/invalid),
and change the return object (where prompt is currently returned as typeof
gate.prompt === 'string' ? gate.prompt : null) to always return the validated
string prompt (e.g., prompt: gate.prompt) so requiredLabels and downstream logic
get a concrete prompt value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fce9b088-8226-40ca-bee7-1b24c2c1220d

📥 Commits

Reviewing files that changed from the base of the PR and between 0330441 and ad45242.

📒 Files selected for processing (6)
  • docs/benchmarks/2026-05-12-govalidate-report-generation/README.md
  • docs/benchmarks/govalidate-suite/README.md
  • docs/benchmarks/govalidate-suite/quality-gates.json
  • docs/benchmarks/govalidate-suite/verify-pack-quality.js
  • tests/unit/benchmark-artifact.test.ts
  • tests/unit/benchmark-quality.test.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohanagy
mohanagy merged commit d3c1b56 into main May 18, 2026
7 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.

[P0][Benchmarks] Add pack-quality gates for benchmark prompts

1 participant