Repository navigation
feat(core): P3 first cut — patch bodies off the wire; the flood dies at the source (#1814) - #1817
Merged
aarontrowbridge merged 1 commit intoOct 17, 2026
Conversation
…r-turn diff view fetches a patch on expand (#1778, #1814 P3) Ports main's 06eac85 onto the lane's engine, adapted to its two wire shapes: - bus/global-replay.ts: wirePayload/wireEvent strip each summary diff's patch body at serialization (the global route's frame data), while the frame's event object stays whole for in-process subscribers and storage; a sync copy is never stripped (its subscriber replays it into a store of its own that must keep the full record). - handlers/event.ts: the instance /event route (the app's stream) projects its payload view from the frame's live event, so the strip is applied there too — the lane adaptation main does not need. - session-ui: the per-turn diff view keeps the file list and counts from the live summary and fetches a patch on expand (summary-patch.ts loader, one fetch per turn shared across concurrent expands, retry on failure); the data provider takes onLoadSummaryDiffs; directory-layout supplies it from GET /session/:id/message/:messageID (the stored message is the patch source and keeps every body). - app utils/diffs: a patch-less diff (file, status, counts) is the live wire form — valid, not dropped. Flood byte report (test/server/httpapi-global-event.test.ts): a file-heavy turn (20 edit completions + two 88-file summaries, 30 KB per patch) went 5.26 MiB -> 0.02 MiB total (99.5% cut); largest frame 2,688.5 KiB -> 8.9 KiB, under the 256 KB #1803 P3 ceiling. Main's shell-output throttling (6fdcbb7) and its combined fixture-turn report (7252573) ride separate commits and stay follow-up slices. Verification (fresh materialized tree, env scrubbed): scoped new tests 22/0 (engine), 8/0 (session-ui summary-patch), 9/0 (app diffs); engine lane 4064 pass / zero NEW failures vs the measured environmental baseline; test/server 733/2 (the corpse pair), test/session 599 pass (the Instruction.system pair red, in-baseline); engine typecheck OK (#1229 base drift only); overlay typecheck: session-ui/ui/schema/sdk/llm clean, app/core errors proven pre-existing at base (6/4, byte-identical at HEAD without this change); session-ui suite 441/1 and app suite failure set byte-identical at base (the CM-theme and 22 known families); drift gate PASS (990 files).
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1814. Part of #1803 (P3's first cut).
Main's 06eac85, ported — with the lane adaptation that makes it real: the lane serves TWO wire shapes off the shared replay buffer (the global route's frame.data AND the instance /event route's payload projection — the app's actual stream). A tap-only port would have left patch bodies flowing to the app; the strip is applied at both (wirePayload in global-replay.ts + event.ts's payloadOf). Sync copies are never stripped (the workspace replica keeps full records); in-process subscribers and storage keep everything.
The numbers (the '#1814 flood byte report' lines, greppable per #1802's discipline): a 22-event file-heavy turn (88 files × 30KB patches) went from 22 frames / 5,513,795 bytes (largest 2,688.5 KiB) to 22 frames / 25,803 bytes (largest 8.9 KiB) — 99.5% of the flood bytes cut at the source, the largest frame 28× under #1803's 256 KiB ceiling, and every summary's full 88-file list still rides the wire.
The expand-time fetch: no new route — GET /session/:id/message/:messageID serves the stored message with every patch; the app's per-turn diff view fetches on expand (one shared loader per directory, retry + fresh-on-summary-change pinned).
Suites: RED recorded (15/7 → 22/0 across the new batteries); engine lane zero NEW failures vs the environmental baseline; the app suite's failure set byte-identical at base; drift PASS (990 files). Post-deploy AC (the live flood rate dropping from the ~60fps baseline on the frontdoor cadence lines) runs at the next idle window — HITL.