Repository navigation
fix: reuse prepared test runtimes after source refreshes - #162744
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed October 1, 2026, 10:53 AM ET / 14:53 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch fingerprints build inputs so test preparation can reuse unchanged compiled runtimes after source refreshes, while preserving stricter CLI, deployment, and UI E2E checks. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and the latest release lack equivalent-input runtime reuse for test preparation. No blocking introduced defect was found, and the recorded remote preparation results support the change. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's test preparation selects and prepares compiled runtime artifacts before test workers start. Build stamps connect those artifacts to source inputs and determine whether compilation or runtime synchronization is needed. flowchart TD
A[Source and compiler inputs] --> B[Build owner]
B --> C[Artifacts and verified stamps]
D[Test preparation request] --> E[Freshness admission]
C --> E
A --> E
E --> F[Reuse unchanged runtime]
E --> B
F --> G[Test workers]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +395, Other +500. Total +895 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep verified artifact reuse within the existing test-preparation owner, preserving original generation metadata and strict admission for deployment and UI consumers. Do we have a high-confidence way to reproduce the issue? Yes, from source: current-main test preparation retains HEAD-based admission, so an equivalent source snapshot with a different transport commit requests rebuilding. This review did not execute that path. Is this the best way to solve the issue? Yes. Extending the existing stamps and preparation owner avoids timestamp-only freshness shortcuts and preserves stricter consumers without creating a competing cache owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 85f09d7ea34b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Improved: test preparation reuses compatible runtimes after source refreshes and test-only edits. |
…2744) Reuse compatible test runtimes across source refreshes and test-only edits while preserving input invalidation and strict UI/deployment checks. Related: openclaw#57204.
Related: #57204
What Problem This Solves
Native test preparation repeats a full runtime build when a retained remote checkout receives a new transport commit, even when its production inputs have not changed.
User Impact
After a successful build, ordinary and private-QA tests can reuse that runtime across equivalent source refreshes and test-only corrections. Production, dependency, compiler and configuration changes still require preparation. Ordinary CLI, immutable deployment and UI E2E checks retain their stricter current-head requirements.
Why This Change Was Made
The existing build stamps now identify the effective production inputs, and only test preparation can admit an equivalent source snapshot. Reuse keeps the original build, runtime and CLI metadata together instead of relabeling old artifacts with a newer commit.
The native build owner invalidates stamps before output writes or cache restoration and verifies that inputs remained stable. Asset generation can replace its declared Control UI fields; authored manifest metadata and stylesheet inputs remain checked. Partial runtime preparation cannot satisfy a reader that requires complete static assets.
Evidence
A retained 8-CPU Crabbox received separate source synchronizations, including a real correction to test fixtures. On the final target, ordinary preparation took 1.09s and private-QA preparation took 1.02s. Neither rebuilt artifacts or changed their generation; the native cold E2E runtime prerequisite had taken 13m30s. Synchronization and dependency setup are excluded from those preparation measurements.
Production source, package source, stylesheet and authored-manifest edits each invalidated reuse. Regression coverage also checks reverted edits during a build, failed cache restoration, incomplete static assets, legacy stamps, strict CLI behavior and immutable deployments.
Remote validation passed: the applicable formatting/lint/structural, production/test type, package-boundary, security and asset checks, plus the 36-file affected batch (1,959 cases; six corrected fixture cases rerun independently). Independent source review is clean. Hosted CI passed on
146d3b694396; ClawSweeper rated that head Platinum with no code findings.Changed-test command costs on the retained Linux box (
pnpm test <file> --maxWorkers=1, including tooling preparation and runner startup):src/infra/build-stamp.test.tstest/scripts/build-all.test.tstest/scripts/prepare-vitest-runtime.test.tstest/scripts/runtime-postbuild-stamp.test.tstest/scripts/test-projects-build-admission.test.tsThe initial CI run measured
src/infra/build-stamp.test.tsat 6.40s from shard start to successful exit. Other changed files ran in grouped CI tasks without isolated file clocks. The declaration-fixture correction passed its affected canonical-group reuse case in 12.26s of native runner wall time (11.38s Vitest); Hosted Windows confirmation passed on the appended head146d3b694396.