Skip to content

fix(ci): retain failure diagnostics and shard provenance - #138651

Merged
steipete merged 1 commit into
mainfrom
steipete/pensive-kilby-ea5172
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/pensive-kilby-ea5172

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #138650 — failure captures lost during temporary CI sync checkout cleanup.
Related: #138482 — keep ready PR checks alive after delayed draft events; this diagnostic follow-up is independent of that admission fix.

Additional instructions

This is a same-repository branch, writable by repository maintainers. GitHub's fork-only maintainer-edit flag does not govern this branch.

What Problem This Solves

Resolves a problem where maintainers diagnosing failed remote validation received a local failure-bundle path that disappeared when the wrapper cleaned up its temporary sync checkout. Repeated native artifact filenames could also overwrite earlier retained evidence.

The same investigation found Control UI E2E reports losing their shard index even though CI correctly executed the requested native shard. This PR repairs diagnostic retention and attribution only; it does not change the underlying browser behavior or CI admission/concurrency.

Why This Change Was Made

The temporary-checkout cleanup owner now preserves both native runs and captures outputs together beneath a fresh .crabbox/wrapper-artifacts/run-* directory, prints the old-to-new root mapping, and retains the temporary checkout if preservation fails. This replaces the runs-only copy path instead of adding a separate cleanup mechanism.

The diagnostic writer reads the existing VITEST_SHARD_INDEX exported by CI, preserving the ci.shardIndex JSON field and schema. No alias, new configuration, workflow change, backend selection, cache, budget, permission, or product-runtime change is added.

User Impact

Maintainers can inspect retained failure bundles after temporary sync cleanup and distinguish repeated invocations without losing earlier artifacts. Normal CI UI diagnostics retain their actual shard index. There is no change to the product UI or channel behavior.

Local documentation explains the retention location and its limits. Native proof strings still reference their original paths; use the printed relocation mapping. Native Blacksmith failure bundles contain streams and diagnostic metadata, not remote screenshots, which must be retrieved separately before stopping a Testbox. Missing shard environment metadata remains null, including separate release/manual invocations that only pass a CLI shard.

Evidence

Before/after owner proof

  • The wrapper is byte-identical at incident merge da817a8aaca3a63b0edbe2133fc8098d6326935c and the reproduced base 93450a667d2ab1e747db303de86ab02737c18dda. Initial boundary tests failed with missing-capture ENOENT and demonstrated overwritten prior run bytes.
  • The replacement regression executes the full wrapper, real Git/source-capsule preparation, and filesystem cleanup; only the external provider executable is a fixture. It covers capture-only failures, combined/nested outputs, sparse checkouts, successful runs, no artifacts, direct execution, repeated native names, and a blocked retention destination.
  • The existing UI capture/filesystem test now checks populated 5/6 metadata and absent canonical metadata without falling back to an unrelated old-name variable. Its independent two-attempt screenshot/report retention assertions remain.
  • Full focused validation passed: 286 wrapper tests + 7 UI-helper tests. A final nine-test regression selection also passed after removing an obsolete test import.
node scripts/run-vitest.mjs test/scripts/crabbox-wrapper.test.ts ui/src/test-helpers/control-ui-e2e.test.ts
node scripts/check-changed.mjs -- scripts/crabbox-wrapper.mts test/scripts/crabbox-wrapper.test.ts ui/src/test-helpers/control-ui-e2e.ts ui/src/test-helpers/control-ui-e2e.test.ts docs/reference/test.md

The complete classified gate passed, including core-test/UI/scripts/root-test typechecks, focused lint, dead-export scans, formatting, and applicable guards. Fresh isolated Codex autoreview through P2 found no accepted/actionable findings.

Real browser diagnostic capture

A synthetic missing-element timeout in real Chromium 151.0.7922.34, with VITEST_SHARD_INDEX=5 and VITEST_SHARD_COUNT=6, produced:

{"before":{"shardIndex":null,"vitestShardCount":"6"},"after":{"shardIndex":"5","vitestShardCount":"6"},"captureErrors":[]}

Both PNGs were inspected and contain only synthetic content; their visible page is unchanged because this is a JSON provenance repair, not a visual UI change. This is diagnostic-boundary browser proof, not a full native CI shard or new remote Testbox replay. Raw logs, local paths, credentials, and agent transcripts are not attached.

Dependency contract and remaining limits

Crabbox 0.48.1, clean revision c766cde9e877ade7cb13d241d106d5694b842deb, was inspected directly: failure-bundle producer, cwd-relative capture destination, and per-lease run artifact names. Native capture names use second-level timestamps and run proof filenames repeat, so wrapper retention needs an invocation-owned namespace. Native history/logs/results use the coordinator rather than discovering these local paths.

The shard consumer mismatch is verified in the parent-relative patch of 90d5fbbd314c09abca616bab683f9027c0bbfac7, which renamed the CI producer without migrating this diagnostic read.

No Blacksmith directory-download fix is claimed: original argv and upstream source were unavailable, and no guessed recursive flag was added. This change cannot recover already deleted evidence.

Maintainer follow-through

CI run 33923535421 passed on attempt 1 for exact head 1f3d5f1b9bcc9901b7e8233ecd829781e6a5a480; required openclaw/ci-gate is green. The pinned-source verification and pre-merge proof address both ClawSweeper before-merge entries and its rank-up move: the three Crabbox producer files were independently fetched at the pinned public commit and byte-compared with the inspected copy. The live 0.48.1 tag and installed binary's clean VCS revision match that commit. No code change was needed; the automated review's gap was upstream source access.

Scope and LOC

Category Added Removed Net
Product runtime 0 0 0
Wrapper tooling 25 19 +6
UI test-support owner 1 1 0
Tests 201 65 +136
Docs 20 1 +19

The six-line tooling increase preserves the second native artifact category, prevents cross-invocation overwrite, and reports the retained source on preservation failure. The old shared-root artifact fixture is removed.

Preserve native run and capture artifacts per temporary-sync invocation, retain the source checkout on preservation failure, and use the canonical CI shard index in UI failure reports.

Fixes #138650 (failure captures lost during temporary sync cleanup). Related: #138482 (CI admission keeps ready PR checks alive). Diagnostic tooling only; no backend, scheduling, cache, permission, or product-runtime changes.
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 4, 2026
@steipete
steipete marked this pull request as ready for review September 4, 2026 21:59
@steipete steipete self-assigned this Sep 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 6:09 PM ET / 22:09 UTC.

ClawSweeper review

What this changes

The PR retains temporary-checkout Crabbox run and capture diagnostics under a unique local invocation directory and records the canonical CI shard index in Control UI failure reports.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 2 items remain

No blocking correctness finding in the introduced patch. This member-owned PR remains necessary: current main still preserves only run artifacts and reads a shard variable that CI does not set; one upstream Crabbox layout check remains a maintainer-facing limitation because this reviewer could not reach the dependency source.

Priority: P2
Reviewed head: 1f3d5f1b9bcc9901b7e8233ecd829781e6a5a480

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with credible regression coverage; independent upstream artifact-contract inspection remains unavailable to this reviewer.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored diagnostic-tooling PR is exempt from the external-contributor proof gate; the supplied Chromium trace and wrapper boundary coverage are useful supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored diagnostic-tooling PR is exempt from the external-contributor proof gate; the supplied Chromium trace and wrapper boundary coverage are useful supplemental evidence.
Evidence reviewed 6 items Current-main artifact behavior: Current main's cleanup helper copies only .crabbox/runs into a shared destination with force enabled, so capture bundles remain in the disposable checkout and repeated run names can overwrite prior evidence.
Introduced cleanup owner: The PR replaces the runs-only copy with an invocation-unique directory that copies nonempty runs and captures roots, and leaves the temporary checkout intact when preservation throws.
Canonical CI shard producer: The Control UI CI job exports VITEST_SHARD_INDEX and VITEST_SHARD_COUNT and passes those same values to Vitest; the PR changes the report consumer to the matching index variable.
Findings None None.
Security None None.

How this fits together

The Crabbox wrapper runs remote validation from a disposable checkout, then cleans it up; diagnostics must be copied back before that cleanup. Control UI E2E failures write a screenshot and JSON report, which CI later uploads for diagnosis.

flowchart LR
  A[Remote validation request] --> B[Temporary checkout]
  B --> C[Crabbox diagnostics]
  C --> D[Wrapper cleanup]
  D --> E[Unique retained artifact directory]
  F[Control UI test timeout] --> G[Failure report]
  G --> H[CI shard provenance]
Loading

Before merge

  • Resolve merge risk (P1) - The pinned Crabbox artifact-producer layout could not be independently re-read because the upstream source was unavailable to this reviewer; the target boundary tests model both expected roots but are not an upstream contract check.
  • Complete next step (P2) - Before merge, independently confirm the pinned Crabbox 0.48.1 artifact-output contract; this review could not access that upstream source.
Agent review details

Security

None.

PR surface

Tests +136, Docs +19, Other +6. Total +161 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 202 66 +136
Docs 1 20 1 +19
Config 0 0 0 0
Generated 0 0 0 0
Other 1 25 19 +6
Total 5 247 86 +161

Review metrics

Metric Value Why it matters
Production vs test delta wrapper tooling +25/-19 (net +6); test support +1/-1; tests +201/-65; docs +20/-1 The small tooling increase is the unique-destination ownership needed to retain both diagnostic roots without overwriting earlier invocations.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #138650
Summary: This PR is the explicit candidate fix for the open temporary-checkout diagnostic-loss report; the earlier CI-admission PR is related incident context but a distinct root cause.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Confirm the pinned artifact contract (recommended)
    Before merge, independently verify that Crabbox 0.48.1 writes the relevant native diagnostics under the two preserved roots, then retain this focused cleanup design.

Technical review

Best possible solution:

Keep the single wrapper cleanup owner, preserve only the documented native output roots in unique invocation directories, and confirm the pinned Crabbox producer layout before merge.

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

Yes—source and focused regression coverage establish the temporary-checkout cleanup path and the CI environment-variable mismatch, although this read-only review did not execute the tests.

Is this the best way to solve the issue?

Yes—the PR fixes the existing cleanup owner rather than adding a parallel retention path, and it aligns the report reader with the CI producer's canonical shard variable.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8918e743cdf8.

Labels

Label changes:

  • add P2: This repairs diagnostic evidence retention and attribution for failed remote CI runs without changing product runtime behavior.
  • add merge-risk: 🚨 automation: The modified wrapper cleanup path controls whether CI diagnostic artifacts survive a failed remote-validation invocation.
  • 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 member-authored diagnostic-tooling PR is exempt from the external-contributor proof gate; the supplied Chromium trace and wrapper boundary coverage are useful supplemental evidence.

Label justifications:

  • P2: This repairs diagnostic evidence retention and attribution for failed remote CI runs without changing product runtime behavior.
  • merge-risk: 🚨 automation: The modified wrapper cleanup path controls whether CI diagnostic artifacts survive a failed remote-validation invocation.
  • 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 member-authored diagnostic-tooling PR is exempt from the external-contributor proof gate; the supplied Chromium trace and wrapper boundary coverage are useful supplemental evidence.

Evidence

What I checked:

  • Current-main artifact behavior: Current main's cleanup helper copies only .crabbox/runs into a shared destination with force enabled, so capture bundles remain in the disposable checkout and repeated run names can overwrite prior evidence. (scripts/crabbox-wrapper.mts:1384, 8918e743cdf8)
  • Introduced cleanup owner: The PR replaces the runs-only copy with an invocation-unique directory that copies nonempty runs and captures roots, and leaves the temporary checkout intact when preservation throws. (scripts/crabbox-wrapper.mts:1384, 1f3d5f1b9bcc)
  • Canonical CI shard producer: The Control UI CI job exports VITEST_SHARD_INDEX and VITEST_SHARD_COUNT and passes those same values to Vitest; the PR changes the report consumer to the matching index variable. (.github/workflows/ci.yml:2664, 8918e743cdf8)
  • Boundary regression coverage: The wrapper test executes a bundled copy of the real wrapper with real Git/source-capsule preparation and checks capture-only, combined, sparse, success, direct, repeated-name, and preservation-failure cases; the UI helper test checks both populated and absent canonical shard metadata. (test/scripts/crabbox-wrapper.test.ts:4836, 1f3d5f1b9bcc)
  • Feature-history routing: Recent merged main history shows Peter Steinberger maintaining both the wrapper and Control UI diagnostic helper surfaces, including the source-snapshot and E2E-build repairs. (scripts/crabbox-wrapper.mts:1384, a86a1b505d33)
  • Dependency inspection limitation: The target documentation identifies Crabbox as the wrapper's selected external binary, but no Crabbox source checkout was present and GitHub DNS was unavailable, so this review could not independently re-read the pinned producer paths claimed in the PR body. Public docs: docs/reference/test.md. (docs/reference/test.md:113, 1f3d5f1b9bcc)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Independently verify the pinned Crabbox artifact-output paths before merge, since this reviewer could not access the upstream source.

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 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer source-contract verification and pre-merge proof

The two before-merge entries and the rank-up move in ClawSweeper's review are addressed by independent source inspection, not by assuming the fixture models upstream correctly.

I re-fetched all three producer files from the public openclaw/crabbox repository at c766cde9e877ade7cb13d241d106d5694b842deb and byte-compared them with the source inspected during the repair. All matched. The live annotated tag v0.48.1 points to that commit; the installed 0.48.1 binary embeds the same vcs.revision with vcs.modified=false.

These are the two exact local output roots the wrapper preserves. The upstream limitation in ClawSweeper's environment was source access, not a conflicting producer contract. No code change or new compatibility path was needed to resolve it.

For head 1f3d5f1b9bcc9901b7e8233ecd829781e6a5a480, CI run 33923535421 completed successfully on attempt 1; required openclaw/ci-gate is green. Native review artifacts validate with zero findings, and fresh independent Codex autoreview through P2 is clean.

Local proof commands:

node scripts/run-vitest.mjs test/scripts/crabbox-wrapper.test.ts ui/src/test-helpers/control-ui-e2e.test.ts
node scripts/check-changed.mjs -- scripts/crabbox-wrapper.mts test/scripts/crabbox-wrapper.test.ts ui/src/test-helpers/control-ui-e2e.ts ui/src/test-helpers/control-ui-e2e.test.ts docs/reference/test.md

Results: 286 wrapper tests + 7 UI-helper tests passed; final nine-test regression rerun and all classified checks passed. Synthetic real Chromium diagnostic capture changed shardIndex: null to "5" for configured 5/6, with no capture errors. No raw logs, agent transcripts, credentials, or private footage are attached.

Remaining limits are unchanged: this is not a new remote Testbox replay or a Blacksmith directory-download repair; already deleted files cannot be recovered; native proof strings use the printed relocation mapping; separate release/manual invocations without shard environment metadata remain null. Product runtime delta is zero; wrapper tooling is +6 net lines, UI test-support owner net zero, tests +136, and docs +19.

@steipete
steipete merged commit 7697286 into main Sep 4, 2026
210 of 211 checks passed
@steipete
steipete deleted the steipete/pensive-kilby-ea5172 branch September 4, 2026 22:23
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…8651)

Preserve native run and capture artifacts per temporary-sync invocation, retain the source checkout on preservation failure, and use the canonical CI shard index in UI failure reports.

Fixes openclaw#138650 (failure captures lost during temporary sync cleanup). Related: openclaw#138482 (CI admission keeps ready PR checks alive). Diagnostic tooling only; no backend, scheduling, cache, permission, or product-runtime changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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.

[Bug]: Temporary CI sync cleanup drops failure captures

1 participant