This document is an integration map, not a new state or context source of truth. Existing PlanGate contracts remain authoritative. Related: #1410 / #911.
Long-running agent sessions accumulate implementation discussion, tool output, superseded decisions, and repair history. Re-reading that history on every turn increases cost and can bias later decisions toward stale state.
PlanGate handles this by carrying canonical artifacts and evidence, not conversational history, across execution boundaries.
conversation / tool history
|
v
checkpoint canonical state
|
+-- decisions -> decision-log / canonical plan
+-- progress -> INDEX.md + current-state.md
+-- evidence -> evidence / report / review artifact refs
|
v
fresh session / fresh reviewer
|
v
L0 -> phase-required L1 -> L2/L3 on demand
A fresh-context transition is not a workflow reset. C-3/C-4, Plan binding, RunState, evidence, and Human-owned authority remain unchanged.
| Concern | Owner / existing contract | This policy |
|---|---|---|
| Current task position | working-context: INDEX.md + current-state.md |
reuse |
| Final executable Plan | Plan normalization / canonical plan.md (#1220) |
reuse |
| Important rationale | decision-log.jsonl / ADR |
reference, do not duplicate |
| Phase context budget | Dynamic Context Engine (#199) | reuse |
| Subagent working set | context-packager / dispatch/* |
reuse |
| Session/tool handoff | local-exec-handoff |
reuse |
| Compact-time freshness | PreCompact memory guard (#742) | reuse |
| Durable runtime state | #1025 / RunState follow-ups | reuse |
| Review evidence | River Review Review Artifact / Execution Manifest | evidence producer only |
River Review does not own execution-session memory. A River Review artifact can be referenced from PlanGate evidence, but raw review conversation is not a checkpoint payload.
For ultra-light / light tasks these triggers are optional (see §8: simple tasks do not
gain mandatory ceremony). The same rule is stated in the working-context skill.
Do not invent a provider-independent token threshold. When a runtime exposes reliable usage, it may inform the decision; otherwise use the observable triggers above.
Before leaving the current context:
INDEX.md and current-state.md with the actual phase,
completed/current work, blockers, next action, and plan deviation.local-exec-handoffcontext-packager + dispatch/*No new checkpoint.json, Context Manifest, or RunState is introduced by this policy.
Start the next context without copying the previous conversation.
INDEX.md -> current-state.md.The objective is not “small context at all costs”. The objective is the minimum sufficient, current, auditable working set.
Do not persist or mechanically replay:
Material facts, decisions, failures, and evidence must instead be represented in the existing canonical artifacts or by stable references.
Removes review-history/superseded-state noise from the executable Plan before C-3. Context
Lifecycle depends on that canonical Plan; it does not create canonical-plan.md.
The guard specification, staging script, apply script, and tests exist. Do not infer that the Human-owned PreCompact wiring is active from this document. Its enforcement status depends on the target environment’s settings / Human-applied wiring.
When the guard is actually wired, it is a safety net for stale task memory before compact. This policy defines what to do with a valid checkpoint afterward: resume from canonical artifacts rather than replaying conversation history.
Resolves phase/mode/profile context and budget. It remains the runtime context resolver. Context Lifecycle defines when to start a fresh working set, not a replacement resolver.
Owns crash-consistent runtime execution state. Working-context files remain the human/agent operational view. This policy does not add another state machine.
This policy defines the checkpoint boundary for an intentional interruption. It does not claim that workflow-conductor wait/resume integration is complete. #938 remains the owner of that operational automation/guidance until its own acceptance criteria are satisfied.
River Review provides independent review/evidence. Keeping its execution manifest free of raw context/hidden reasoning is compatible with this policy. PlanGate may retain a stable artifact/evidence reference, not the review conversation.
Agent Memory Repo のように長期記憶を Git repository として管理するパターンは、 execution checkpoint の代替ではなく、再利用可能な retained knowledge / recall aid として解釈する。履歴・merge・permissions・multi-agent sharing は有用だが、Git に 保存されたこと自体で情報の正しさや authority が上がるわけではない。
PlanGate では次の境界を維持する。
| Concern | Existing owner / SSoT | Repository-backed memory の扱い |
|---|---|---|
| Current execution position / resume | working-context / #1025 RunState | stable ref を持てるが、実行位置を上書きしない |
| Executable Plan / decisions / approvals | canonical Plan / decision-log / policy | recall のため参照できるが、承認・authority を持たない |
| Evidence / verifier result | existing evidence / verifier contracts | source として参照する。memory 上の要約だけを Evidence に昇格させない |
| Retained learning / recurring patterns | improvement-seeds / seeds-hygiene.md / #811 |
candidate / recall layer として利用可能 |
| General project / team knowledge | PlanGate の外部 knowledge surface | optional input。PlanGate の新しい SSoT にしない |
Agent Memory Repo の MEMORY.md を短い entry point / index とし、詳細を別ファイルへ
分離して link で辿る考え方は、context burden を抑える参考パターンとして採用できる。
ただし PlanGate の canonical Plan、RunState、Evidence、policy を memory repo へ複製して
同期対象を増やさない。必要な場合は stable reference と短い説明だけを保持する。
durable memory へ書く内容は、少なくとも次を満たす。
Cognition の Dreaming のような定期統合は、新しい promotion authority として導入しない。
重複・矛盾・陳腐化の整理は既存の seeds-hygiene.md(#754)を再利用し、Rule / Skill /
Hook / test / Runbook 等へ昇格する場合は #811 Memory Promotion Gate を通す。
memory consolidation の生成自体と、実行可能な behavior への promotion を分離する。
複数 agent が memory repository を共有・合成する場合、ownership / visibility / write destination を保持する。personal / team / project memory を別 repository として扱う構成では、 ある owner の preference や private context を別 owner の memory へ暗黙にコピーしない。 書き込み先が曖昧なら durable write を保留し、review / escalation へ送る。
Git merge は concurrent write を統合する transport / coordination mechanism として使える。 一方、同じ事実について意味的に競合する entry が存在する場合、textual merge の成功を truth adjudication とみなさない。source と owner scope を再確認し、解消できない競合は明示したまま review / escalation へ送る。
grep / link traversal で不足する規模になった場合、full-text / embedding / semantic index を 追加してよいが、それらは derived retrieval index とする。index の ranking や embedding 結果を canonical memory source とみなさず、最終的な判断では元 entry と source を確認する。
参考仕様は informative only であり dependency / canon ではない。upstream が示す human-in-the-loop なしの memory update も、そのまま PlanGate の canonical state 更新や behavior promotion 権限へ一般化しない。
A Context Lifecycle change is acceptable only when all are true: