client-core: port TranscriptSource and joinPages page-boundary healing
Closes docs/RUST.md's "client-core prerequisites for P1" box: the cache-vs-server stitching TranscriptSource.kt does, and the joinPages/healSplitMessage/adoptRun page-boundary healing TranscriptItems.kt does, both ported into client-core with no UI framework dependency. Neither Kotlin file had a JVM unit test of its own, so the port used the Kotlin source and AGENTS.md's "things that have bitten" paging incidents as the spec instead of a test-for-test transcription. Both regressions get a dedicated test: TranscriptSource::page refuses before == 0 before touching the cache or the network (loadOlderPage's incident), and adopt_run now runs on every page join rather than only the one where a split call was found (the "one run drawn as two" incident). fetch_transcript_lines (api.rs, additive) pairs each transcript line with the exact server bytes via serde_json::value::RawValue rather than re-serializing a parsed Value, so a cached line and a live SSE frame for the same event agree byte-for-byte -- the fetch_transcript_page other callers under iris/ depend on is untouched. client-core: 85 -> 109 tests. cargo test/clippy --all-targets/fmt clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
9717d1c4b0
commit
73251d6b8b
7 files changed
+995
-32
No files matched your search
+26
-6
@@ -77,12 +77,32 @@ closes it.
|
||||
touch pan from the same mechanism `List` uses, not a copy.
|
||||
- [ ] **Streaming re-layout** (IRIS_TODO.md's last section) — after the
|
||||
above, since they make the stream phase unrepresentative today.
|
||||
- [ ] **client-core prerequisites for P1, in parallel** (pure Rust,
|
||||
disjoint from `iris/`): `TranscriptSource`'s cache-vs-server
|
||||
stitching and `joinPages`/`healSplitMessage`/`adoptRun` page-boundary
|
||||
healing, per `CLIENT_CORE.md`. Ported with the Kotlin tests as the
|
||||
spec. Cheap to have ready if P0 passes, and no rendering risk if
|
||||
it does not.
|
||||
- [x] **client-core prerequisites for P1, in parallel** (pure Rust,
|
||||
disjoint from `iris/`), closed 2026-09-06: `TranscriptSource`'s
|
||||
cache-vs-server stitching (new `client-core/src/transcript_source.rs`)
|
||||
and `joinPages`/`healSplitMessage`/`adoptRun` page-boundary healing
|
||||
(new functions in `transcript_fold.rs`), per `CLIENT_CORE.md`. Ported
|
||||
against the Kotlin source and AGENTS.md's paging incidents as the
|
||||
spec (`TranscriptSource.kt`/`TranscriptItems.kt` had no JVM unit
|
||||
tests of their own to port test-for-test). `client-core` goes from
|
||||
85 to 109 tests; `cargo test`/`clippy --all-targets`/`fmt` all clean.
|
||||
Both AGENTS.md regressions have a dedicated test: `loadOlderPage`'s
|
||||
`before == 0` guard moved into `TranscriptSource::page` itself
|
||||
(`paging_before_the_first_event_makes_no_request_at_all` asserts
|
||||
zero transport calls, not just an empty result), and
|
||||
`a_clean_boundary_between_two_finished_runs_is_still_healed_into_one_run`
|
||||
pins `adopt_run` running on *every* join rather than only the
|
||||
split-call path. One incidental fix needed to port `TranscriptSource`
|
||||
faithfully: `api.rs` gained `fetch_transcript_lines` (additive, the
|
||||
existing `fetch_transcript_page` untouched since `iris/` depends on
|
||||
its signature), which pairs each event with the exact server bytes
|
||||
it came from via `serde_json::value::RawValue` rather than
|
||||
re-serializing a parsed `Value` -- needed so the cache and a live SSE
|
||||
frame agree byte-for-byte, the same class of bug as the
|
||||
`float_roundtrip` fix. Deliberately not ported: `EventStream.kt`'s
|
||||
reconnect/backoff and cross-thread stream cancellation, which are
|
||||
runtime policy for whichever framework embeds this crate, not pure
|
||||
logic -- see `CLIENT_CORE.md`'s new section for the full account.
|
||||
- **Then**: redeliver `~/host/bench/iris-bench-arm64.apk` for Iris with
|
||||
its README saying what changed, and record any choice she should see in
|
||||
`DECISIONS.md`.
|
||||
|
||||
Reference in new issue
Block a user