Status:
draft · Version 0.1 · Filed 2026-04-23SPEC-031 v0.1 — Session Lifecycle Refinement
Status
draft1. Summary
Two targeted enhancements to the Prism session lifecycle and controller visibility surface:-
prism_checkpoint— a new verb that performs allprism_wraphygiene (delta flush, journal, TODO status, session stats) without deregistering the caller from the controller. Solves the observed flaw where Donna wraps between build phases, vanishes from the controller, and must re-bootstrap to resume collaborative work. -
prism_statuspayload enhancements — enriches the existing read-only status verb (SPEC-030 §6.3) with project identity, session context, pending TODOs, pending nudges, and a structured agent registry so any surface can answer “who’s connected, what’s open, and what needs attention” in one call.
2. Origin
2026-04-23 session (Frank + Lola). Frank observed that when Donna finishes a discrete unit of work (e.g., shipping SPEC-030 Phase 4) and callsprism_wrap, the wrap deregisters her from the controller_registrations
table. Frank, sitting as CD master, loses visibility of Donna as a peer. To
hand her the next task, she must re-bootstrap via prism_start — a full
context-load cycle just to stay in the conversation.
Frank: “I think I over-indexed on wrap — maybe we need an interim state
that does all hygiene activities which works perfectly but wants to stay
logged in for collaboration.”
Simultaneously, Frank identified that prism_status returns raw controller
registration data but lacks the operational context a human or agent needs:
project identity, current phase, pending work items, and a clean agent
roster.
3. Enhancement 1 — prism_checkpoint verb
3.1 Problem
prism_wrap is currently atomic: hygiene + deregistration. In a
collaborative multi-agent session, an agent may want to:
- Flush session deltas (preserve context for the next agent or future self)
- Record session stats and journal
- Update TODO statuses
- Remain registered and election-eligible
- Continue accepting work from the operator
prism_wrap achieves the first three but kills the last two.
Not calling prism_wrap preserves registration but loses session hygiene —
the exact discipline gap SPEC-023 was designed to close.
3.2 Design
Split the currentprism_wrap behavior into two verbs:
prism_wrap becomes: prism_checkpoint() + deregistration. The existing
prism_wrap contract is preserved — callers who already use prism_wrap
see identical behavior. The new verb is purely additive.
3.3 Signature
3.4 delta_kind extension
SPEC-023 §6.2 defines delta_kind as: wrap | note | remember | methodology | research | other. Add checkpoint to the enum.
Checkpoints count toward wrap discipline metrics the same way wraps do —
they represent a deliberate hygiene act. The wrap_rate computation
(SPEC-023 §7) should count checkpoints as wraps for rate purposes, since
the discipline goal is “don’t leave sessions unhygiened,” not “don’t leave
sessions registered.”
3.5 prism_wrap refactor
Internally:
prism_wrap callers see no change in external behavior. The
deregistration step is identical to current behavior (set released_at,
vacate master if applicable).
3.6 Agent convention update
BIOS templates (CLAUDE.md / AGENTS.md) gain guidance:Checkpoint vs Wrap. Useprism_checkpointbetween discrete work units (shipping a spec phase, completing a build task, finishing a review) when you expect to continue working in the same session or receive follow-up tasks. Useprism_wraponly when the session is truly ending — you’re done for the day, the operator is signing off, or you’re switching to a different project.
3.7 Interaction with SPEC-029 nudges
When SPEC-029 ships,wrap_session nudge semantics need a minor update:
a prism_checkpoint with delta_kind=checkpoint should NOT auto-resolve
a wrap_session nudge — only a full prism_wrap (with deregistration)
resolves it. The nudge exists to ensure session closure, not just
hygiene. However, a checkpoint resets the staleness clock: the “last
activity” timestamp used for nudge urgency should reflect checkpoints.
4. Enhancement 2 — prism_status payload improvements
4.1 Problem
The currentprism_status response (SPEC-030 §6.3, live implementation)
returns:
- What’s the human-readable project context? (phase, status, rules state)
- What’s pending? (TODOs, nudges)
- Who’s connected and in what role? (need Agent:Project:Master triple, not raw DB rows)
4.2 Enhanced response shape
4.3 Field specifications
project — Project identity block. Always present.
pid: project identifiername: human-readable project name. Use"General Chat Session"if no project is set (covers the no-PID edge case in future general-purpose use).phase,status: from project recordrules_reminders_count: count of active rules_reminderslast_wrapped_at: from SPEC-022’slast_wrapped_atcolumn
session — Current caller’s session context. Null if the caller is not
registered on this PID (e.g., querying another project’s status).
session_id,started_at(=registered_at),is_master,agent_identity,agent_surface
agents — Flat list of all active registrations. Each entry carries the
Agent:Project:Master triple Frank specified. Replaces the split
master + peers fields with a unified list where is_master is a
boolean on each entry. Simpler to consume, no structural difference
between master and peer rendering.
pending_todos — Top N (default 5) open TODOs, ordered by most recently
created first. Gives immediate visibility into pending work without a
separate prism_todo(action=list) call. Agent can use this to proactively
surface work items.
pending_nudges — Top N (default 5) open nudges (SPEC-029). Empty array
until SPEC-029 ships. When nudges land, this field provides the same
at-a-glance visibility without a separate prism_nudge(action=list) call.
total_agents — Count of active registrations.
status_line — Pre-formatted status card string matching the SPEC-021
Ring 0 format. Agents can emit this directly without composing it from
parts.
4.4 Backward compatibility
The current response fields (pid, project, phase, caller, master,
peers, total_active) are restructured. This is acceptable because:
prism_statusis a new verb (SPEC-030 Phase 1, ~1 week old)- No external consumers exist
- The verb is explicitly
v0/ draft status - The enhancement improves every consumer’s experience
?format=v1 query param could be added.
Not recommended — clean break while the verb is young.
4.5 No-project edge case
Whenprism_status is called without a resolved PID (possible in future
general-purpose use), the response uses:
5. Implementation
5.1 Sequencing — single PR
Both enhancements are small enough for one PR:
Total: ~7h, single-day PR.
5.2 Smoke tests
Checkpoint:prism_start→prism_checkpoint→ verify registration still activeprism_start→prism_checkpoint→prism_status→ verify caller in agents listprism_start→prism_checkpoint→prism_wrap→ verify deregistered- Checkpoint delta appears in
recent_deltaswithdelta_kind=checkpoint - Checkpoint counts toward wrap_rate
- Single agent →
prism_statusreturns project block, session block, 1 agent - Status line matches expected format
- pending_todos returns top 5 open TODOs
- pending_nudges returns empty array (pre-SPEC-029)
- No-project case returns “General Chat Session” name
6. Relationships
- Extends SPEC-030 — adds
prism_checkpointalongsideprism_wrapin the session lifecycle; enrichesprism_statusresponse shape. - Extends SPEC-023 —
checkpointdelta_kind added; checkpoint counts toward wrap discipline metrics. - Prepares for SPEC-029 —
pending_nudgesfield in status; checkpoint staleness-clock interaction with nudge urgency. - Uses SPEC-022 —
last_wrapped_atsurfaced in project block.
7. Open Questions
- Q1: Should checkpoints have their own wrap_rate metric separate from wraps? Lean: no — count them together. The goal is hygiene discipline, not wrap-specifically discipline.
- Q2: Maximum
pending_todos/pending_nudgesin status response? Lean: 5 each. Configurable via query param in future if needed. - Q3: Should
prism_statusbe callable cross-project (status of PID-B from a session registered on PID-A)? Lean: yes, read-only is safe. Caller’ssessionblock would be null.
8. Acceptance Criteria
prism_checkpointperforms full hygiene without deregistering.prism_wrapbehavior unchanged for existing callers.- Checkpoint delta has
delta_kind=checkpoint. prism_statusreturns enhanced payload per §4.2.- Agents list uses flat
Agent:Project:Masterstructure. - Top-N pending TODOs included in status response.
pending_nudgesreturns empty array (ready for SPEC-029).status_linefield matches SPEC-021 format.- “General Chat Session” used when no PID is set.
- All smoke tests per §5.2 pass.

