Skip to content

Rebase fork onto cloudflare/capnweb v0.10.0 (drop fallbackCall)#5

Merged
jonastemplestein merged 0 commit into
mainfrom
rebase-0.10
Jul 17, 2026
Merged

Rebase fork onto cloudflare/capnweb v0.10.0 (drop fallbackCall)#5
jonastemplestein merged 0 commit into
mainfrom
rebase-0.10

Conversation

@jonastemplestein

@jonastemplestein jonastemplestein commented Jul 17, 2026

Copy link
Copy Markdown

What this is

This rebases the iterate capnweb fork onto the latest cloudflare/capnweb main (bc4bc45, v0.10.0). Our previous base was 3d17ba1 (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:

git push origin rebase-0.10:main --force-with-lease

(requires temporarily allowing force-push on main, or an admin push). The PR diff you see here is the full delta that lands on main: 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)

Fork commits carried (in order)

  1. Add support for sending WebSockets over RPC, as part of a fetch upgrade Response — the reason this fork exists. A Workers-style upgrade Response (with a webSocket property) can be passed over RPC, tunneled as a pair of streams (src/websocket-streams.ts, plus serialize.ts/core.ts integration and protocol.md documentation).
  2. Add a prepare script so git dependencies get a build.
  3. Add a server-side per-call RPC hookRpcSessionOptions.onCall wraps every local application function invoked by the peer, propagating through promise pipelining. Used by iterate/iterate for ITX observability (apps/os/src/itx/itx-observability.ts).
  4. Publish as @iterate-com/capnweb with pkg.pr.new and npm release CI — package rename, fork README banner, tag-driven npm release workflow, pkg.pr.new previews on main + PRs.
  5. Sync package-lock name to @iterate-com/capnweb.
  6. Remove Cloudflare-internal CI workflows from the fork (new in this rebase) — upstream added Bonk (their AI PR reviewer, needs Cloudflare AI Gateway secrets, not org-gated → every iterate PR would get a failing check) and a CLA assistant (pull_request_target → would demand Cloudflare CLA signatures from iterate contributors). Both dropped; semgrep.yml and test.yml kept — they run without secrets.

Dropped: the fallbackCall feature

The previous main carried four commits implementing an opt-in [fallbackCall] symbol for dynamic RPC paths (plus the 17k-line examples/dynamic-capabilities example). iterate/iterate has zero references to it (verified via git grep — only onCall is 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 added encodingLevel + depth-tracked evaluation (evaluateWithDepth) for limits; our fork threads a callHandler through the same constructor. Merged as constructor(importer, encodingLevel, callHandler); pipelined-call sub-evaluators pass all three. One real bug caught by test:types during the rebase: our WebSocket readable evaluation was missing upstream's new depth argument — fixed (serialize.ts:1076), so tunneled sockets participate in maxDepth enforcement.
  • RpcSessionOptions: keeps both upstream's limits and our onCall. 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: our getHookForReturn consolidation + WebSocket hook tracking (sentWebSockets, getHookForWebSocket, dispose-time socket close) replayed cleanly over upstream's stream-hook methods.
  • Workflows: kept the fork's release.yml (tag-driven npm publish with OIDC/NPM_TOKEN) and pkg-pr-new.yml (push-to-main + PRs) semantics, adopted upstream's action upgrades (checkout@v7, setup-node@v6, Node 24).
  • package.json: @iterate-com/capnweb at upstream's 0.10.0; workspace config from upstream; both prepare and prepublishOnly build. 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-run verified). npm keeps node_modules/capnweb → root as a workspace self-link, so capnweb-validate's capnweb dev/peer-dependency still resolves to this tree. Small cosmetic diff (dropped libc metadata fields) from local npm version differences.

Verification

On the final tree (macOS, local):

  • npm run build — root + capnweb-validate build 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 up timing 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 pristine upstream/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 RpcLimits depth accounting covers the WebSocket tunnel deserialization path; verified the onCall threading 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 fallbackCall work and replaying fork-only RPC and release changes on the new base.

Upstream behavior now in the tree includes capnweb-validate, receiver-side RpcLimits, 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 Response tunneling over RPC, RpcSessionOptions.onCall for server-side per-call observability (including pipelined calls), and publishing as @iterate-com/capnweb with README/install guidance, changesets pointed at iterate/capnweb, tag-driven npm release (replacing Changesets-driven Cloudflare release), pkg.pr.new previews on main/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: fail is expected and comes from the base branch. cla.yml is a pull_request_target workflow, so it runs from the current main — which still has Cloudflare's CLA assistant. This PR deletes it; the check disappears once main is updated to this branch. (This failure is itself a live demo of why the fork removes these workflows.)
  • The Test workflow can't run as a PR check here — GitHub skips pull_request workflows when it can't create a merge ref, and this PR is intentionally unmergeable (history rewrite). Instead, test.yml gained a workflow_dispatch trigger and was run manually against rebase-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).

@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


4 out of 9 committers have signed the CLA.
✅ (teamchong)[https://github.com/teamchong]
✅ (dimitropoulos)[https://github.com/dimitropoulos]
✅ (ndisidore)[https://github.com/ndisidore]
✅ (codehz)[https://github.com/codehz]
@SamJB123
@aleister1102
@taylorodell
@ttmx
@jonastemplestein
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6cd9dc8. Configure here.

@jonastemplestein
jonastemplestein merged commit 6cd9dc8 into main Jul 17, 2026
2 of 3 checks passed
@jonastemplestein

Copy link
Copy Markdown
Author

Integrated by force-pushing this branch over main (history rewrite, as described above) — main is now upstream v0.10.0 + the 6 fork commits. GitHub shows the PR as closed rather than merged because of the rewrite.

@jonastemplestein
jonastemplestein deleted the rebase-0.10 branch July 17, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant