Skip to content

fix(qa-lab): release Mantis credentials when cleanup fails - #128315

Merged
steipete merged 1 commit into
mainfrom
codex/land-aug23-mantis
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/land-aug23-mantis

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where failed Mantis desktop proof runs could skip cleanup after setup or builder failures, leaving leased credentials, heartbeat work, or temporary browser resources active.

Why This Change Was Made

The lifecycle now gives cleanup and release work one canonical finally owner across Slack, Telegram, browser, and Crabbox proof paths. Failed-created browser VMs remain retained for diagnosis, while the existing copy exclusions, SSH behavior, and no-delete guarantees stay unchanged.

AI-assisted maintainer fix. I reviewed the final code, proof, and exact landing diff.

User Impact

Operators can rerun failed Mantis proofs without leaking credentials or background cleanup state. Successful proof behavior and retained diagnostic resources are unchanged.

Evidence

  • Production LOC: +93/-134 (net -41); tests: +266/-231 (net +35); total net -6 across exactly seven Mantis files.
  • Current-main base: b977ccb21e2b4b8bff05729548ea1b1558a74a33; exact head: 4007fd0c7d913cfb2a27f8f37b77ec730007671a.
  • Exact plain and binary diff SHA-256: a7c15caa2c0f1a209f0352fbc407fabb50454076e501b0254d3d2b71b059538f.
  • Original private cleanup reproduction: 4/4 leak cases failed before the repair and pass afterward.
  • Fresh owner proof: 41/41 passed, covering cleanup/release, visual consumers, failed-created VM retention, copy exclusions, heartbeat stop, and credential release.
  • Independent verification confirmed the nested finalizers preserve summary/report emission, VM stop, heartbeat stop, credential release, SSH, no-delete, and browser retention boundaries.
  • Mandatory exact-source autoreview: secret scan clean; isolated Codex review reported no actionable findings (0.99 patch-correctness confidence).
  • The broader extension check reaches unrelated ACPx dependency drift outside this seven-file scope; the exact owner proof and current-main ACPx blobs are clean.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 23, 2026 18:00
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 2:07 PM ET / 18:07 UTC.

ClawSweeper review

What this changes

The PR centralizes Mantis Crabbox artifact copying and restructures Slack and Telegram proof-run cleanup so credential leases and related resources release even after setup or artifact failures.

Merge readiness

✅ Ready for maintainer review

Keep open. This protected maintainer PR repairs a current-main cleanup ordering defect; source and focused regression coverage support the patch, with no blocking finding identified.

Priority: P2
Reviewed head: 4007fd0c7d913cfb2a27f8f37b77ec730007671a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with source-backed failure coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal QA cleanup repair is exempt from the external-contributor proof gate; the PR body also reports after-fix owner proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal QA cleanup repair is exempt from the external-contributor proof gate; the PR body also reports after-fix owner proof.
Evidence reviewed 6 items Current-main defect: Current main runs report writing and desktop stopping sequentially before heartbeat shutdown and credential release, so either earlier cleanup failure skips the later credential cleanup.
Canonical repair: Nested finalizers ensure credential release is reached after report-write, Crabbox-stop, or heartbeat-stop failures; individual cleanup errors are retained as warnings.
Lease contract: The credential owner supplies an awaited heartbeat stop and a separate release operation, matching the finalizer ordering used by the patch.
Findings None None.
Security None None.

How this fits together

Mantis runs QA proof flows in leased Crabbox desktops, optionally obtains short-lived Slack or Telegram credentials, then copies artifacts and emits a report. The changed cleanup path releases the desktop lease, heartbeat, and credential lease after that flow exits.

flowchart LR
  A[Proof command] --> B[Lease desktop and credentials]
  B --> C[Run Slack or Telegram proof]
  C --> D[Copy proof artifacts]
  D --> E[Write report]
  E --> F[Stop heartbeat and release credentials]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -41, Tests +35. Total -6 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 93 134 -41
Tests 3 266 231 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 359 365 -6

Review metrics

Metric Value Why it matters
Production versus tests production -41, tests +35 The bug fix removes three duplicate artifact-copy helpers while adding focused failure-order coverage for both credential-owning proof flows.

Stored data model

Persistent data-model change detected: serialized state: extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.test.ts, serialized state: extensions/qa-lab/src/mantis/telegram-desktop-builder.runtime.test.ts, serialized state: extensions/qa-lab/src/mantis/telegram-desktop-builder.runtime.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the shared artifact-copy helper and nested cleanup finalizers after exact-head CI completes, while retaining the browser flow’s intentional failed-VM diagnostic behavior.

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

Yes—current main’s sequential finalizer order source-proves that a report-write or Crabbox-stop failure skips later credential release; the new focused tests model both failures.

Is this the best way to solve the issue?

Yes—the patch repairs the lifecycle owner with nested finalizers, rather than compensating at a caller, and consolidates duplicated artifact-copy behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 663a9d2f156c.

Labels

Label changes:

  • add P2: This prevents credential and background-resource leakage in internal QA proof runs, with limited end-user blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal QA cleanup repair is exempt from the external-contributor proof gate; the PR body also reports after-fix owner proof.

Label justifications:

  • P2: This prevents credential and background-resource leakage in internal QA proof runs, with limited end-user blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal QA cleanup repair is exempt from the external-contributor proof gate; the PR body also reports after-fix owner proof.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the reviewed cleanup repair and is the leading contributor in available history for the central Mantis runtime files. (role: recent area contributor; confidence: high; commits: 4007fd0c7d91; files: extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.ts, extensions/qa-lab/src/mantis/telegram-desktop-builder.runtime.ts, extensions/qa-lab/src/mantis/crabbox-runtime.ts)

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.

@steipete
steipete merged commit d916272 into main Aug 23, 2026
190 checks passed
@steipete
steipete deleted the codex/land-aug23-mantis branch August 23, 2026 18:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant