Skip to content

Spec: persona refresh at compaction boundary #326

Closed
1 of 1 issue completed
Closed

Description

@DoodleBears

Part of #114.

Problem Statement

Persona edits never reach a running Orchestrator Session: the persona snapshot is first-write-wins for the Session's whole life. For a long-lived Orchestrator, a Human's PERSONA.md revision sits on disk indefinitely while the bot keeps speaking the old voice.

Solution

Treat compaction as the single principled refresh point. At the compaction boundary, compare on-disk PERSONA.md against the recorded snapshot; on difference only, rewrite the persona section and re-record the snapshot row. Identical content is a no-op. Verified premise: DSH compaction replaces only the history surface span and replays the system prompt verbatim to reuse prefix cache, so the refresh is a deliberate short-prefix rewrite at a moment when the absolute bill is at its local minimum - not a free ride, a discounted one.

User Stories

  1. As a Human who revised PERSONA.md, I want the new voice to take effect after the next compaction, so that long-lived bots eventually catch up without a restart.
  2. As a Human who did not touch PERSONA.md, I want compaction to change nothing about the bot's voice, so that refreshes never surprise me.
  3. As an Orchestrator agent, I want exactly one voice per Session generation, so that I never mix two personas mid-life.

Implementation Decisions

  • Refresh is a conditional rewrite plus snapshot-row re-record; the per-assembly persona lookup path is unchanged.
  • The first-write-wins invariant gains one explicit, conditional exception (compaction boundary only).
  • Trigger observation rides the existing session compaction events; no new seams.

Testing Decisions

  • Changed PERSONA.md + one compaction -> new turns use the new version and the snapshot row advances.
  • Unchanged PERSONA.md -> the snapshot row is byte-identical after compaction.
  • Rest-of-prefix invariance across the refresh.

Out of Scope

Further Notes

Amends the never-patches-a-running-session rule in ADR-0060 with one explicit exception. Mechanism detail (which compaction event to observe) is tracer-slice work, not this spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:memoryPersonaBot Memory Repository and Memory Servicescope:specNormative specification for follow-on slices

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions