Repository navigation
fix(ci): retain failure diagnostics and shard provenance - #138651
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 6:09 PM ET / 22:09 UTC. ClawSweeper reviewWhat this changesThe 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 provenancePossible 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 Review scores
Verification
How this fits togetherThe 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]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +136, Docs +19, Other +6. Total +161 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Maintainer source-contract verification and pre-merge proofThe 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
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 Local proof commands: node scripts/run-vitest.mjs test/scripts/crabbox-wrapper.test.ts ui/src/test-helpers/control-ui-e2e.test.tsnode 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.mdResults: 286 wrapper tests + 7 UI-helper tests passed; final nine-test regression rerun and all classified checks passed. Synthetic real Chromium diagnostic capture changed 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. |
|
Merged via squash.
|
…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.
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
runsandcapturesoutputs 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_INDEXexported by CI, preserving theci.shardIndexJSON 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
da817a8aaca3a63b0edbe2133fc8098d6326935cand the reproduced base93450a667d2ab1e747db303de86ab02737c18dda. Initial boundary tests failed with missing-captureENOENTand demonstrated overwritten prior run bytes.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=5andVITEST_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; requiredopenclaw/ci-gateis 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
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.