feat(studio): protocol seam — structural decoders for the daemon wire - #969
Closed
jtenniswood wants to merge 1 commit into
Closed
feat(studio): protocol seam — structural decoders for the daemon wire#969jtenniswood wants to merge 1 commit into
jtenniswood wants to merge 1 commit into
Conversation
src/lib/protocol is the ONE typed reader of raw daemon JSON. events.ts translates the SSE stream: failed turns always surface (stop/error/ permanent), approvals are three-way, retractions withdraw their ask, delegation becomes badges, watch envelopes (ADR 0250) carry run-id stamping (ADR 0249), steer echo and media parts per ADR 0251/0252, and unknown event kinds render as visible notices, never silent drops. sessions.ts decodes the inventory capability-first (the complete-walk rule) with the debug-session exception (ADR 0254) and the permission-mode codec. schedules.ts encodes the protojson-request / stdlib-JSON-response asymmetry and the carried-spec round-trip. internal.ts holds the two-dialect helpers. Carried so the seam compiles: features/agent/types.ts (the StreamEvent union, final) and lib/file-meta.ts. The barrel and a few exports whose first consumers land with later PRs in the series stay unexported/deferred until then (knip-honest staging). ~46 decoder tests land with their modules. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Stack 4/21 — Studio: the protocol seam
src/lib/protocol/— the ONE typed reader of raw daemon JSON, landed whole and final with its full decoder test suite. No UI in this PR; it trades a demo step for keeping the Chats PR reviewable.events.ts— SSE event translation: failed turns always surface (stop/error/permanent), approvals are three-way, retractions withdraw their ask, delegation becomes badges, watch envelopes (ADR 0250) with run-id stamping (ADR 0249), steer echo + media parts (ADR 0251/0252), and unknown event kinds render as visible notices, never silent drops.sessions.ts— capability-driven session decoding (the complete-walk rule), the debug-session exception (ADR 0254), the permission-mode codec.schedules.ts— schedule decode/encode incl. the carried-spec round-trip and the wire's sharp edge: protojson requests, stdlib-JSON responses (never echo a response body back as a request).internal.ts/index.ts— the two-dialect helpers and the public surface.features/agent/types.ts(the StreamEvent union, final — landed once rather than regrown per feature PR;features/**is knip-ignored by config) andlib/file-meta.ts(+test).Pure decoders + types: no runtime behavior change, no server/proxy edits. ~46 vitest cases land with their modules (each suite is its file's knip entry).
Part of the stacked landing of #618.
🤖 Generated with Claude Code