Skip to content

feat(scorecard): add evidence-based QA readiness scorecard (#151) - #392

Merged
sumithr merged 2 commits into
mainfrom
feat/issue-151-readiness-scorecard
Jun 11, 2026
Merged

sumithr merged 2 commits into
mainfrom
feat/issue-151-readiness-scorecard

Conversation

@sumithr

@sumithr sumithr commented Jun 10, 2026 •

Copy link
Copy Markdown
Owner

Closes #151.

What this adds

A QA readiness scorecard that composes already-produced artifacts — the #144 risk-to-test ledger, the #149 issue/PR context bundle, and optional coverage/mutation signals — and derives a single readiness recommendation. It is an evidence summary, not a predictive quality score: it invents no numeric score, reports absent coverage/mutation as not measured (never assumed passing), and refuses a ready state whenever a risk is an uncovered blocker or evidence is stale — that guarantee is structural (the recommendation is computed; the caller cannot assert "ready").

Acceptance criteria

AC Status
Risk coverage, evidence freshness, uncovered blockers, residual risks, final recommendation ✅
Avoids unsupported numeric quality scores ✅ (counts + categorical states only)
Refuses ready/safe when high-impact risks uncovered or tests stale ✅ (structural — derived, plus eval)
Omittable from short/simple answers ✅ (compact_summary + skill guidance)
Promptfoo/scenario coverage includes stale-evidence and uncovered-risk cases ✅ (skill-reviewing-before-merge-scorecard.yaml, 2 seeds)
Scorecard states distinguish ready / blocked / insufficient-evidence / ready-with-accepted-residuals ✅
README/demo updates stay consistent with #86 ✅ The only README change is a one-line index entry for docs/SCORECARD.md — factual ("an evidence summary, not a predictive quality score"), consistent with #86, marketing no unsupported automation. Broader README/demo repositioning remains #86's scope.

The #154 scope-comment requirements are honored: scorecard fields are serializable for .sumo-qa/qa-report.html (#157), and the states distinguish not-measured / stale / blocked / ready-with-accepted-residuals / ready.

Evidence

  • Tests: full suite green, 100% coverage maintained. Modules: test_scorecard_models.py, test_scorecard_format.py, test_scorecard_validation.py, test_server_format_qa_scorecard_tool.py; registry tests (installer count, server tool-set, tools-list snapshot) updated; per-skill token budgets updated for the appendix additions.
  • Eval gate (Node 24 + OpenAI key, run at PR open): skill-reviewing-before-merge-scorecard.yaml 2/2 (uncovered-risk seed → blocked; stale-evidence seed → insufficient_evidence — both refuse ready). Regression: reviewing-before-merge 1/1, finishing-qa-work 1/1, creating-test-plan 1/1. The follow-up fix below touches only the Python measurement-normalization guard (no skill prose / eval seed / router), so these results stand.
  • Review: self-review removed a dead constant; an initial codex adversarial pass found 3 should-fix issues (accepted-residual over-counting; dimension table ignoring sha-mismatch/local-head conflict; non-gating coverage/mutation leaking into the readiness-gating stale_evidence list) — all fixed with discriminating tests, then re-reviewed clean.
  • Finish-pr review-driven fix (commit 7353c94): a codex P2 found that a coverage/mutation payload which validates but carries no actual measurement (an empty {}, or freshness/detail metadata with no line_percent/survivors/killed) was reported as a measured dimension and dropped from not_measured — contradicting the "absent ⇒ not_measured, never assumed green" guarantee. Fixed by adding has_measurement() to the signal models (shared _MeasurementSignal base + MEASUREMENT_FIELDS classvar; fields/JSON-schema unchanged) and normalizing a measurement-less signal to None in the load envelope — closing the path across the markdown table, compact summary, and serialized snapshot in one place. A zero (0% lines / 0 survivors) is preserved as a real measurement. Discriminating tests added; codex re-review of the fix: PASS. A per-file sumo-qa-reviewing-before-merge pass over the other source files (server, schemas, installer, formatter): SAFE, 0 material findings.
  • Behavioral verification (real MCP stdio dispatch of sumo_qa_format_qa_scorecard): uncovered high-impact risk → blocked; stale test evidence → insufficient_evidence; coverage={"freshness":"fresh"} (no number) → ready with Coverage reported as not measured (the fix, proven end-to-end); fresh passing evidence → ready.

CI green on the rebased head; new tool is additive (existing tool surface and the using_sumo_qa router unchanged).

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7457bcbbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sumo_qa/scorecard_validation.py Resolved
sumithr added 2 commits June 11, 2026 02:12
Compose an evidence-based QA readiness scorecard from already-produced
artifacts and DERIVE a readiness recommendation — it is an evidence
summary, never a predictive quality score, and refuses a ready state
whenever a risk is an uncovered blocker or evidence is stale.

- New module trio (mirrors the #144 ledger / #149 bundle pattern):
  scorecard_models.py (the derivation: ready / ready_with_accepted_
  residuals / blocked / insufficient_evidence, per-dimension statuses
  incl. not_measured), scorecard_format.py (markdown + compact summary
  + a JSON-able serialized snapshot for the #157 report), and
  scorecard_validation.py (reuses the ledger/bundle loaders verbatim).
- New read-only MCP tool sumo_qa_format_qa_scorecard. The recommendation
  is computed from the evidence — the caller cannot assert "ready".
- Reuses the #144 ledger + #149 context-bundle schemas; never duplicates
  them. Absent coverage/mutation signals are reported as "not measured",
  never assumed passing, and never outweigh an uncovered high-impact risk.
- Optional readiness appendix wired into sumo-qa-reviewing-before-merge
  (agrees with the SAFE gate by construction), sumo-qa-finishing-qa-work,
  and sumo-qa-creating-test-plan.
- Promptfoo eval skill-reviewing-before-merge-scorecard.yaml with
  uncovered-risk and stale-evidence seeds asserting the scorecard refuses
  ready; docs/SCORECARD.md, TOOLS.md, ARCHITECTURE.md, README, and a
  worked-example turn show good and bad scorecard states.
…to not_measured

A coverage/mutation payload that validates but carries no actual measurement
(an empty {} or freshness/detail metadata only) was reported as a measured
dimension (ok/stale) and dropped from not_measured, contradicting the
scorecard's core guarantee that absent coverage/mutation is reported as
not_measured and never assumed green.

Add has_measurement() to the signal models (via a shared _MeasurementSignal
base + MEASUREMENT_FIELDS classvar, fields/schema unchanged) and normalize a
measurement-less signal to None in the load envelope, so the markdown table,
compact summary, and serialized snapshot all report not_measured at one point.
A zero (0% lines / 0 survivors) is a real measurement and is preserved.
@sumithr
sumithr force-pushed the feat/issue-151-readiness-scorecard branch from b7457bc to 7353c94 Compare June 11, 2026 09:32
@sumithr
sumithr merged commit ad561d7 into main Jun 11, 2026
31 checks passed
@sumithr
sumithr deleted the feat/issue-151-readiness-scorecard branch June 11, 2026 09:52
sumithr added a commit that referenced this pull request Jun 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.43.0](v0.42.0...v0.43.0)
(2026-06-11)


### Features

* **scorecard:** add evidence-based QA readiness scorecard
([#151](#151))
([#392](#392))
([ad561d7](ad561d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
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.

[Task]: Add evidence-based QA readiness scorecards

1 participant