Skip to content

Add deterministic answer quality benchmark verifier - #215

Merged
mohanagy merged 1 commit into
mainfrom
issue-177-answer-quality-rubric
May 19, 2026
Merged

mohanagy merged 1 commit into
mainfrom
issue-177-answer-quality-rubric

Conversation

@mohanagy

@mohanagy mohanagy commented May 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a shared verify-answer-quality.js CLI for saved benchmark answer artifacts
  • extend the GoValidate quality gate config with deterministic answer-term checks and manual-review guidance
  • cover the verifier and docs with benchmark artifact tests and update benchmark/changelog docs

Test Plan

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

Closes #177

Summary by CodeRabbit

Release Notes

  • New Features

    • Added answer-quality verifier to validate benchmark answers against configured quality gates using deterministic required/forbidden term checks, without invoking an LLM.
  • Documentation

    • Updated benchmark documentation with answer-quality verification usage guides, CLI arguments, and validation behavior specifications.
  • Tests

    • Added and updated tests for answer-quality verifier functionality and expanded quality gate configuration schema.

Review Change Stack

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 19, 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: 9213b581-54c4-4575-963a-9912cd95b0a5

📥 Commits

Reviewing files that changed from the base of the PR and between 0ffbfd5 and 146e2ad.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • 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-answer-quality.js
  • tests/unit/benchmark-artifact.test.ts
  • tests/unit/benchmark-quality.test.ts

📝 Walkthrough

Walkthrough

This PR introduces a deterministic answer-quality verification framework for GoValidate benchmarks. It adds a new verify-answer-quality.js CLI tool that validates saved benchmark answers against configurable quality gates checking for required/forbidden terms, includes extended gate schema definitions and configurations, and provides complete documentation for both the suite and report generation workflows.

Changes

Answer Quality Verification Infrastructure

Layer / File(s) Summary
Answer Quality Gate Schema Definition
tests/unit/benchmark-artifact.test.ts, tests/unit/benchmark-quality.test.ts, docs/benchmarks/govalidate-suite/quality-gates.json
PackQualityGateDefinition and SharedPackQualityGate types extended with required_answer_terms, forbidden_answer_terms, required_concepts, and guidance fields (answer_quality_notes, manual_review_notes). Configuration and validation tests updated to enforce these fields as non-empty arrays on each gate entry.
Answer Quality Verifier Implementation
docs/benchmarks/govalidate-suite/verify-answer-quality.js, tests/unit/benchmark-artifact.test.ts
New Node.js CLI script parses --answer, --gate/--prompt, and --config arguments; loads and validates quality-gates.json schema; resolves gates by name or prompt string; normalizes and checks answer text for required/forbidden terms; reports PASS/FAIL status with gate summaries and exits with code 0 or 1. Test helper and contract tests verify expected behavior and gate-summary output.
Suite and Report Documentation
docs/benchmarks/govalidate-suite/README.md, docs/benchmarks/2026-05-12-govalidate-report-generation/README.md, tests/unit/benchmark-artifact.test.ts
Suite README updated with file list, new "Answer quality usage" section (gate-by-name and gate-by-prompt invocation modes, CLI shape, deterministic checks), and manual-review guidance behavior. Report-generation README adds verifier script reference and "Run the answer-quality verifier" section with example command and comparison to pack verifier. Test assertions validate documentation references and CLI usage examples.
Changelog Entry
CHANGELOG.md
[Unreleased] section documents the deterministic answer-quality rubric skeleton with answer-term checks, manual-review concept notes, and offline validation of saved answer artifacts.

Sequence Diagram

sequenceDiagram
  participant User
  participant AnswerVerifier as verify-answer-quality.js
  participant QualityConfig as quality-gates.json
  participant Answer as answer.txt
  User->>AnswerVerifier: Run with --answer --gate/--prompt --config
  AnswerVerifier->>QualityConfig: Load and validate schema
  AnswerVerifier->>QualityConfig: Select gate by name or prompt
  AnswerVerifier->>Answer: Read and normalize answer text
  AnswerVerifier->>AnswerVerifier: Check required_answer_terms present
  AnswerVerifier->>AnswerVerifier: Check forbidden_answer_terms absent
  AnswerVerifier->>User: Report PASS/FAIL with gate summary
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • #177: This PR directly implements all acceptance criteria for the deterministic answer-quality rubric skeleton, including extended quality gates, verification utility, per-prompt guidance fields, and documentation without external LLM calls.

Possibly related PRs

  • mohanagy/graphify-ts#213: This PR extends the shared GoValidate quality-gates framework introduced in #213 by adding answer-quality gate fields and the new verify-answer-quality.js verifier alongside the existing pack-quality gates.

Poem

🐰 A rubric for answers, deterministic and bright,
No LLMs needed, just terms wrong and right!
Check required ideas, forbid the bad claims,
Each benchmark answer gets thoroughly named.
From gate configs born, a verifier takes flight!

🚥 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 'Add deterministic answer quality benchmark verifier' clearly and concisely summarizes the main change: introducing a new verifier script for deterministic answer quality checks in benchmarks.
Description check ✅ Passed The PR description covers the main changes, testing plan, and issue linkage. While it doesn't follow the exact template structure, it includes essential information: summary of changes, test plan execution steps, and issue closure reference.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #177: extends quality gates with required/forbidden answer terms and required concepts, provides a verification utility for answer artifacts, supports answer quality notes and manual-review fields, and includes comprehensive test coverage without LLM calls.
Out of Scope Changes check ✅ Passed All changes are within scope: the new verify-answer-quality.js verifier, quality-gates.json updates with answer-quality fields, documentation updates, and comprehensive test coverage directly address issue #177 requirements without unrelated modifications.

✏️ 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-177-answer-quality-rubric

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.

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.

[P1][Evaluation] Add deterministic answer-quality rubric skeleton

1 participant