Repository navigation
Conversation
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
90 other measured values are unchanged. Public-import reachability bundles (bytes)No changes across 123 measured values. |
trueadm
left a comment
There was a problem hiding this comment.
Approving: the change is small, it behaves the same, and it makes the bundle slightly smaller.
Correctness. In streamed-signals-protocol.ts, isStreamedRendererFrame starts by checking isStreamFrameIdentity(value.identity). The rest of what the old synthetic { identity, sequence: 0, channel: 'result', kind: 'complete' } frame was checked for is constant: isCounter(0), the complete kind, and hasOnly(RESULT_BASE_KEYS). So registerSelection (hydration/stream-result-receiver.ts:198) accepts and rejects exactly the same identities as before, and still throws StreamedReceiverError('identity') with code 253. Incoming frames still go through decodeStreamedRendererFrame's full validation. This also matches how hydration/streamed-signals.ts and server/streamed-signals.ts already validate identities.
Test. The new case "rejects a malformed selection identity before registration" (attempt: -1) checks the public boundary rather than internals, and dispose() sits in a finally. Strictly, it guards behaviour rather than catching a regression, since the old code also rejected this identity. That's appropriate for a refactor. Your note that disabling the guard makes it fail is what matters.
Numbers (benchmark on aa445d1, run 38755664888):
- All 64 work counters are unchanged.
wayfinder_jsis −55 raw, −18 gzip and −42 brotli. The other 90 application values and all 123 reachability values are unchanged.- All 20 paired timings are within noise.
CI on the current head is fully green: 30 pass, 6 skipped matrix placeholders.
Reviewed with Claude Code
Summary
Validate a streamed selection's identity directly at registration. The old path fabricated a complete result frame solely to reach the same identity validator; real incoming frames still undergo full protocol validation.
Validation
pnpm format:check(scoped format check passed)pnpm typecheck(scoped typecheck passed)pnpm test(full workspace suite not run locally)registerSelectionruns once per selection; the change removes a temporary frame object and checks of constant frame fields, with no new hot fields, DOM work, or scheduling. The matched production public-entry fixture changed 62,055→62,000 raw and 19,570→19,553 gzip bytes. Browser latency and a complete consumer bundle were not measured.Risk / follow-ups
The bundle result is a public-entry fixture, not a complete application bundle. Current-head CI provides broader coverage.
Provenance
agent-authored)Codex task · host
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Narrows registration validation to the identity helper without changing result/placement receive paths; regression test covers the public boundary.
Overview
registerSelectionnow validates streamed selection identities withisStreamFrameIdentityinstead of building a syntheticcompleteresult frame and running it throughisStreamedRendererFrame. Incoming frames onreceiveare unchanged and still get full protocol checks.A regression test rejects malformed identities (e.g. negative
attempt) before registration, withdisposein afinallyblock. Octane patch changeset added.Reviewed by Cursor Bugbot for commit aa445d1. Bugbot is set up for automated code reviews on this repo. Configure here.