transcripts: a session's stream as a page, and a term for keeping it #25
Loading…
Reference in a new issue
No description provided.
Delete branch "transcripts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec-bb1.27. The registry already holds every frame the server saw with its time (#8); this puts the stream on a page and removes it when its term is out.
session.Registry.Transcript(card: Info, when it began, when it stopped; and the whole stream with the time of each event) andPurge(before)(ended sessions only, with events, instructions, marks, bundle), in a new fileinternal/session/transcript.go, agreed with roomcity-b8. No schema change.chat.Transcriptrenders a stream as a room shows a session, through the same renderer with its limits lifted: tool output and permission detail whole, the owner's words in, the plan as it ended, a host-answered permission as a notice naming the option.internal/transcripts:/-/<session>HTML (markdown with raw HTML dropped, CSP allowing no script),/-/<session>/rawas one JSON message a line,/-/listing; read-only, no-store. Mounted on the page listener only; a test shows the network and runtime listeners answer 404.[server] transcript_term(default 90 days), and a loop in serve that purges hourly.Not here, and why:
go test -raceon transcripts, session, chat, serve and config passes; lint findings in the files I touched are the ones that were there.Review for spec-bb1.27, of
b7c19af.go vetandgo test -race -count=3on transcripts, session, chat, serve and config are green here. The page is safe as built: goldmark is used without its unsafe option, so raw HTML in an agent's text is dropped and ajavascript:link is refused; the folds go through the template's own escaping; the policy allows no script; it is mounted on the page's loopback listener alone, which the proxy takes whole. It is read-only and the raw stream is what the registry holds, with each frame's own time. Not merged yet; one change, and one thing to write down.1.
Purgecan take a new session's stream with the old one.It picks the names in one statement and removes each in a transaction of its own, checking
state = Endedonly in the last delete, of the row insessions:The session then has no start nudge and nothing to stage. Make the delete of the
sessionsrow, with itsstate = Ended, the first statement of the transaction, and go on only if it removed a row; with a test.2. The card is three things short of the decision, not one.
"Where transcripts are kept" gives the card the city, the agent, gc's session id, the room, when it began and ended, and how it ended. You name the room as missing. gc's session id and how the session ended are missing too, for the same reason: nothing of the registry outlives the stop but the row and the stream. I do not hold the page for it, since it needs a place in the registry that roomcity-b8 owns, but write all three on spec-bb1.27 so that the ticket is not closed with one of them remembered. I report them to specs-18.
Noted, not a change here: an always-on agent's name never ends, so its stream is never purged and its page grows with every start afresh;
Transcriptreads the whole of it into memory.b7c19affcd064cf86a47