Skip to content

fix(qa): invalidate stale profile evidence before planning - #120012

Closed
vincentkoc wants to merge 1 commit into
mainfrom
fix/qa-profile-stale-evidence-invalidation-20260806
Closed

vincentkoc wants to merge 1 commit into
mainfrom
fix/qa-profile-stale-evidence-invalidation-20260806

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where a failed or invalid QA profile run could leave a previously successful qa-evidence.json in the reused output directory, allowing later planning or release automation to mistake stale evidence for the current run's result.

Related context:

Why This Change Was Made

The root cause was lifecycle ownership: runQaProfileCommand consumed the canonical profile evidence path without first invalidating evidence owned by an earlier run, and failure paths did not reliably remove partially rewritten evidence.

The canonical fix resolves the output directory once at profile-run entry, removes the canonical evidence before planning or execution, passes that resolved directory through the suite command, and removes canonical evidence again on any profile planning, suite, or attachment failure. The QA profile command remains the lifecycle owner. No paths were removed.

Production LOC: +79/-54 (net +25). Test LOC: +146/-13.

User Impact

Operators and release automation can trust that a failed QA profile run cannot appear successful because an older run left canonical evidence behind. Successful runs still write the profile scorecard and preserve the direct-flow watch URL.

Evidence

  • node scripts/run-vitest.mjs extensions/qa-lab/src/cli.runtime.test.ts - 144 tests passed.
  • git diff --check HEAD^ HEAD - passed.
  • node_modules/.bin/oxfmt --check extensions/qa-lab/src/cli.runtime.ts extensions/qa-lab/src/cli.runtime.test.ts - passed for both files.
  • Commit-mode autoreview for 28376512747a04bd22ec8c027e9a11f0c0e882f6 - clean, no accepted/actionable findings.
  • Exact scope: extensions/qa-lab/src/cli.runtime.ts and extensions/qa-lab/src/cli.runtime.test.ts.
  • No CHANGELOG.md change; release-note context is captured here.

AI-assisted: yes.

Punchcard-Session: cobalt-valley-meadow-mg

Punchcard-Session: cobalt-valley-meadow-mg
@vincentkoc vincentkoc self-assigned this Aug 6, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 2, 2026, 11:57 AM ET / 15:57 UTC.

ClawSweeper review

What this changes

The PR invalidates canonical QA profile evidence before planning and removes it again after profile planning, suite, or scorecard failures.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this member-authored PR open: current main still leaves stale profile evidence on failures before suite startup, but the introduced cleanup path can mask the primary failure when deletion also fails.

Priority: P2
Reviewed head: 28376512747a04bd22ec8c027e9a11f0c0e882f6

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The profile-owner direction is useful, but an unresolved P2 in its error path makes the draft not merge-ready.
Proof confidence 🌊 off-meta tidepool Not applicable: This repository-member PR changes internal QA lifecycle behavior; the contributor proof gate does not apply, while the focused fault-injection regression remains required for correctness.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This repository-member PR changes internal QA lifecycle behavior; the contributor proof gate does not apply, while the focused fault-injection regression remains required for correctness.
Evidence reviewed 6 items Introduced cleanup failure path: The PR-introduced catch awaits evidence deletion before rethrowing; if deletion fails, it replaces the planning, suite, or scorecard error that caused cleanup.
Existing QA error-precedence convention: The suite lifecycle retains the run error and cleanup failures in an AggregateError with the run error as cause, which is the appropriate convention for this profile-level cleanup path.
Regression coverage gap: New tests cover successful pre-run invalidation and successful failure cleanup, but do not inject a second fs.rm failure after a primary profile failure.
Findings 1 actionable finding [P2] Preserve the primary failure when evidence cleanup fails
Security None None.

How this fits together

QA Lab profile runs select scenario sets and produce canonical evidence for release and maturity automation. The profile command plans a run, invokes the suite, and attaches scorecard data to the resulting evidence.

flowchart LR
  A[Profile request] --> B[Profile planning]
  B --> C[Resolve output directory]
  C --> D[Clear prior evidence]
  D --> E[Run QA suite]
  E --> F[Attach scorecard]
  F --> G[Canonical evidence]
  E --> H[Failure cleanup]
Loading

Before merge

  • Preserve the primary failure when evidence cleanup fails (P2) - If the suite, profile-plan, or scorecard path throws and this deletion also throws, the cleanup error replaces the primary failure. Preserve both errors (as adjacent QA lifecycle code does) and add a fault-injection regression; this was also the unresolved prior review finding.
  • Resolve merge risk (P1) - A second evidence-deletion failure can hide the primary profile failure and leave operators without the cause needed to diagnose an unreliable canonical artifact.
  • Resolve merge risk (P1) - The draft is merge-conflicted, so the repair and focused validation must be refreshed against current main.
  • Complete next step (P2) - Preserve both the primary and cleanup errors, add the cleanup-fault regression, then rebase and refresh exact-head checks.
  • Improve patch quality - Retain both the primary and cleanup failures with a focused fault-injection regression.
  • Improve patch quality - Rebase the draft and refresh exact-head checks.

Findings

  • [P2] Preserve the primary failure when evidence cleanup fails — extensions/qa-lab/src/cli.runtime.ts:783
Agent review details

Security

None.

PR surface

Source +25, Tests +133. Total +158 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 79 54 +25
Tests 1 146 13 +133
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 225 67 +158

Review metrics

Metric Value Why it matters
Production versus test delta production +79/-54 (net +25); tests +146/-13 (net +133) The production growth is tied to one profile-lifecycle ownership boundary, but that boundary needs complete failure precedence before merge.

Merge-risk options

Maintainer options:

  1. Retain both failures before merge (recommended)
    Wrap the primary profile failure and a failed cleanup in the established AggregateError-style diagnostic, then add a focused fault-injection test.
  2. Pause the stale draft
    Keep the early-planning gap as a narrowly scoped follow-up if this conflicting branch is not going to be rebased.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve the primary profile error when canonical-evidence cleanup also fails, add a focused regression for both errors, then refresh the exact-head checks after rebase.

Technical review

Best possible solution:

Rebase the focused pre-planning invalidation repair onto current main, preserve both primary and cleanup failures, and add a fault-injection regression at the profile lifecycle boundary.

Do we have a high-confidence way to reproduce the issue?

Yes—source establishes the path: make suite, scorecard, or profile-plan processing fail after the first deletion succeeds, then make cleanup deletion fail; the introduced catch reports only the cleanup failure.

Is this the best way to solve the issue?

No—the early invalidation belongs at the profile lifecycle owner, but the new catch must retain both the original and cleanup failures using the established QA error-precedence pattern.

Full review comments:

  • [P2] Preserve the primary failure when evidence cleanup fails — extensions/qa-lab/src/cli.runtime.ts:783
    If the suite, profile-plan, or scorecard path throws and this deletion also throws, the cleanup error replaces the primary failure. Preserve both errors (as adjacent QA lifecycle code does) and add a fault-injection regression; this was also the unresolved prior review finding.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 296b2ef4a28d.

Labels

Label justifications:

  • P2: This is a bounded QA and release-automation reliability defect with a concrete repair path.
  • merge-risk: 🚨 automation: The branch changes canonical QA evidence that planning and release automation may consume.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This repository-member PR changes internal QA lifecycle behavior; the contributor proof gate does not apply, while the focused fault-injection regression remains required for correctness.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs extensions/qa-lab/src/cli.runtime.test.ts.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-06T23:35:37.864Z sha 2837651 :: needs maintainer review before merge. :: none
  • reviewed August 19, 2026, 7:57 PM ET / 23:57 UTC sha unknown :: found issues before merge. :: [P2] Preserve the primary failure when evidence cleanup fails
  • reviewed August 27, 2026, 7:00 PM ET / 23:00 UTC sha unknown :: needs changes before merge. :: [P2] Preserve the primary failure when evidence cleanup fails
  • reviewed 2026-08-27T23:00:32.402Z sha 2837651 :: needs historical verification review before merge. :: [P2] Preserve the primary failure when evidence cleanup fails

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 20, 2026
@clawsweeper clawsweeper Bot added status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 30, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 3, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

@RomneyDa
RomneyDa deleted the fix/qa-profile-stale-evidence-invalidation-20260806 branch October 22, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. stale Marked as stale due to inactivity status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant