You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d9395e3
Browse filesBrowse the repository at this point in the historyBrowse files
frames: C2 — live wire tier (lean): connection, have-list ledger, resume in a lazy chunk; live coverage closure
The live wire moves out of the eager frames client into the sixth lazy
tier, `@solidjs/web/frames/wire` (frames/src/wire-tier.ts → wire.js,
1,922 min / 934 br): `connect` — the per-address connection a live()
loop's response runs under (the open-frame count its end is judged by:
a death with frames open vs a completion; the join of a second loop onto
an address already live; `connection.ended` / `cancel`; the SSE reader
selection, proxied so a drained body applies nothing further), `cancel`
(supersession from `bump`), `have` / `haveOf` (the have-list ledger per
mount, RFC 11 §9.5, fed by the client's `#recordHave` at its three
sites) with `encodeHaveList` and the FRAME_HAVE_* literals bundled, and
`resume` (the ordinal + the have-list header). The eager client keeps:
`applyFrames` reading `options[LIVE_WIRE]` as its reader; `handle`'s
live arm awaiting `prepareTier("wire")` before the body is read; `onLive`
→ `prepareTier("wire")`; `resume` and `bump`'s cancel delegating through
`tierLoads.wire?.r`.
Preload-at-call: `live()`'s makeIterable fires the new optional
`responseHandler.onLive()` before the first fetch, so the import races
only the request; a non-live call never loads the tier. Accepted degraded
case: content applied before the chunk was resident kept no ledger, and
`resume` answers nothing while the tier is absent — that first connect
sends neither X-Frame-Have nor Last-Event-ID and gets a full snapshot
(the server never read the ordinal for a frame render); pinned.
Public surface: `Frame.have?()` removed from the Frame interface (the
ledger is the tier's `haveOf(frame)`); `encodeHaveList` moved from
frame-transport to the tier (@internal); `@solidjs/web/frames/wire`
export path added; `responseHandler.onLive?()` and
`ServerComponentHandler.onLive()` added. `ServerFunctionsClientConfig`
gains no key.
Pins: consistency/tier-wire-preload.spec (3) — the hook starts the import
at the call before any fetch, the arm awaits residency, X-Frame-Tiers:
wire joins the same load, a non-live call never loads the tier,
reconnect through the tier with Last-Event-ID + the have-list, the
degraded first connect. frames-live-resume re-pointed to the tier's
haveOf / encodeHaveList; frames-live / frames-live-showing warm the tier.
The coverage closure: server-functions-live-loop.spec (19, client suite)
drives live()'s loop over hand-framed chunk / SSE bodies — first-connect
failure, the fail-fast 4xx set and 408 / 425 / 429 / Retry-After, the
cursor as Last-Event-ID, the online wake, return() mid-connect /
mid-backoff / mid-seed, invoke's signal mid-stream / mid-backoff, no
global EventTarget, live(GET(fn)), the handler's local answers — `live`
per-function branch coverage (audit §2.4 method, client + hydrate) 26/59
sites (91/129 paths) on the base → 57/60 (129/132).
Size (scripts/size, this head vs the base 55eb4c3): frames eager
33,767 / 11,193 → 32,802 / 10,888 (−965 min / −305 br; cap 11.21 → 10.90
KB); page base 112,938 / 36,071 → 112,003 / 35,722 (−349 br; cap 36.09 →
35.74); page live 124,810 / 39,747 → 123,903 / 39,412 (−335 br eager; cap
39.76 → 39.43; the page loads wire.js at its first live() call — total
transfer 40,345 br, +598 against the base); non-SC scenarios 0 / 0; no
cap raised. Measured before writing on edited dist copies through the
harness's bundler: ceiling −1,432 / −472, lean −965 / −310, the carrier
≈ +467 / +162.
Suites: web client 130 / 1,218, hydrate + consistency 89 / 452, server
159 / 1,511, solid 42 / 833, types + test-types clean; harness 500 ×
{3289, 91501} SC arm 0, generic arm (CONSISTENCY_IGNORE=C1,C9,C19,E) 0.
Docs: savings plan §1 wire row built, §3 row C2 landed, §4 chunk table;
residue doc status + §7e.
Co-authored-by: Cursor <[email protected]>
frames: the live wire moves into a lazy tier (`@solidjs/web/frames/wire`, the sixth chunk). The connection a `live()` loop's response runs under — the open-frame count its end is judged by (a death with frames open vs a completion), the join of a second loop onto an address already live, the supersession cancel, `connection.ended` / `cancel` — the have-list ledger per mount with its encoder, and the resume shape (`Last-Event-ID` + `X-Frame-Have`) load with the chunk. The eager client keeps the arm that awaits the tier's residency before a live response's body is read, so a live connection without the chunk cannot happen; the chunk's import starts at the `live()` call, before its first fetch (preload-at-call, through the new optional `responseHandler.onLive()` hook the sf client fires), and a non-live call never loads it. One accepted degraded case: content applied before the chunk was resident kept no ledger, so that first connect sends no have-list (and no ordinal) and receives a full snapshot.
6
+
7
+
Public surface: `Frame.have?()` is removed from the `Frame` interface (the ledger is the tier's `haveOf(frame)`, `@internal`); `encodeHaveList` moves from `frame-transport` into the tier (`@internal`; `decodeHaveList` and the `FRAME_HAVE_*` constants stay); the `@solidjs/web/frames/wire` export path is added; `ServerFunctionsClientConfig.responseHandler` gains the optional `onLive()`; `ServerComponentHandler` gains `onLive()`.
8
+
9
+
Pins: `consistency/tier-wire-preload.spec` and `server-functions-live-loop.spec` — the latter drives `live()`'s reconnect loop from the consumer's side (first-connect failure, the fail-fast 4xx set and 408 / 425 / 429 / `Retry-After`, the cursor as `Last-Event-ID`, the `online` wake, `return()` and a caller's signal at every phase, `live(GET(fn))`, the handler's local answers), closing the loop's branch-coverage gap.
10
+
11
+
Size: frames eager −965 min / −305 br (10.89 KB); pages −349 / −335 br eager; the `wire.js` chunk 1,922 / 934 (lazy; the live page loads it at its first `live()` call). Caps ratcheted to measured + 10 B.
(−965 min / −305 br)**, against §2's −292 (arithmetic from the C2 pass's own
74
+
measurement); the carrier ≈ +467 / +162 over a −1,432 / −472 ceiling. The
75
+
coverage closure the plan tied to it: `live` 26/59 → 57/60 branch sites. See
76
+
§7e._
68
77
69
78
---
70
79
@@ -1007,6 +1016,131 @@ ended without delivering a {$ref}.`).
1007
1016
1008
1017
---
1009
1018
1019
+
## 7e. Landed — C2 (2026-10-07): the live wire tier, `lean`
1020
+
1021
+
Branch `feat/frames-wire-tier` on step 4's head (`55eb4c346`, frames eager
1022
+
**33,767 / 11,193**; page base 112,938 / 36,071; live 124,810 / 39,747).
1023
+
§2's C2 row (−292, arithmetic) and the savings plan's §3 row C2. The
1024
+
maintainer's ruling: the `lean` form, with `FRAME_HAVE_*` already off the
1025
+
entry (5a), the hook on `responseHandler.onLive` (not a config key),
1026
+
`Frame.have?()` leaving the public `Frame` interface (approved class), the
1027
+
trace update-site wait landed apart (#3861). Re-measured before writing on
1028
+
edited dist copies of the frames client and the sf client through the
1029
+
harness's bundler (`.wt-logs/c2b-edit.mjs`, `c2b-measure.mjs`) — the
1030
+
step 1–4 base had moved under the phase-1 edits (the sync loop,
1031
+
`insert`-placed fills, the table-owned pending read), so every anchor was
1032
+
re-derived; the four non-SC scenarios 0 / 0 on every row. min / br.
1033
+
1034
+
| item | measured on this head | note |
1035
+
| --- | ---: | --- |
1036
+
| the ceiling (`del`) — the wire out whole: `connections` / `hold` / the join-or-hold arm, `resume` + `encodeHaveList`, the ledger (`#have` / `have()` / `#recordHave`), `applyFrames`' connection wiring, `isEventStream` + the reader selection |**−1,432 / −472** (pages −1,404 / −483 and −1,399 / −464) | unsound alone: a live response read as a plain stream, no reconnect |
1037
+
|`lean` — the tier owns the connection, the ledger and the resume; the client keeps the await-residency arm, `onLive`, `resume` delegating, `#recordHave` forwarding through `tierLoads.wire?.r`|**−965 / −310** (pages −979 / −285 and −946 / −300) | the carrier ≈ +467 / +162 over the ceiling |
1038
+
| the hook alone (`onLive` fired by `live()`'s `makeIterable`) | ≈ 20 / 15 (page live +85 br) | the config-key form measured ≈ 45 br heavier on the pages |
1039
+
| the ledger's residue (`#recordHave` ×3 forwarding) | ≈ 112 / 27 | kept: the digests are known only to the client's apply |
1040
+
| the field residue (the record fields the ledger reads) | ≈ 106 / 14 | kept: they feed the apply too |
1041
+
|**built**|**−965 / −305 → 32,802 / 10,888**; pages **−349 / −335** → 35,722 and 39,412; **`wire.js` 1,922 / 934** (lazy, reported not counted) | +0 min / +5 br over the copy |
1042
+
1043
+
**What the tier owns** (`frames/src/wire-tier.ts` → `@solidjs/web/frames/wire`,
0 commit comments