Skip to content

feat: show every compaction where it happened, and while it runs - #51

Merged
benjipeng merged 1 commit into
mainfrom
feat/automatic-compaction-visible
Sep 23, 2026
Merged

benjipeng merged 1 commit into
mainfrom
feat/automatic-compaction-visible

Conversation

@benjipeng

Copy link
Copy Markdown
Contributor

What

Stage 30: a compaction shows itself whoever started it.

  • The row. Every acknowledged checkpoint is one system row where it landed: Context compacted: the conversation above continues from a summary. The agent emits ContextCompacted when it commits the checkpoint, and the journal projection emits the same event from the checkpoint entry on reopen, under one identity derived from the record, so an automatic checkpoint sits mid-turn between the message and its answer and a requested one after the last entry. /compact's transient ✓ Context compacted. note is retired; the user chose the durable row from rendered frames (CPL-4, ui-ux §transcript grammar).
  • The label. CompactionStarted / CompactionEnded are live-only events from attempt authorization and every attempt terminal, so Compacting… shows for automatic and requested compaction alike, clears on failure, cancellation and timeout, and never survives a reopen. They replace the composition root's Started report (CPL-6, COM-5).
  • Housekeeping forced by the gates. ConversationEvent::agent/agent_mut move to event_owner.rs (core was over the line sentinel), and the workspace reducer routes runtime messages and compaction events as grouped arms, as it already did for letters (function-length lint).

Live-only events take numbers in the live stream alone; a reopened or rebuilt projection restarts from its own last event, so the workspace's stream never gaps. The one test comparing a live envelope to a replayed one now compares the fact.

Stage 30's plan is consumed; the phase file and roadmap say complete. Frames: crates/plexmaton-tui/frames/compaction/ at 120/88/60, cited from the compaction evidence.

Verified

Local: cargo test --workspace --no-fail-fast 1631 passed; workspace clippy -D warnings; fmt, file length, crate graph, citations, frames, typos; scripts/smoke-tui.py. The new runtime test fails with either the live or the replayed row removed. CI not yet observed.

A checkpoint the runtime took on its own reported nothing: mid-turn, the context silently became a
summary. Every checkpoint is now one system row where it landed, "Context compacted: the conversation
above continues from a summary.", emitted when it commits and projected from its journal entry on
reopen under one identity derived from its record, so an automatic checkpoint sits between the
message that prompted it and the answer, and a requested one after the last entry. `/compact` leaves
no note of its own any more; the row says it. The user chose the durable row over that transient
note, which a reopened conversation lost, from rendered frames.

While any summarizer runs the activity line says `Compacting…`: authorizing an attempt tells the
conversation it started and every terminal tells it it ended, live only, so a reopened conversation
is never left compacting and a failed summary never leaves the label behind. This replaces the
composition root's started report for `/compact`.

ConversationEvent's owner accessors move to their own module to keep plexmaton-core under the line
sentinel, and the workspace's reducer routes runtime messages and compaction events as groups, as it
already did for letters, to stay under the function-length lint.
@benjipeng
benjipeng merged commit e2eb76b into main Sep 23, 2026
3 checks passed
@benjipeng
benjipeng deleted the feat/automatic-compaction-visible branch September 23, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant