Skip to content

feat(benchmark): benchmark accuracy, ground truth adjudication and CLI observability - #11

Merged
robertotru merged 4 commits into
mainfrom
feat/benchmark-accuracy-adjudication-observability
Nov 1, 2026
Merged

robertotru merged 4 commits into
mainfrom
feat/benchmark-accuracy-adjudication-observability

Conversation

@robertotru

Copy link
Copy Markdown
Contributor

Summary

This pull request addresses evaluation defects and observability limitations in the VerifyCraft review quality benchmark identified during full-split live DeepSeek evaluations.

1. Root Cause Analysis & Scoring Accuracy

  • Defect in dev_01_req_violation_auth_expiry: Ground truth previously enforced rigid literal substring matching ("expiration"). Valid review findings expressing semantic equivalents (e.g. "Expired tokens are accepted as valid" citing token.expires_at) were misclassified simultaneously as a false negative and an ungrounded false positive. Resolved by introducing versioned aliases ("expired", "expires_at", "expiry") and evidence_anchors ("expires_at", "authenticate") linked to a stable defect_id.
  • Adjudication for dev_09 KeyError Claim: In dev_09, get_lead_user_id(users: list[dict]) accesses primary['id']. Flagging this as a defect without input schema evidence is an unsupported caller assumption. Rather than silently dropping or ignoring it, a versioned AdjudicationCatalog was established (benchmarks/data/review_eval/adjudications.json), classifying it auditably as an unsupported_claim (retained as a false positive).
  • Matching Invariants: Implemented 1-to-1 bipartite matching so that duplicate findings targeting a single defect cannot inflate True Positive yields or satisfy multiple distinct defects simultaneously.
  • Requirement Status Normalization: Fixed status vocabulary mapping in src/verifycraft/review/engine.py and benchmark scoring to normalize valid provider statuses ("satisfied") into the canonical appears_satisfied enum.

2. Offline Rescoring & Auditability (--rescore)

  • Added --rescore <PATH> CLI option to evaluate past live run reports deterministically and hermetically without live provider API calls.
  • Prints decision deltas showing exactly what changed, why, and the impact on release gate policy.

3. CLI Observability & Stream Separation

  • Replaced monolithic, non-interactive execution with streaming progress logs written directly to sys.stderr and flushed immediately.
  • Added --quiet (-q) flag to suppress progress logs.
  • When --json is supplied, machine-readable JSON is emitted cleanly to stdout while progress and diagnostics remain isolated on stderr.
  • Added fails-closed credential validation that exits with code 1 and actionable remediation instructions when required keys are missing.

4. Verification & Invariants

  • Unit tests added in tests/unit/test_benchmark_accuracy.py (11 new tests).
  • All 336 project tests passing (pytest), strict type checking passing (mypy), and formatting/linting passing (ruff).
  • No modifications were made to bypass tests or weaken quality gate thresholds (85% precision, 90% recall, 0 invalid locations).

…I observability

- Fix evaluation defect in dev_01 by adding semantic defect aliases and evidence anchors
- Audit dev_09 and establish versioned AdjudicationCatalog for auditable classification decisions
- Enforce bipartite 1-to-1 matching to prevent duplicate finding inflation
- Normalize requirement status ('satisfied' -> 'appears_satisfied') in engine and benchmark
- Implement offline rescoring capability (--rescore <PATH>) to evaluate runs deterministically
- Add streaming progress to stderr with --quiet support and pure JSON stdout
- Add comprehensive hermetic unit tests covering matching, adjudication, rescoring, and CLI streams
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@robertotru robertotru self-assigned this Oct 31, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

@robertotru
robertotru merged commit c230ecf into main Nov 1, 2026
15 checks passed
@robertotru
robertotru deleted the feat/benchmark-accuracy-adjudication-observability branch November 2, 2026 19:36
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