Repository navigation
feat(rpc): structured value codec and payload accounting for the compact consumer (S03b-1b-I-a, part of #4272) - #4385
Merged
Merged
Conversation
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
… scalars (part of #4272)
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.
Part of #4272. S03b-1b-I-a: structured value codec, typed write error, text-ownership helpers and structural-payload accounting (R3.C6.4 substrate), behind the OFF-by-default compact-updates flag. Stacked on #4378 (S03b-1a).
Rulings: RULING-26/26a, RULING-34 (+ the bugwatch split order: codec first, no production caller yet, guarded; wired by S03b-1b-I-b). Exact resident membership unchanged (RULING-34 option a).
S03b-1b-I-a: bounded structured-value substrate
Part of #4272. Local commit:
889849b243af9b4e0fc5f950c9151b9c92364e25.Base:
ccdc83b013c253a9a01c568ef0bda99e0dc1b7fa.No push. Author and committer: YeonGyu-Kim code.yeon.gyu@gmail.com.
Scope and ordering
This is the approved codec-first split.
CompactValueshas no productioncaller at this head. S03b-1b-I-b wires it into the real settled index and removes
4272-structured-value-codec-test-only.test.tsin that same increment.The guard derives the codec's exported entry-point names and scans production
source for references, including aliases, namespace/module references, and
values stored without a call. A scratch production module importing
CompactValues as DeferredCodecand exportingDeferredCodecmade the guardfail. Removing that scratch module made the exact-head suite pass.
Structured values use bounded field/array descriptors and string chunks, with
shared immutable ownership. Structural payload residency, spilled bytes, and
pinned-only bytes are separate from text payload accounting. Spill scheduling
coalesces current leaf IDs instead of accumulating one job per replacement.
Failed descriptor merges release their temporary owners.
The two #4378 LOWs are included: append roots grow only when a subtree is full;
oversized
createLeafcalls throw a write-sideCompactWriteError.Exact resident membership remains unchanged at this head. The real consumer
rejects duplicate settled starts and unknown status/removal operations without
advancing its sequence or changing its storage state. The compact rollout stays
OFF.
RED and GREEN
4272-text-root-height.test.ts4272-bounded-text-roots.test.tswrite-error caseCompactReadError(size_limit)instead ofCompactWriteError(size_limit); exit 1.4272-structured-value-codec-test-only.test.tscompact-codec-guard-probe.ts; exit 1.4272-structured-value-codec.test.ts4272-compact-exact-membership.test.tsIndependent verification
The commit was checked out into a fresh detached worktree with an independent
bun install --ignore-scripts --frozen-lockfile, exit 0. No dependency tree fromthe later index worktree was linked into it.
nice -n 10 bun run build4272-, compact-store, and structured-sink suitesno-sync-in-session-path.test.tsbun run checkrpc-drive.mjs --self-testorigin/feat/4272-s03b1-storage-substrate, labelno-changelogs03b1b-Ia.mdmust be renamed to<pr-number>.mdonce assigned.The configured Husky launcher was absent in the supplied checkout; no hook was
bypassed. The full checks above were run explicitly, including in the independent
checkout. LSP diagnostics intermittently timed out; compiler and static gates
passed.
The detached verification worktree was removed after its receipts were retained.
Read-back confirmed that both the directory and its Git worktree registration
were absent.
Formatted production size
305 added pure production LOC. Counts exclude blank/comment-only lines and
include formatted structural lines.
compact-values.tscompact-content-store.tscompact-text-roots.tscompact-spool-storage.tscompact-storage-io.tsChanged test files: bounded text roots 172, root height 27, codec 65, exact
membership 51, staging guard 20 pure LOC. Every source/test file is <=250.
Contract boundary and next increment
This supplies the value/ownership portion of RULING-26 Q3 and keeps the sequential,
OFF-gated delivery required by RULING-26a and RULING-34. The persistent index,
oversized-row integration, bounded-memory collection proof, peak-resident-page
assertion, and production codec caller belong to S03b-1b-I-b.
Remaining active/settled component migration and RULING-33's live membership,
epoch high-water rejection, and cold-operation path remain S03b-1b-II. Q1/Q2/Q4
remain with the later reducer/lane integration. S07b still owns old-display-reader
parity and replay removal.
No change is claimed for sequential compatibility text reads or retirement
waiting for in-flight reads without a deadline. Resident text/ownership headers
remain counted; this is not a constant-RSS claim.