Rebase fork onto cloudflare/capnweb v0.10.0 (drop fallbackCall)#5
Conversation
|
I have read the CLA Document and I hereby sign the CLA 4 out of 9 committers have signed the CLA. |
6005fc8 to
6cd9dc8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6cd9dc8. Configure here.
| run: npx tsx .github/version-script.ts | ||
|
|
||
| - run: npm publish --tag beta | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
There was a problem hiding this comment.
OIDC publish blocked by token env
Medium Severity
The release job sets registry-url on setup-node and always exports NODE_AUTH_TOKEN from secrets.NPM_TOKEN. When trusted publishing is configured and no NPM_TOKEN secret exists, that empty token often prevents npm from using OIDC, so npm publish --provenance fails despite the workflow comment preferring OIDC.
Reviewed by Cursor Bugbot for commit 6cd9dc8. Configure here.
| - run: npm ci | ||
| # we explicitly run here because changesets might not be running the build step https://github.com/changesets/changesets/issues/860#issuecomment-1316398728 | ||
| - run: npm run build | ||
| - run: npm test |
There was a problem hiding this comment.
Release gate runs flaky suite
Medium Severity
Tag-triggered releases now run the full npm test suite before publish. The PR notes a WebKit-only, parallel-load timeout in an upstream writable-stream test that can fail intermittently on the same tree, so release workflows may abort without publishing even when the artifact is otherwise validated.
Reviewed by Cursor Bugbot for commit 6cd9dc8. Configure here.
|
Integrated by force-pushing this branch over |


What this is
This rebases the iterate capnweb fork onto the latest
cloudflare/capnwebmain (bc4bc45, v0.10.0). Our previous base was3d17ba1(v0.8.1 era, ~27 upstream commits behind).Because this is a rebase, the branch shares no commits with the current
main— GitHub will report merge conflicts, and that is expected. Do not merge via the UI. After approval, integrate with:(requires temporarily allowing force-push on
main, or an admin push). The PR diff you see here is the full delta that lands onmain: everything upstream shipped since our old base, plus our fork commits replayed on top.What we pick up from upstream (0.8.1 → 0.10.0)
capnweb-validate(Add capnweb-validate RPC validators cloudflare/capnweb#169, fix(validate): support decorated classes extending decorated classes cloudflare/capnweb#194, Skip validation for fetch and connect lifecycle methods on WorkerEntrypoint and DurableObject. cloudflare/capnweb#197): new workspace package — build-time TypeScript transform that generates runtime validators for RPC targets. The repo is now an npm workspace (root +packages/*).bigintvalues can cause CPU exhaustion cloudflare/capnweb#184/Add receiver-side resource limits for untrusted peers (#184) cloudflare/capnweb#185):RpcLimits(maxBigIntDigits,maxDepth,maxMessageSize) guard against resource-exhaustion from untrusted peers; configurable viaRpcSessionOptions.limits.jsonCompatible/jsonCompatibleWithBytes/structuredClonablevalues instead of JSON strings (RpcTransportWithCustomEncoding).Fork commits carried (in order)
Response(with awebSocketproperty) can be passed over RPC, tunneled as a pair of streams (src/websocket-streams.ts, plusserialize.ts/core.tsintegration andprotocol.mddocumentation).RpcSessionOptions.onCallwraps every local application function invoked by the peer, propagating through promise pipelining. Used byiterate/iteratefor ITX observability (apps/os/src/itx/itx-observability.ts).@iterate-com/capnwebwith pkg.pr.new and npm release CI — package rename, fork README banner, tag-driven npm release workflow, pkg.pr.new previews on main + PRs.@iterate-com/capnweb.pull_request_target→ would demand Cloudflare CLA signatures from iterate contributors). Both dropped;semgrep.ymlandtest.ymlkept — they run without secrets.Dropped: the
fallbackCallfeatureThe previous
maincarried four commits implementing an opt-in[fallbackCall]symbol for dynamic RPC paths (plus the 17k-lineexamples/dynamic-capabilitiesexample).iterate/iteratehas zero references to it (verified viagit grep— onlyonCallis used), so per Jonas it is dropped rather than rebased. It remains recoverable from the old main history if ever needed.Notable conflict resolutions / merge decisions
Evaluator(serialize.ts): upstream addedencodingLevel+ depth-tracked evaluation (evaluateWithDepth) for limits; our fork threads acallHandlerthrough the same constructor. Merged asconstructor(importer, encodingLevel, callHandler); pipelined-call sub-evaluators pass all three. One real bug caught bytest:typesduring the rebase: our WebSocketreadableevaluation was missing upstream's newdepthargument — fixed (serialize.ts:1076), so tunneled sockets participate inmaxDepthenforcement.RpcSessionOptions: keeps both upstream'slimitsand ouronCall. The hook is threaded into the two call-evaluation sites (push+ batch) only — resolution/reject/abort evaluation paths intentionally don't get it, matching the original fork design.core.ts: ourgetHookForReturnconsolidation + WebSocket hook tracking (sentWebSockets,getHookForWebSocket, dispose-time socket close) replayed cleanly over upstream's stream-hook methods.release.yml(tag-driven npm publish with OIDC/NPM_TOKEN) andpkg-pr-new.yml(push-to-main + PRs) semantics, adopted upstream's action upgrades (checkout@v7,setup-node@v6, Node 24).package.json:@iterate-com/capnwebat upstream's 0.10.0; workspace config from upstream; bothprepareandprepublishOnlybuild. README fork banner updated to reference 0.10.0.package-lock.json: took upstream's lock and regenerated the name fields (npm install+npm ci --dry-runverified). npm keepsnode_modules/capnweb → rootas a workspace self-link, socapnweb-validate'scapnwebdev/peer-dependency still resolves to this tree. Small cosmetic diff (droppedlibcmetadata fields) from local npm version differences.Verification
On the final tree (macOS, local):
npm run build— root +capnweb-validatebuild clean.npm test(vitest: node, workerd, Chromium, Firefox, WebKit) — 1216/1217 pass.npm run test:bun— 16/16 pass.npm run test:types— clean.The one failure is
WritableStream over RPC > applies backpressure when window fills uptiming out on WebKit only, only under full-suite parallel load — it passes standalone (3/3 runs). This is an upstream flake, not introduced by the rebase: it reproduces identically on a pristineupstream/main(bc4bc45) worktree on the same machine (1 green run, then the same WebKit timeout). Upstream's Linux CI container presumably has different timing.Additional review performed after the rebase: verified all five upstream correctness fixes (cloudflare#190) touch regions the fork doesn't modify and survive intact; verified
RpcLimitsdepth accounting covers the WebSocket tunnel deserialization path; verified theonCallthreading sites match the original fork design; fixed a stale changeset/README references to 0.8.x.🤖 Generated with Claude Code
Note
Medium Risk
Touches core RPC serialization, session handling, and capability lifecycle (including new WebSocket tunneling), so wire compatibility and resource-limit behavior matter; risk is mitigated by broad new tests and upstream security fixes, but integration is a full rebase intended for force-push to
main.Overview
Rebases the iterate fork onto upstream capnweb v0.10.0, dropping the unused
fallbackCallwork and replaying fork-only RPC and release changes on the new base.Upstream behavior now in the tree includes
capnweb-validate, receiver-sideRpcLimits, custom transport encoding levels, ArrayBuffer/typed-array wire support, broader stream chunk typing, stream stub lifecycle fixes, and hardened error/abort/WebSocket-close handling — with large test additions (limits.test.ts,session-battery, transport encoding cases, deserialization regressions).Fork deltas add WebSocket upgrade
Responsetunneling over RPC,RpcSessionOptions.onCallfor server-side per-call observability (including pipelined calls), and publishing as@iterate-com/capnwebwith README/install guidance, changesets pointed atiterate/capnweb, tag-driven npm release (replacing Changesets-driven Cloudflare release), pkg.pr.new previews onmain/PRs, and removal of Cloudflare-only CLA/Bonk CI. Tooling/docs shift CI to Node 24, refresh the worker-react example around@validateRpc()/validateStub(), and add Bonk agent/reviewer config for this repo.Reviewed by Cursor Bugbot for commit 6cd9dc8. Bugbot is set up for automated code reviews on this repo. Configure here.
CI status on this PR — read this before judging the checks
CLAssistant: failis expected and comes from the base branch.cla.ymlis apull_request_targetworkflow, so it runs from the currentmain— which still has Cloudflare's CLA assistant. This PR deletes it; the check disappears oncemainis updated to this branch. (This failure is itself a live demo of why the fork removes these workflows.)Testworkflow can't run as a PR check here — GitHub skipspull_requestworkflows when it can't create a merge ref, and this PR is intentionally unmergeable (history rewrite). Instead,test.ymlgained aworkflow_dispatchtrigger and was run manually againstrebase-0.10; see the Actions tab for the run on this branch (full suite: vitest across Node/workerd/Chromium/Firefox/WebKit, Bun tests, type tests).