Skip to content

fix: private QA builds omit CLI diagnostic companions - #165200

Merged
obviyus merged 1 commit into
mainfrom
fix/private-qa-cjs-companions-165159
Oct 5, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/private-qa-cjs-companions-165159

Conversation

@obviyus

@obviyus obviyus commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • On main 5f72ae5c98f52284bdd8fabd12cabc8a2643cd23, the requested private-QA full build exited 0; the canonical closure checker exited 1 with exactly the two missing CJS companions.
  • Normal full package builds and closure checks pass before and after. With build timestamps held equal, the exact dist file-list diff is empty and both npm pack --dry-run --ignore-scripts --json lists contain the same 13,793 paths.
  • The new import-closure regression and both companion freshness cases fail on the baseline implementation. Focused runtime-postbuild, runtime-postbuild-stamp, and package-dist-imports tests pass with the fix.
  • Public npm preflight builds with OPENCLAW_CONTROL_UI_RELEASE_BUILD=1, not OPENCLAW_BUILD_PRIVATE_QA; neither npm preflight nor npm publication enables the private flag. The package build profile likewise does not enable it.
  • The same private-QA build and closure check both exit 0 with the fix.
  • Focused test command: 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.

@clawsweeper

clawsweeper Bot commented Oct 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.

@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@obviyus
obviyus marked this pull request as ready for review October 4, 2026 23:58
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 8:18 PM ET / October 5, 2026, 00:18 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: 6e22efacad50338d626bed3fbe31bee99c356a5d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant full-build evidence, regression coverage, and no blocking correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured evidence exercises the full build through the changed postbuild publisher and the canonical closure checker in an isolated Debian setup, with the two baseline failures resolved after the fix. Normal-build artifact and npm-list comparisons support the public-build boundary; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured evidence exercises the full build through the changed postbuild publisher and the canonical closure checker in an isolated Debian setup, with the two baseline failures resolved after the fix. Normal-build artifact and npm-list comparisons support the public-build boundary; no stored-data contract changes.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head patch adds conditional companion publication, required outputs, freshness inputs, and focused regression coverage. The verified test merge has the pinned base followed by the exact PR head as parents and retains the same five-path delta.
Existing owner and freshness integration: The publisher copies the canonical source files when dist/plugin-sdk/test-env.js exists. Its shared inventory also feeds required-output checks and runtime input tracking; the existing source runner consumes both checks.
Private build boundary: The compiler selects private entrypoints only with OPENCLAW_BUILD_PRIVATE_QA=1, and test-env is excluded from ordinary production entrypoints. The patch introduces no plugin API, config option, dependency, or publication-workflow change.
Findings None None.
Security None None.

How this fits together

OpenClaw'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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +60, Other +31. Total +91 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 60 0 +60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 33 2 +31
Total 5 93 2 +91

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #165159
Summary: This PR is the implementation candidate for the documented private-QA companion omission.

Members:

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

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The repair unblocks private-QA artifact validation without evidence of ordinary Gateway or channel failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured evidence exercises the full build through the changed postbuild publisher and the canonical closure checker in an isolated Debian setup, with the two baseline failures resolved after the fix. Normal-build artifact and npm-list comparisons support the public-build boundary; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured evidence exercises the full build through the changed postbuild publisher and the canonical closure checker in an isolated Debian setup, with the two baseline failures resolved after the fix. Normal-build artifact and npm-list comparisons support the public-build boundary; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch adds conditional companion publication, required outputs, freshness inputs, and focused regression coverage. The verified test merge has the pinned base followed by the exact PR head as parents and retains the same five-path delta. (scripts/runtime-postbuild.mts:225, 6e22efacad50)
  • Existing owner and freshness integration: The publisher copies the canonical source files when dist/plugin-sdk/test-env.js exists. Its shared inventory also feeds required-output checks and runtime input tracking; the existing source runner consumes both checks. (scripts/runtime-postbuild.mts:582, 6e22efacad50)
  • Private build boundary: The compiler selects private entrypoints only with OPENCLAW_BUILD_PRIVATE_QA=1, and test-env is excluded from ordinary production entrypoints. The patch introduces no plugin API, config option, dependency, or publication-workflow change. (tsdown.config.ts:328, 6e22efacad50)
  • Current main still needs the repair: Inspection at the fetched main revision shows no companion publication or companion entries in the postbuild output inventory. Comparing these production files with the PR head yields the focused repair. (scripts/runtime-postbuild.mts:229, dd09a05ce128)
  • Latest release comparison: The runtime postbuild source at v2026.9.8 has the existing required-output function but no diagnostic-companion publication. The release blob was inspected through GitHub after local release-blob hydration failed. (scripts/runtime-postbuild.mts:229, fc23bc864e45)
  • Real build and compatibility evidence: The captured PR body reports an isolated Node 24.16.0 Debian full private-QA build followed by the canonical closure checker: baseline closure failed on exactly the two companions, and both build and closure passed after the fix. Normal builds passed before and after; fixed build-identity inputs produced identical dist file lists and identical 13,793-path npm dry-run lists. The body also reports 167 focused tests passing in 5.43 seconds wall time. These are contributor observations, not reviewer execution. (6e22efacad50)

Likely related people:

  • Peter Steinberger: Raw commit 19448d8 adds src/cli/cli-process-tree.test-support.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 19448d8e1bba; files: src/cli/cli-process-tree.test-support.ts)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-05T00:02:13.931Z sha 6e22efa :: needs maintainer review before merge. :: none

@obviyus
obviyus merged commit 76922ab into main Oct 5, 2026
193 of 195 checks passed
@obviyus
obviyus deleted the fix/private-qa-cjs-companions-165159 branch October 5, 2026 00:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
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]>
Grynn added a commit to Grynn/openclaw that referenced this pull request Oct 21, 2026
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
Grynn added a commit to Grynn/openclaw that referenced this pull request Oct 21, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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]: Private-QA builds omit CLI diagnostic CommonJS companions from dist

1 participant