Skip to main content
Status: draft · Version 1.0 · Filed 2026-04-21
Closes two failure modes in the current Prism session lifecycle, both inside Ring 0 Layer 4, neither addressed by SPEC-021 or SPEC-022. Failure mode 1 — Discipline gap. Agents often end sessions without calling prism_wrap. Deltas go unrecorded, decisions live only in conversation context, the next agent (or future-same-agent) has no clean handoff artifact. When users share context with collaborators or move between surfaces (CD → Claude Code, machine → machine), missing wraps force reconstruction from archaeology. Failure mode 2 — Quality gap. Even when prism_wrap is called, the summary is sometimes thin — a one-sentence “wrapped up SPEC-XYZ work” that doesn’t close the loops it claims to close. Origin. Surfaced 2026-04-20 PM during SPEC-021 implementation audit. Frank: “a wrap is good hygiene and should be done so things are done and don’t build up, it is also helps when you share context to other users.” Option 3 selected — address both discipline AND quality. Scope in. Normative expectation that prism_wrap is called at session close. Detection of unwrapped prior sessions + nudge at next prism_start. Minimum structural expectations on summaries (what happened / what’s next / open loops). Advisory agent-side discipline cues. Observability (wrap_rate counter). Scope out. Hard enforcement (breaks scripted use). Trigger content (SPEC-021 §4.4 + SPEC-022). Auto-generation of wrap summaries. Intra-session checkpointing. Key design choices.
  • §5.4 unwrapped-session detection: prior delta > 10min old AND not wrap-kind AND session was substantive (≥1 mutation verb).
  • §6.2 delta_kind column on session_deltas (rejected: prefix convention — brittle). Enum: wrap | note | remember | methodology | research | other. Also useful beyond this spec as a semantic_recall primary filter.
  • §7 observability: sessions_opened, sessions_wrapped, wrap_rate over 30-day rolling window. Advisory reminder if rate < 0.6 (tune upward to 0.8-0.9 as discipline improves).
  • Read-only sessions exempt from wrap obligation. Trivial-session exception handled via agent judgment, not hard rules.
Rejected alternatives. Hard enforcement (breaks scripts). Auto-wrap on session-start (produces artifact that looks like wrap but isn’t). Wrap summary JSON schema (kills prose quality). Reminders in every prism_start always (noisy). Open questions.
  • Q1: Session identity — mint session_id at prism_start (clean, small schema add) vs infer from delta sequence (works with current schema, fuzzy across concurrent sessions). Lean: mint.
  • Q2: 10-minute unwrapped threshold — tune based on practice.
  • Q3: wrap_rate target — 0.6 initial, aim 0.8-0.9.
  • Q4: Agent-drafted summaries (prism_wrap_draft helper verb) — defer to future spec.
  • Q5: Multi-surface sessions (CD → Claude Code on same PID) interact with Sync Master Controller. Revisit when SMC opens.
  • Q6: prism_journal vs prism_wrap overlap — keep separate in v1.
Implementation. 2-3 PRs.
  • PR 1: delta_kind column + migration (backfill existing wraps via prefix match). Optional session_id mint.
  • PR 2: Unwrapped-session detection in prism_start + rules_reminder emission.
  • PR 3: Observability counters + wrap_rate reminder. Estimate: ~1.25 days total sequenced tightly.
Relationships. Companion to SPEC-022 (independent, either can ship first). Together they close SPEC-021 Ring 0 Layer 4. ADR-24 unchanged — implementation completion of accepted architecture, no new ADR. Full spec on disk: /Users/fpn/projects/Prism/docs/specs/spec-023-v0-1-wrap-discipline-and-quality.mdx (drafted 2026-04-20 PM, Lola + Frank).
Last modified on April 22, 2026