Repository navigation
fix: private QA builds omit CLI diagnostic companions - #165200
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. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 8:18 PM ET / October 5, 2026, 00:18 UTC (Revision 2). ClawSweeper reviewWhat this changesThe build scripts publish two CLI diagnostic companion files for private-QA builds and include them in required-output and source-freshness checks. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still omits the private-QA companions, and the focused repair has sufficient build evidence with no actionable introduced defects. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's runtime postbuild stage completes compiled artifacts before source runners and QA checks consume them. Private-QA helpers reference diagnostic files that must be copied beside their compiled chunks. flowchart TD
A[Compiled build artifacts] --> B{Private QA facade exists?}
C[Diagnostic source files] --> D[Runtime postbuild publisher]
B -->|Yes| D
B -->|No| E[Normal build output]
D --> F[Complete private QA output]
F --> G[Import closure and freshness checks]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +60, Other +31. Total +91 across 5 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep companion publication, required outputs, and freshness tracking under the existing postbuild owner, gated by the emitted private-QA facade. Do we have a high-confidence way to reproduce the issue? Yes: private-QA compilation emits helpers with relative companion references, while current main lacks their publication path. The supplied full-build and closure-check results corroborate the source; this read-only review did not execute a build. Is this the best way to solve the issue? Yes: extending the existing artifact publisher and freshness owner repairs the missing-output contract without changing diagnostic behavior or weakening validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dd09a05ce128. 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 (1 earlier review cycle)
|
With `OPENCLAW_BUILD_PRIVATE_QA=1`, the build emitted a test-env chunk that references the two CLI diagnostic CommonJS companions, but never copied them into `dist`, so `check-package-dist-imports.mjs` failed. Runtime postbuild now copies the companions only when the private-QA facade was emitted, and the run-node input-state tracker treats their sources as postbuild inputs. Proof (Docker): the private-QA build exits 0 on both. The closure check exits 1 on base (exactly the two missing companions) and 0 here. The normal build, closure check and pack exit 0 on both. A timestamp-controlled dist diff is empty, and the `npm pack --dry-run` lists match at 13,793 paths. The public publication path never enables private QA. The new cases fail on base and pass here. Fixes openclaw#165159. Co-authored-by: Ayaan Zaidi <[email protected]>
Consolidate public package exclusions, import closure, owning dependency and sealed-worker prewarm acknowledgment into one runtime-artifact unit. Keep launcher/service qualification separate so it can retire independently. Preserve the remaining packaging contract from local 2bb4268. Upstream openclaw#165200 already owns private-QA copying and build freshness; do not duplicate or change that lifecycle. Exclude cli-process-tree.test-support.cjs and cli-process-diagnostics.test-support.cjs even when a private QA build prepared them. A minimal fixture uses the actual root files list and the canonical real offline npm inventory: red includes precisely those two helpers, green retains the public dist entry and excludes private helpers. Proof: 19 inventory tests, root-scripts types, scoped typed lint, format and normal hooks. Independent P0-P2 review found no packaging defect. No affected public release or secret disclosure is claimed. fix(runtime): verify launcher closure and acknowledge worker prewarm Retain the remaining runtime-artifact behavior from fb95b73 on the current owners. Literal root-launcher import callbacks expose the real package edges while preserving direct-miss fallback and transitive-failure propagation. Exempt only the six known optional root probes, require at least one CLI entry, and retain transitive closure validation for every present module. After successful sealed-worker runtime load and compile-cache flush, emit one protocol-1 JSON acknowledgment carrying the effective fs-safe native mode. Keep current Darwin require / other-platform off policy and transport cleanup. Restore proxy-from-env 2.1.0 in both owning manifests and the AI external-dependency list; the existing Knip manifest compiler supplies ownership without a new ignore. Proof: four intended baseline failures; 55 focused package/worker/AI checks passed with two Darwin-only skips; four actual root-launcher fixture cases passed. Core, gateway-other, root-tooling and root-scripts types plus eight-file typed lint, format and line-cap checks passed. Fresh canonical independent review is clean through P2. Full product build, installed Doctor and real Darwin native validation remain deployment/CI proof gaps; no live runtime was changed. Local-Feature: packaged-runtime-integrity Semantic-Source: ef93b73, b082220 Upstream-Tracking: openclaw#161524; related openclaw#165200 Drop-When: Upstream supplies each retained packaging/import/dependency/prewarm contract; remove adopted subparts independently. Rebase-Base: ed9d493
Consolidate public package exclusions, import closure, owning dependency and sealed-worker prewarm acknowledgment into one runtime-artifact unit. Keep launcher/service qualification separate so it can retire independently. Preserve the remaining packaging contract from local 2bb4268. Upstream openclaw#165200 already owns private-QA copying and build freshness; do not duplicate or change that lifecycle. Exclude cli-process-tree.test-support.cjs and cli-process-diagnostics.test-support.cjs even when a private QA build prepared them. A minimal fixture uses the actual root files list and the canonical real offline npm inventory: red includes precisely those two helpers, green retains the public dist entry and excludes private helpers. Proof: 19 inventory tests, root-scripts types, scoped typed lint, format and normal hooks. Independent P0-P2 review found no packaging defect. No affected public release or secret disclosure is claimed. fix(runtime): verify launcher closure and acknowledge worker prewarm Retain the remaining runtime-artifact behavior from fb95b73 on the current owners. Literal root-launcher import callbacks expose the real package edges while preserving direct-miss fallback and transitive-failure propagation. Exempt only the six known optional root probes, require at least one CLI entry, and retain transitive closure validation for every present module. After successful sealed-worker runtime load and compile-cache flush, emit one protocol-1 JSON acknowledgment carrying the effective fs-safe native mode. Keep current Darwin require / other-platform off policy and transport cleanup. Restore proxy-from-env 2.1.0 in both owning manifests and the AI external-dependency list; the existing Knip manifest compiler supplies ownership without a new ignore. Proof: four intended baseline failures; 55 focused package/worker/AI checks passed with two Darwin-only skips; four actual root-launcher fixture cases passed. Core, gateway-other, root-tooling and root-scripts types plus eight-file typed lint, format and line-cap checks passed. Fresh canonical independent review is clean through P2. Full product build, installed Doctor and real Darwin native validation remain deployment/CI proof gaps; no live runtime was changed. Local-Feature: packaged-runtime-integrity Semantic-Source: ef93b73, b082220 Upstream-Tracking: openclaw#161524; related openclaw#165200 Drop-When: Upstream supplies each retained packaging/import/dependency/prewarm contract; remove adopted subparts independently. Rebase-Base: ed9d493
Fixes #165159. Thanks @Grynn for the reproduction.
What Problem This Solves
Private-QA source builds omit the CLI diagnostic CommonJS companions required by the emitted test helpers, causing the package import-closure check to fail.
User Impact
Private-QA builds can validate their complete import graph. Normal/public builds and their npm file lists remain unchanged; there is no production diagnostic behavior change.
Why This Change Was Made
The runtime postbuild owner now publishes the companions when the private test-env facade exists, includes them in required-output checks, and watches their source bytes for freshness. Normal builds continue to run these test helpers from source and emit neither companion.
No release workflows, dependencies, package files rules, or changelog changes.
Evidence
5f72ae5c98f52284bdd8fabd12cabc8a2643cd23, the requested private-QA full build exited 0; the canonical closure checker exited 1 with exactly the two missing CJS companions.npm pack --dry-run --ignore-scripts --jsonlists contain the same 13,793 paths.OPENCLAW_CONTROL_UI_RELEASE_BUILD=1, notOPENCLAW_BUILD_PRIVATE_QA; neither npm preflight nor npm publication enables the private flag. The package build profile likewise does not enable it.pnpm test test/scripts/runtime-postbuild.test.ts test/scripts/runtime-postbuild-stamp.test.ts test/scripts/check-package-dist-imports.test.ts --maxWorkers=1: 167 passing tests; 4.67 s Vitest duration, 5.43 s shard wall time. Hosted CI duration is not yet measured.Validation ran in an isolated Node 24.16.0 Debian container. An initial test-only failure caused by omitting the container's Git index was resolved by indexing the isolated source copy; no product change was made for it. Unpinned UI timestamps initially changed content-hashed filenames, so the normal-build comparison was repeated with identical build identity inputs.