feat(runtime-host): page semantic transcript turns - #4295
Draft
Sun-GLiang wants to merge 11 commits into
Draft
Conversation
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Sun-GLiang
force-pushed
the
codex/4123-pr2-host-semantic-pager
branch
from
August 31, 2026 01:46
9d9c67d to
6044ea4
Compare
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.
Summary
Adds the first production consumer of the semantic transcript position snapshots introduced by PR #4258. Runtime Host now exposes subscription-scoped semantic position paging and complete semantic Turn windows through strict, additive protocol operations, while keeping exact Storage identities, leases, watermarks, and shared-only data private to the Host.
Refs #4123
Issue: #4123
Depends on apache/maka#4258. Do not merge or mark this PR Ready before PR1. This is an upstream cumulative Draft targeting
mainbecauseapache/makadoes not contain the fork-only PR1 base ref. It temporarily exposes the cumulative PR1 + PR2 diff. After PR1 merges, the controller must revalidate the exact resulting history and, if the project merge method requires it, explicitly authorize the rebase/update that narrows this PR to PR2-only. This delivery follows review 5060816416.issue-4123-pr2-semantic-transcript-v1.4-controller-approved-2026-08-31b00436209373c0d8453c51f1c0cbad9f53dfeb8d6044ea430df4ef45045d1c8667519e12f6e5d830apache/makamain ref observed immediately before creation:ac59b47b72cdfd63b737dac6946715789ce277c5Protocol and client surface
session.transcript.positions.queryaccepts the strictacquire | page | continue | replace | releaseunion and returnspage | building | capacity | snapshot_stale | anchor_not_found | released.session.transcript.turn_window.pageacceptsopen | continueand returnspage | building | capacity | snapshot_stale | anchor_not_found | position_too_large.{ ordinal, key }values, where the key isturn | note | empty. Storage snapshot triples, leases, projection, sequences, recovery progress, raw counts, and retained generations remain Host-private.ClientSessionSubscriptionnow providesqueryTranscriptPositions(...),loadTranscriptTurnWindow(...), anddecodeTranscriptTurnWindowPage(...). The existing fragment assembler was extracted and reused; callers receive only a complete digest- and decode-validated logical window.Retryable
buildingandcapacityresults carry only a fixed retry hint. A valid opaque handle whose internal exact snapshot is gone returnssnapshot_stale; invisible/missing anchors returnanchor_not_found; an individually oversized position returnsposition_too_largewith no fragments. Tampered/replayed inputs map toinvalid_request, access failures to non-disclosingnot_found, recovery corruption topersistence_failed, and failed replacement CAS tooperation_conflict.Lifecycle, privacy, and bounds
semanticEligibleThroughSequence; v34 subscription open performs no semantic Storage work.projectSharedSessionTranscriptMessageas the only sanitizer. Dense shared positions reveal neither hidden identities nor hidden counts; hidden records still count against Storage body limits.PR1 consumer-invariant mapping
Out of scope
No Desktop/Preload/Renderer production activation, continuous layout, navigation, export, compatibility-epoch switch, legacy-path removal, Storage schema redesign, or PR3/PR4 behavior is included. The two Desktop/CLI changes are test-fixture compile stubs only. Current Desktop does not call either operation. Any post-PR1-merge history update or narrowing remains controller-owned.
Verification
npm --workspace @maka/storage test— 1072 total, 1065 passed, 7 skipped, 0 failed.npm --workspace @maka/runtime-host test— 1449 total, 1440 passed, 9 skipped, 0 failed.npm test— all workspace tests passed on the final exact-command rerun.npm run build,npm run format:check,npm run lint,npm run typecheck— passed.npx knip --workspace apps/desktopandnpx knip --workspace packages/ui— passed.git diff --check— passed.Benchmark evidence (
npm --workspace @maka/runtime-host run benchmark:transcript, plusMAKA_TRANSCRIPT_BENCHMARK_FULL_SEMANTIC=1):position_too_large, zero fragments.Independent Standards and Spec/Composition reviews both passed the final head with no blocking or high-severity findings.
Cumulative Draft
This upstream Draft targets
mainonly becauseapache/makalacks the fork-only PR1 base ref. Its current review surface is intentionally cumulative PR1 + PR2 and depends on upstream PR #4258. It must not merge or be marked Ready before PR1. After PR1 merges, the controller must revalidate the resulting history and explicitly authorize any rebase/update required to narrow the diff to PR2-only.AI use
Select exactly one:
Tool(s) and scope: OpenAI Codex implemented the Runtime Host protocol/client/server changes, tests, benchmark coverage, and review fixes. The commit includes the required
Generated-by: OpenAI Codextrailer.Checklist
Does this PR entail a change in behavior?