Repository navigation
CAP-930: stream each conversation run's output to Keep, sealed and scrubbed - #531
Merged
Merged
Conversation
…sealed output records Every capy run in a Keep conversation sends what it wrote, scrubbed by the CAP-980 scrubber, as c2p output records, ending with the exact line the agent got. Output before the page's hello waits in the recovery file. The end record now follows the run's last output.
- a conversation's output stops at 1,000 records or 400,000 characters, so turns and the end always fit the service's caps - waiting output is scrubbed again and split after the scrub, never sent over one record - each stream keeps its own unfinished line; a run's cut lands on a line end - per-stream UTF-8 decoding and write encodings are honoured - output from before the page's hello stays in memory, never in the recovery file
…-output-stream # Conflicts: # src/commands/setupConversation.ts
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.
Linear: CAP-930 (spec 3m, "Terminal view streams the CLI's output" and "How it is built"). Builds on CAP-980 (#530), the shared scrubber.
What
capy setuprun in a Keep conversation sends what it wrote to stdout and stderr to Keep as sealed c2poutputrecords:{ v, run, seq, stream, text }. The record kind is bound in the AAD, so it is domain-separated fromturn.refusalJson/ result linesetupCommandprints), so every outcome, code and next step is visible in Keep.#k=pin) before sealing; a scrubber failure withholds the text. Whole lines only, so a value written in two pieces is still seen whole. At most 200,000 characters a run.Order
Keep must ship first (keep-app CAP-930): today's Keep refuses an unknown record kind.
Tests
tests/conversation/setupConversation.test.ts: order across runs, pending output before the hello, result line before the end, a planted fake secret never in any sealed record or in the service's store, withheld on scrubber failure, partial lines, the cap.setupCli.test.tsfails the same way onfeat/onboarding-v2(needs a build).