Status:
draft · Version 1.0 · Filed 2026-04-21prism_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.
- 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.
- 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.

