Skip to content

fix(qa): keep Crabline crypto available in bundled builds - #136166

Merged
steipete merged 1 commit into
mainfrom
fix/crabline-bundler-release
Sep 2, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/crabline-bundler-release

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135728

What Problem This Solves

Resolves the Crabline bundling limitation exposed by the isolated-pnpm migration. The prior PR preserved Crabline as an external package because its package-relative crypto loader could not survive bundling. The owner repair is now in Crabline 0.1.20.

Why This Change Was Made

Update the root tooling and QA Lab's exact Crabline dependency to 0.1.20, then remove the now-obsolete Crabline-specific neverBundle rule. Keep the existing dependency-boundary fixture and assert that Crabline is bundled in runtime, declaration, and worker outputs. No new root crypto dependency, loader fallback, public API, runtime configuration, or protocol change is needed.

Best-fix verdict: repair dependency loading in the package that owns it, then return the consumer to the normal bundling path. Keeping the externalization exception would retain a workaround after its cause is fixed; adding curve25519-js to OpenClaw's root would hide dependency ownership again.

User Impact

Private QA builds use the released bundle-safe Crabline package without requiring its installation directory at runtime. The source linker stays isolated. The dependency update also includes Crabline's previously released recorder-shutdown improvements.

Evidence

  • Crabline owner fix: fix: keep Crabline crypto available in bundled consumers crabline#290.
  • Its packed isolated-pnpm regression disables hoisting, bundles the public entry and crypto module, removes the installed dependency tree, and executes the relocated bundles. The original code failed with Cannot find module 'curve25519-js'; the fix passes, including native and JavaScript X25519 paths.
  • The adjusted OpenClaw configuration regression failed in four runtime/declaration cases before removing the exception; all eight selected runtime/declaration/worker/receiver cases pass afterward.
  • Directly inspected Crabline's loader, dependency exports/types, public entry, and OpenClaw's private QA callers/build ownership. Independent read-only inspection agreed that no remaining package-relative loader/native-asset contract requires the exception.
  • Crabline 0.1.20 is published. Registry latest, version, publication time, tarball bytes/SHA-512, static-import payload, and GitHub release notes were verified. Release run 33606567051 completed successfully after an unchanged stress-test retry and npm processing/read-back delay.
  • pnpm install --frozen-lockfile passes under pnpm 12.1.0. The lockfile changes only Crabline plus its required Zod 4.5.2 snapshot; all existing patch/peer identities remain unchanged.
  • Focused local proof: 75 tests passed across 4 files: test/scripts/tsdown-config.test.ts, extensions/qa-lab/src/crabline-transport.test.ts, extensions/qa-lab/src/crabline-transport-readiness.test.ts, and extensions/qa-lab/src/suite.test.ts.
  • Fresh Codex autoreview: no accepted/actionable P0 findings. This is P0-scoped, not an all-priority audit.
  • The compiled private QA runtime build passes locally (3m43s) and on a clean Linux Blacksmith Testbox (44.6s), including all 53 built control-plane module checks.
  • Linux end-to-end matrix-restart-resume passes: 1 passed, 0 failed, 0 skipped, including the gateway restart. Blacksmith Testbox tbx_01m1gk34mxhahv3ggfy38sedba, run 33607908381, completed with wrapper exit 0 and was stopped. Production files matched the candidate; the later sync also included the test-only brace cleanup.
  • Stock WhatsApp whoami QA stops before scenario execution: the harness supplies channel configuration but no linked credential fixture, and the unchanged gateway correctly skips unlinked accounts. The timeout omits linkage fields. Source inspection and 19 passing auth-store/runtime-loader tests support this diagnosis; A synthetic, test-owned linked account reaches the normal encrypted connection and Listening for WhatsApp inbound messages state on the compiled candidate. The stock whoami/restart fixtures then fail their native-JID input contracts before delivery; they are not counted as end-to-end passes. No production linkage check is weakened.
  • Exact-head CI 33609061263: the initial run reached 241 passing checks with one browser popover-visibility timeout in unchanged new-session-page.places-live.e2e.test.ts; the failed-job retry passed and the full run completed SUCCESS on exact head a9b37f3a49188984752637548358cdd9b14d3c30. No timeout or test is weakened.

Scope and upgrade considerations

The seven-day cooldown remains enabled. Two exact-version exceptions admit this explicitly requested new release and its required [email protected]; the comment specifies removal after September 10. No broad package/scope exemption or dependency override is added.

Crabline's public exports and adapter shapes are unchanged from 0.1.17. Its prior recorder fixes now drain admitted persistence during server close and initialize process/machine identity before readiness. The independent owner-boundary review found those contracts compatible with OpenClaw's synchronous observer and awaited adapter cleanup; Matrix restart proof passes; the stock WhatsApp harness setup gap is documented above.

Production build configuration removes two lines. Test coverage adds one expectation condition in the existing executable fixture; four existing single-line control statements in that fixture receive the braces required by its current lint gate. All 21 tooling tests and targeted type-aware lint pass after that formatting-only cleanup. The remaining changes are exact dependency pins, scoped cooldown entries, and lockfile metadata, not new production logic. The global changed-check classifier selects all lanes for root package/lock inputs; focused local proof and the exact-head hosted CI gates provide the proportional validation without running duplicate whole-repository local gates.

Published dependency verification

Both downloaded registry tarballs match their exact SHA-512 lockfile integrity. Zod 4.5.2 has no runtime dependencies or install lifecycle hooks. Both npm registry signatures verify against the registry signing key; its provenance subject matches the downloaded bytes and records the official colinhacks/zod release workflow at 9a193aa24b4efa3b315b91d4c56c8bc385b8513f, matching upstream v4.5.2. The package lists Colin McDonnell as maintainer and GitHub Actions as publisher. This is artifact/ownership verification, not a claim of an exhaustive dependency security audit.

The ordinary WhatsApp QA harness needs a separate synthetic-auth/native-JID fixture repair. That is recorded as a follow-up, not silently fixed by changing production authentication or relabeled as a passing scenario. The standalone package crypto/bundle regression, normal encrypted WhatsApp connection, and full Matrix gateway restart exercise the changed dependency-loading boundary.

@steipete steipete self-assigned this Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review September 2, 2026 08:30
@steipete
steipete requested a review from a team as a code owner September 2, 2026 08:30
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/qa-lab/package.json
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of @openclaw/openclaw-secops, or an OpenClaw organization member with Maintain or Admin repository access.

  • Current SHA: a9b37f3a49188984752637548358cdd9b14d3c30
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 4:36 AM ET / 08:36 UTC.

ClawSweeper review

What this changes

The PR upgrades Crabline to 0.1.20 and removes its temporary exclusion from OpenClaw’s bundled QA runtime build.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for normal maintainer review: current main still externally resolves Crabline, while this branch removes that exception and adds a matching bundling assertion. No introduced functional defect is evident, but the temporary release-age bypass for a crypto-bearing dependency needs independent dependency/supply-chain verification before merge.

Priority: P2
Reviewed head: a9b37f3a49188984752637548358cdd9b14d3c30

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is narrowly scoped and structurally consistent, but independent verification of the newly exempted published dependency remains necessary.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor real-behavior-proof gate; its supplied runtime evidence remains subject to normal dependency and build review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor real-behavior-proof gate; its supplied runtime evidence remains subject to normal dependency and build review.
Evidence reviewed 6 items Current-main behavior: The fetched current-main build configuration still lists Crabline in the external-only dependency set because its prior crypto loader required package-relative resolution; the central problem remains unfixed on main.
Introduced build change: The PR removes only the Crabline externalization entry from the shared dependency rules used by the unified runtime and declaration build configurations.
Build owner and caller: QA Lab directly imports Crabline for its local provider adapter, while the unified build applies the shared dependency rules to the runtime and declaration graphs.
Findings None None.
Security Needs attention Verify the release-age bypass before bundling: Crabline 0.1.20 and Zod 4.5.2 are exempted from the normal seven-day release-age policy. Confirm their published artifacts and ownership before accepting them into generated runtime output.

How this fits together

OpenClaw’s tsdown configuration decides which dependencies are embedded in generated QA runtime artifacts versus resolved from an installed package tree. QA Lab imports Crabline to run local channel-provider adapters, so its bundled output must retain Crabline’s crypto support after relocation.

flowchart LR
  A[QA Lab transport] --> B[Crabline dependency]
  B --> C[tsdown dependency rules]
  C --> D[Bundled QA runtime]
  D --> E[Relocated runtime execution]
  E --> F[Local channel-provider tests]
Loading

Before merge

  • Resolve security concern: Verify the release-age bypass before bundling - Crabline 0.1.20 and Zod 4.5.2 are exempted from the normal seven-day release-age policy. Confirm their published artifacts and ownership before accepting them into generated runtime output.
  • Resolve merge risk (P1) - The PR bypasses the seven-day dependency release-age policy for Crabline 0.1.20 and transitive Zod 4.5.2 while bringing the new package code into generated runtimes. Direct upstream package-source inspection was unavailable in this review, so maintainers should independently validate the published release contents and retain the documented expiry.
  • Complete next step (P2) - Independently verify the published Crabline 0.1.20 and Zod 4.5.2 artifacts and the temporary release-age exception before merge.

Findings

  • [medium] Verify the release-age bypass before bundling — pnpm-workspace.yaml:13
Agent review details

Security

Needs attention: The diff adds a short-lived exception to the dependency release-age guard for code that will be bundled into QA runtime artifacts, requiring independent package verification before merge.

PR surface

Tests +8, Config +3, Other +3. Total +14 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 12 4 +8
Docs 0 0 0 0
Config 3 5 2 +3
Generated 0 0 0 0
Other 2 13 10 +3
Total 6 30 16 +14

Review metrics

Metric Value Why it matters
Production versus test delta production build rules -2; test assertion +1; dependency-policy entries +3 The fix deletes the special-case runtime rule while adding one boundary assertion and two explicitly expiring release-age exceptions.

Merge-risk options

Maintainer options:

  1. Pause for package verification (recommended)
    Verify the published Crabline and Zod release artifacts and the temporary cooldown exemption before accepting the changed runtime-resolution boundary.
  2. Accept the documented temporary exception
    A dependency/security owner may accept the release-age exception if independent package verification confirms the stated bundle-safe loader contract.

Technical review

Best possible solution:

Keep Crabline on the normal bundled path once a dependency/security owner has verified the published 0.1.20 package and the narrowly time-bounded cooldown exception.

Do we have a high-confidence way to reproduce the issue?

No: current source proves the existing externalization and the new fixture’s intended bundled boundary, but this read-only environment could not independently execute the relocated real-package scenario.

Is this the best way to solve the issue?

Unclear: deleting the consumer workaround is the right ownership direction if Crabline 0.1.20 no longer relies on package-relative crypto resolution, but that upstream contract could not be inspected directly here.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cc6769b89216.

Labels

Label changes:

  • add P2: This is a bounded private-QA runtime packaging repair with limited user-facing blast radius.
  • add merge-risk: 🚨 compatibility: Generated QA artifacts will resolve Crabline from bundled code rather than an installed package directory.
  • add merge-risk: 🚨 security-boundary: A newly released crypto-bearing dependency and its transitive Zod version bypass the normal release-age policy.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.

Label justifications:

  • P2: This is a bounded private-QA runtime packaging repair with limited user-facing blast radius.
  • merge-risk: 🚨 compatibility: Generated QA artifacts will resolve Crabline from bundled code rather than an installed package directory.
  • merge-risk: 🚨 security-boundary: A newly released crypto-bearing dependency and its transitive Zod version bypass the normal release-age policy.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.

Evidence

Security concerns:

  • [medium] Verify the release-age bypass before bundling — pnpm-workspace.yaml:13
    Crabline 0.1.20 and Zod 4.5.2 are exempted from the normal seven-day release-age policy. Confirm their published artifacts and ownership before accepting them into generated runtime output.
    Confidence: 0.96

What I checked:

  • Current-main behavior: The fetched current-main build configuration still lists Crabline in the external-only dependency set because its prior crypto loader required package-relative resolution; the central problem remains unfixed on main. (tsdown.config.ts:299, cc6769b89216)
  • Introduced build change: The PR removes only the Crabline externalization entry from the shared dependency rules used by the unified runtime and declaration build configurations. (tsdown.config.ts:292, a9b37f3a4918)
  • Build owner and caller: QA Lab directly imports Crabline for its local provider adapter, while the unified build applies the shared dependency rules to the runtime and declaration graphs. (extensions/qa-lab/src/crabline-transport.ts:4, a9b37f3a4918)
  • Regression fixture: The existing dependency-boundary fixture builds runtime, declaration, worker, and receiver targets; the introduced condition asserts that Crabline now produces no external package imports in non-bundle-all targets. (test/scripts/tsdown-config.test.ts:531, a9b37f3a4918)
  • Resolved dependency graph: The lockfile pins Crabline 0.1.20 with an integrity hash and records its transitive curve25519-js and Zod 4.5.2 dependencies; the workspace policy explicitly exempts the two fresh versions from the seven-day cooldown through September 10. (pnpm-lock.yaml:11450, a9b37f3a4918)
  • Related merged history: The related isolated-linker PR is represented by merge commit 4675e3d and is the merged work that retained the former Crabline exception. Historical source blobs were unavailable locally, so this does not establish line-introduction provenance. (tsdown.config.ts:299, 4675e3d6dcab)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record independent verification of the published Crabline 0.1.20 and Zod 4.5.2 artifacts before merging.

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.

@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Dependency-owner verification for the reviewed head a9b37f3a49188984752637548358cdd9b14d3c30 addresses the cooldown concern:

  • Crabline 0.1.20: the owner fix is merged in Crabline #290 at ea80727af75918bfc2a6b5b0daea6f9d21e59192, and the published release records its registry integrity and successful trusted-publishing/provenance checks. I downloaded the registry tarball, matched SHA-512 to OpenClaw's lockfile, and inspected the shipped crypto module: it statically imports curve25519-js. Independent inspection found no emitted createRequire, unsafe tar paths, or lost crypto validation. Its existing prepare script is unchanged. The packed isolated-pnpm regression executes relocated public/crypto bundles after deleting the dependency installation; native and forced-JavaScript crypto paths pass.
  • Zod 4.5.2: upstream tag, npm gitHead, and the inspected provenance all identify 9a193aa24b4efa3b315b91d4c56c8bc385b8513f in colinhacks/zod. The downloaded tarball matches the lockfile and provenance subject. Both npm registry signatures verify against the registry signing key. Provenance identifies the official .github/workflows/release.yml and upstream publishing run. Independent unpacked-source inspection confirms package-local imports/exports, no runtime dependencies or installation hooks, and no unexpected network/subprocess behavior. This bounded verification is not an exhaustive dependency security audit.

The two exact-version exceptions are accepted for this explicitly requested release update; the seven-day policy remains enabled and the September 10 removal note remains. No broad scope exemption or dependency override is introduced.

Runtime evidence is now explicit in the body: macOS/Linux private builds and the full Matrix gateway-restart scenario pass. A synthetic linked WhatsApp account reaches the normal inbound-listening state through the compiled crypto path. Stock WhatsApp message scenarios have pre-existing credential/JID fixture gaps and are not represented as passing. The initial hosted run's one unrelated UI popover timeout is rerunning on the unchanged commit; no test or timeout was weakened.

@steipete
steipete merged commit cf95cb7 into main Sep 2, 2026
571 of 575 checks passed
@steipete
steipete deleted the fix/crabline-bundler-release branch September 2, 2026 08:56
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files extensions: qa-lab maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant