Skip to content

fix(qa): report cleanup failures truthfully - #119727

Merged
vincentkoc merged 2 commits into
mainfrom
fix/qa-cleanup-terminal-truthfulness-20260805
Aug 5, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/qa-cleanup-terminal-truthfulness-20260805

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Related: #119442
Related: #113974

What Problem This Solves

Fixes an issue where QA Lab could report a completed run before terminal cleanup finished, so a cleanup failure could leave operators with a false success signal. Cleanup-only network failures could also lose the error identity needed for infrastructure retry classification, while nested standard runs could emit duplicate completion lines under isolated or parity parents.

Why This Change Was Made

The QA Lab suite orchestrators owned both result publication and cleanup, but published terminal success inside the run body before their cleanup boundary completed. The canonical fix records phase-specific cleanup failures, preserves the original cleanup error as the AggregateError cause when it is the only failure, and delays the terminal result/progress signal until owner cleanup succeeds.

Standard nested runs now suppress their own completion line. Isolated and runtime-parity parents emit exactly one completion line, only after parent cleanup. This avoids duplicate terminal reporting without adding a parallel completion path.

Production LOC: +150/-74 (net +76), justified by the cleanup ownership boundary and truthful terminal-result contract. Test LOC: +560/-21 (net +539).

User Impact

QA Lab operators now get a truthful terminal outcome: scenario artifacts remain discoverable when cleanup fails, infrastructure retries retain the cleanup network cause, and successful standard, isolated, and parity runs each report completion exactly once after cleanup.

Evidence

  • node scripts/run-vitest.mjs across the five focused QA Lab test files: 5 files passed, 102 tests passed.
  • ./node_modules/.bin/oxfmt --check across all nine changed files: clean.
  • git diff --check origin/main...HEAD: clean.
  • Coverage includes standard cleanup and retry classification, nested standard suppression, isolated parent cleanup/completion, and runtime-parity parent cleanup/completion.

Punchcard-Session: silver-valley-valley-dt

Punchcard-Session: silver-valley-valley-dt
@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 5, 2026 20:06
Punchcard-Session: silver-meadow-lantern-vx
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 4:30 PM ET / 20:30 UTC.

ClawSweeper review

What this changes

This PR makes QA Lab report cleanup failures in its final result, retains the cleanup error for infrastructure retry, and prevents nested suite runs from printing duplicate completion lines.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this focused QA Lab repair open for normal maintainer handling. Current main emits completion progress before cleanup, while the patch makes cleanup aggregation authoritative before the terminal result; no blocking patch defect was found.

Priority: P2
Reviewed head: 3f0361df36d62790234f4ed03bf45611d2670699

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A well-scoped owner-boundary repair with focused coverage and no actionable source finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This repository-MEMBER PR is outside the external-contributor proof gate; its focused test evidence remains supplemental to normal maintainer review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This repository-MEMBER PR is outside the external-contributor proof gate; its focused test evidence remains supplemental to normal maintainer review.
Evidence reviewed 6 items Current-main behavior: The pre-PR suite owners publish completion progress inside their run body before their finally-owned cleanup path; a later cleanup failure can therefore follow an already-emitted completion signal.
Owner-boundary repair: The PR records the result, executes cleanup, throws phase-labelled cleanup failures, and only then emits terminal completion; the same pattern covers standard, isolated, and parity owners.
Retry contract: A sole cleanup failure is retained as the aggregate cause, matching the launcher’s network-cause retry classification.
Findings None None.
Security None None.

How this fits together

QA Lab’s standard, isolated, and runtime-parity suite owners start scenario resources, write artifacts, then clean resources up before reporting the run outcome. Their terminal result feeds CLI progress, retry classification, and the Lab runner status visible to QA operators.

flowchart LR
  A[QA suite request] --> B[Standard, isolated, or parity owner]
  B --> C[Scenarios and artifacts]
  C --> D[Canonical cleanup plan]
  D --> E{Cleanup succeeds?}
  E -->|Yes| F[One terminal completion]
  E -->|No| G[Phase-labelled failure]
  G --> H[Retry classification and Lab status]
Loading

Before merge

  • Complete next step (P2) - No discrete repair remains; this maintainer-labeled PR needs normal exact-head CI and final review rather than an automated replacement.
Agent review details

Security

None.

PR surface

Source +77, Tests +543. Total +620 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 172 95 +77
Tests 5 564 21 +543
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 736 116 +620

Review metrics

Metric Value Why it matters
Production versus test delta production +172/-95 (net +77); tests +564/-21 (net +543) The production growth is concentrated in the cleanup ownership and terminal-result contract, with substantial focused regression coverage.

Merge-risk options

  • The supplied check snapshot still has exact-head jobs in progress; merge only after required checks are green and the latest ClawSweeper rank-up moves have been confirmed.

Maintainer options:

  1. Decide the mitigation before merge
    Keep cleanup failure aggregation and terminal publication at the suite owners, with one final completion signal only after all owned cleanup succeeds.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep cleanup failure aggregation and terminal publication at the suite owners, with one final completion signal only after all owned cleanup succeeds.

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

Yes, source-reproducible: current main emits completion progress before finally-owned cleanup in all three suite-owner shapes; a cleanup failure follows that signal. This read-only review did not execute the failure path.

Is this the best way to solve the issue?

Yes. Moving terminal reporting behind the existing canonical cleanup aggregation fixes the owner boundary directly and avoids downstream correction paths that would retain a false completion signal.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2db3431f4aa1.

Labels

Label changes:

  • add P2: This is a bounded QA operator reliability repair that can otherwise misreport cleanup outcomes and retry classification.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This is a bounded QA operator reliability repair that can otherwise misreport cleanup outcomes and retry classification.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged suite split and related cleanup-owner work that established the modules and lifecycle this PR changes. (role: suite architecture and cleanup-history contributor; confidence: high; commits: c66f0d340be6, b5d99c1f0675; files: extensions/qa-lab/src/suite.ts, extensions/qa-lab/src/suite-run-standard.ts, extensions/qa-lab/src/suite-run-isolated.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for exact-head required checks and confirm the latest ClawSweeper rank-up moves before merging.

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.

@vincentkoc
vincentkoc merged commit 7b8bba2 into main Aug 5, 2026
120 checks passed
@vincentkoc
vincentkoc deleted the fix/qa-cleanup-terminal-truthfulness-20260805 branch August 5, 2026 21:16
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
…cope

* origin/main:
  fix(qa): report cleanup failures truthfully (openclaw#119727)
  fix: keep completed actions visible after settled finalization (openclaw#119726)
  fix(agents): rearm yielded requester wake (openclaw#119696)
  fix(diagnostics): preserve telemetry during service shutdown (openclaw#119705)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
* fix(qa): report cleanup failures truthfully

Punchcard-Session: silver-valley-valley-dt

* fix(qa): satisfy cleanup runner static checks

Punchcard-Session: silver-meadow-lantern-vx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant