Repository navigation
refactor(scripts): share planning and validation cores - #168994
Conversation
Consolidate localization collection, build and release dispatch, Docker argument forwarding, benchmark sampling, and CI classification while preserving outputs and variant policies. Replace two source-bound assertions with the existing captured-argument boundary.
|
🦞👀 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. What this changesThis PR shares script planning, localization, packaging, validation, and benchmark mechanics while preserving existing behavior. Example: Run the Docker harness with OPENCLAW_LIVE_CODEX_HARNESS_IMAGE_PROBE empty.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this PR open: the consolidation has clear maintenance value, and source review found no actionable introduced defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherRepository scripts consume source inventories, build options, environment settings, and GitHub evidence to produce commands, packages, localization artifacts, and validation summaries. flowchart TD
A[Source and operator inputs] --> B[Script entrypoints]
B --> C[Shared planning and validation]
C --> D[Build and package tools]
C --> E[Docker execution]
C --> F[Localization artifacts]
C --> G[Release evidence summaries]
Technical reviewBest possible solution: Retain the shared cores and explicit variant policies, then land through the existing CI gate. Do we have a high-confidence way to reproduce the issue? This PR addresses duplicated maintenance logic rather than a reported product bug; the pinned diff directly establishes the repeated implementations. Is this the best way to solve the issue? Sharing mechanics within existing owners is appropriate because ordering, validation, variant settings, and cleanup remain explicit. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7943ae59280f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +69, Other -500. Total -431 across 26 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 4:11 AM ET / 08:11 UTC (Revision 2). |
Share repeated localization, CI and Docker planning, packaging, build, and validation mechanics behind explicit variant parameters. Remove 500 net production lines while preserving commands, output, selection order, timing budgets, and cleanup behavior. Replace internal scheduler source-spelling assertions with exact generated-command and captured-argument assertions in existing test cases. Keep the PR tooling import closure and concurrent deslop work untouched. Validation: independent review; localization and CI/Docker differential comparisons; all 997 script test files exercised with local failures retained in the PR evidence; focused base/head comparisons; current-head changed checks, affected-module tests, suppression checks, and zero-cycle checks. Hosted CI passes on the exact published head.
First-parent upstream c96fac1..d9eba8a (10 PRs: openclaw#168948 GitHub connection authority to workers, openclaw#168975, openclaw#168772 cron receipt custody removal, openclaw#169012, openclaw#169006, openclaw#169009, openclaw#168283 test batch d042, openclaw#168994, openclaw#168964, openclaw#168855 approval/placement state in workers). Conflicts: - docs/reference/database-schemas/worker-access-inventory.md: took upstream, then regenerated (db:worker-inventory:gen, 633 files / 2449 calls) instead of hand-merging. - src/agents/embedded-agent-runner/compact-reasons.test.ts: upstream openclaw#168283 deleted low-value cases; kept upstream's file plus our own additions only (unknown_model, empty reason, closed-union check and the isCompactionSkipCode block). session-reset-service.ts auto-merged: upstream's awaited placement retirement (assertCurrent) is disjoint from our continuation-cancellation cleanup reason. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Consolidates repeated planning, packaging, localization, and validation mechanics in the scripts helper library and its adjacent entrypoints.
User Impact
No user-visible change. Features, CLI flags, configuration, protocol and persisted shapes, output text, test selection, timing budgets, and cleanup behavior remain unchanged.
Why This Change Was Made
The first scripts-library pass (#168331) removed 862 production lines. This second pass revisits its rejected and partial candidates, then follows the same owners into adjacent entrypoints. Shared code now carries the source context, ordered classification rules, per-variant command settings, and admitted result state instead of repeating them at each caller.
Net production reduction: 500 lines across 22 source files (578 added / 1,078 deleted). Four existing test files add 69 net lines while replacing source-text checks with captured Docker arguments and exact generated rerun commands. Tests and proof artifacts are excluded from the production total. This uses the explicitly authorized 500–999-line exception with the coverage log below; the 3% target was not reached.
No new dependencies, suppressions, schema/config/protocol changes, SDK exports, or changelog edits. Native translation bytes and locale ownership are unchanged. The removed private helpers have no retained parallel implementation.
Evidence
Candidate:
34b31e9638f81d77e86f282d5cadc34b427d64a7, based ona8a349b15b20240d387770378072c2ca51889596. Both rebases were conflict-free;git range-diffreports all three reviewed patches identical. The last integration incorporates upstream build-input and declaration-receipt owner changes in two touched files. Initial differential comparisons used757d73980426df41869314a063b17fc847b36511.38036917444.test/scriptsplan were exercised across three invocations. Two invocations stopped admission on unreleased nested resource claims; both namespaces and claims were preserved, no remaining users were observed, and subsequent native runs covered only the missing files. The directory result is not green: the combined logs contain 377 observed failed cases in 57 files. No assertions, skips, timeouts, retry policy, or resource guards were weakened.node scripts/check-changed.mjspasses after the final integration, including script types, all four root-test type graphs, dead-export scans, formatting, and lint. Both cycle checks pass with zero cycles. Focused tests of the two upstream-overlapped build modules pass, as does the exact standalone suppression command (3 cases). The focused wrapper finished in 106.53s; the suppression wrapper finished in 8.40s.Coverage and measured changes
The initial lane audit covered all 378 eligible scripts-library modules. The continuation reread the earlier rejected/partial candidates, checked intervening source changes, and examined adjacent owners. The final boundary inventory contains 388 eligible library modules after intervening main changes. The refreshed PR-tooling closure contains 11,072 paths, of which 150 are protected scripts. The 13 open deslop PRs, including the heartbeat exclusion, contribute 2,747 distinct paths. None overlap this change.
Per-file source changes:
scripts/android-app-i18n.tsscripts/native-app-i18n.tsscripts/bench-gateway-restart.tsscripts/bench-gateway-startup.tsscripts/lib/gateway-bench-probes.tsscripts/lib/mock-factory-scan.mtsscripts/build-all.mtsscripts/check-extension-package-tsc-boundary.mtsscripts/ci-build-manifest.mjsscripts/generate-npm-package-lock.mtsscripts/package-openclaw-for-docker.mtsscripts/tsdown-build.mtsscripts/lib/ci-node-test-plan.mtsscripts/lib/docker-e2e-container.shscripts/lib/docker-e2e-scenarios.mtsscripts/lib/live-docker-auth.shscripts/test-docker-all.mtsscripts/test-live-cli-backend-docker.shscripts/test-live-codex-harness-docker.shscripts/release-candidate-checklist.mtsscripts/release-ci-summary.mjsscripts/npm-prepared-bundle.mjsNegative rows are the shared implementations that replace larger duplicated callers.
Retained candidates include the CI policy-watch grouping (the previous actual prototype saved only one line), distinct process-capture/streaming runners, source custody and restore barriers, frozen publication identities, native parser differences, compiler resource/lifecycle boundaries, and mock-Gateway fixture data. These encode real differences or would add more indirection than they remove. No source-text compression or removal of proof scenarios contributes to the reduction.
Re-evaluated files retained unchanged
These are the earlier rejected/partial candidates and adjacent owners read again during this continuation. The changed-file table above records the implemented candidates; the initial lane audit covered all 378 eligible library modules. No claim is made that every current library module was reread during this second pass.
scripts/apple-app-i18n.tsscripts/lib/docker-e2e-image.shscripts/lib/docker-e2e-logs.shscripts/lib/live-docker-stage.shscripts/test-live-models-docker.shscripts/test-live-gateway-models-docker.shscripts/test-live-subagent-announce-docker.shscripts/lib/ci-policy-test-watch.mtsscripts/test-live-acp-bind-docker.shscripts/ci-pr-fail-fast.mjsscripts/ci-known-main-red.mjsscripts/ci-check-plan.mtsscripts/lib/ci-static-check-evidence.mjsscripts/lib/ci-node-test-evidence.mjsscripts/lib/plugin-npm-runtime-build.mtsscripts/lib/plugin-npm-package-manifest.mtsscripts/lib/extension-boundary-projects.mtsscripts/lib/extension-boundary-inputs.mtsscripts/check-extension-plugin-sdk-boundary.mtsscripts/lib/vitest-worker-compiler.mtsscripts/lib/tsdown-declaration-generator-inputs.mtsscripts/profile-extension-memory.mtsscripts/profile-tsgo.mtsscripts/full-release-artifacts.mjsscripts/plugin-publication-artifact.mjsscripts/full-release-publication-contract.mjsscripts/frv-publication-status.mtsscripts/release-plan-producer.mtsscripts/release-plan-producer-core.mtsscripts/bench-cli-startup.tsscripts/bench-sqlite-state.tsscripts/bench-worker-runtime.tsscripts/bench-workspace-computation.tsscripts/bench-worker-transcript-commit.tsscripts/bench-session-history.tsscripts/bench-plugin-invocation.tsscripts/bench-plugin-stream.tsscripts/lib/benchmark-harness.mtsscripts/bench-agent-concurrency.tsscripts/bench-agent-concurrency-runtime.mtsscripts/bench-agent-concurrency-worker.tsscripts/bench-web-fetch.tsscripts/bench-usage-refresh-memory.tsscripts/bench-session-manager-hydration-memory.tsscripts/bench-test-changed.mtsscripts/bench-gateway-control-ui-proof.tsscripts/bench-model.tsscripts/bench-agent-database-holds.tsscripts/bench-session-manager-write-hold.tsscripts/bench-redaction-prefilters.tsscripts/bench-session-paths.tsscripts/bench-write-diff.tsscripts/bench-worker-runtime.worker.tsscripts/control-ui-mock-dev.ts