docs(decisions): ADR-0025 Memory Control Plane — boundaries before code [#459] #620

Merged
pdurlej merged 1 commit from claude/m07/adr-0025-memory-control-plane into main 2026-05-30 01:37:37 +02:00
Collaborator

Canary status: docs-only ADR, proposed for review. No runtime mutation.

Canary Context Pack

Product story

The cross-cousin flow loop (Iskra → claude → Codex → rescue → follow-ups) loses state at every handoff. The operator's reframe (2026-05-24) settled that a rich memory schema is for LLM consumption, not operator maintenance — agents maintain invariants, the operator sees only output. Two independent consults (GPT-5.5 Pro 2026-05-24; Oracle context-stack report 2026-05-30) converged: the biggest lever is explicit task memory + session-lifecycle enforcement, not another retrieval tool. This ADR sets the boundaries before any schema is built.

What changed

  • Adds decisions/0025-memory-control-plane.md (status: Proposed).

What it decides

  • Thin Memory Control Plane over main Postgres (pg16), focused on L5–L7; Honcho stays canonical L2–L4; open-loops.json canonical for promises; Forgejo / ADR / state/ canonical for operational truth.
  • Read-path router (query type → store) to prevent random retrieval.
  • Invariants: trust hierarchy (an agent claim never silently overwrites an operator/repo fact — it opens a contradiction candidate), no-overwrite (valid_from / invalid_at), no secrets in memory (refs not values, per ADR-0024).
  • Lifecycle enforcement via hooks (SessionStart / PreCompact / PostCompact / PreToolUse) — instructions get ignored, hooks execute. Converts "agent forgot what it was doing" from a hope into a guarantee.
  • Measurement schema in task_run (Opik-style) so adoption is measured, not vibed.
  • Per-cousin tiered profiles; Postgres targeting rationale; explicit NOT-doing list (no AGE-first, no auto-promote, no fact overwrite, no raw CoT, no Honcho-as-only-truth).

Why

Boundaries-before-code for Milestone 07. Implementation follows in #460 (task_run + checkpoints) and #461 (procedural registry).

Evidence

No runtime mutation. Docs-only. Tier: Medium per ADR-0007.

Out of scope

  • No schema / table creation (that is #460 / #461).
  • No hook implementation (follow-up after this ADR lands).

Tracks #459. Relates to #460, #461. Full strategy: state/strategy/memory-control-plane-2026-05-24.md.

Canary status: docs-only ADR, proposed for review. No runtime mutation. ## Canary Context Pack ### Product story The cross-cousin flow loop (Iskra → claude → Codex → rescue → follow-ups) loses state at every handoff. The operator's reframe (2026-05-24) settled that a rich memory schema is **for LLM consumption, not operator maintenance** — agents maintain invariants, the operator sees only output. Two independent consults (GPT-5.5 Pro 2026-05-24; Oracle context-stack report 2026-05-30) converged: the biggest lever is **explicit task memory + session-lifecycle enforcement**, not another retrieval tool. This ADR sets the boundaries before any schema is built. ### What changed - Adds `decisions/0025-memory-control-plane.md` (status: Proposed). ### What it decides - Thin **Memory Control Plane** over main Postgres (pg16), focused on L5–L7; Honcho stays canonical L2–L4; `open-loops.json` canonical for promises; Forgejo / ADR / `state/` canonical for operational truth. - **Read-path router** (query type → store) to prevent random retrieval. - **Invariants**: trust hierarchy (an agent claim never silently overwrites an operator/repo fact — it opens a contradiction candidate), no-overwrite (`valid_from` / `invalid_at`), no secrets in memory (refs not values, per ADR-0024). - **Lifecycle enforcement via hooks** (SessionStart / PreCompact / PostCompact / PreToolUse) — instructions get ignored, hooks execute. Converts "agent forgot what it was doing" from a hope into a guarantee. - **Measurement schema** in `task_run` (Opik-style) so adoption is measured, not vibed. - Per-cousin tiered profiles; Postgres targeting rationale; explicit NOT-doing list (no AGE-first, no auto-promote, no fact overwrite, no raw CoT, no Honcho-as-only-truth). ### Why Boundaries-before-code for Milestone 07. Implementation follows in #460 (`task_run` + checkpoints) and #461 (procedural registry). ### Evidence No runtime mutation. Docs-only. Tier: Medium per ADR-0007. ### Out of scope - No schema / table creation (that is #460 / #461). - No hook implementation (follow-up after this ADR lands). Tracks #459. Relates to #460, #461. Full strategy: `state/strategy/memory-control-plane-2026-05-24.md`.
docs(decisions): ADR-0025 Memory Control Plane (boundaries before code) [#459]
All checks were successful
canary-required / collect-diff (pull_request) Successful in 4s
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 4s
base-is-main / guard (pull_request) Successful in 1s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 4s
canary-required / canary (pull_request) Successful in 14s
patchwarden-client-dry-run / dry-run (pull_request) Successful in 21s
patchwarden-pr-sanity / sanity (pull_request) Successful in 3m3s
31bff8ae84
pdurlej deleted branch claude/m07/adr-0025-memory-control-plane 2026-05-30 01:37:37 +02:00
Collaborator

Patchwarden PR sanity

  • Status: advisory_findings
  • PR: 620
  • Commit: 31bff8ae845291ba32d14be1d34f5fa1afd92736
  • Security-sensitive label: missing
  • Authority: advisory model review plus deterministic blockers only
  • 3+3 canary: still alive; this does not replace it

Deterministic findings

  • info sensitive-path-touched Sensitive path touched — decisions/0025-memory-control-plane.md
    • Evidence: decisions/0025-memory-control-plane.md
    • Next: Route through the existing 3+3/risk-tier process; model review remains advisory.

Model reviewers

global-glm / glm-5.1:cloud

  • Status: ok

  • Verdict: ABSTAIN

  • medium reviewer output unparseable

    • Evidence: no valid JSON object found in response
    • Next: investigate provider response; possibly increase max_tokens or retry

global-deepseek / deepseek-v4-pro:cloud

  • Status: ok
  • Verdict: OK
  • Findings: none

redteam / kimi-k2.6:cloud

  • Status: ok

  • Verdict: NOT_OK

  • blocker Trust hierarchy bypass via unauthenticated asserted_by

    • Evidence: decisions/0025-memory-control-plane.md: The invariants section defines a trust hierarchy (operator-confirmed > repo/ADR-derived > tool-observed > cousin-inferred > reviewer-suspected) and states it is 'Encoded as memory_claim.status enu
    • Next: Amend the ADR to require that asserted_by is bound to the writer's authenticated identity (e.g., signed claims, RLS, or harness-enforced identity) and cannot be self-reported before schema implementation in #460.
  • high Measurement schema contradicts no-secrets invariant via rescue_prompts

    • Evidence: decisions/0025-memory-control-plane.md: The context section describes rescue as the operator pasting '2–3 serie rozmów' (raw conversation transcripts). The task_runmeasurement schema explicitly includes arescue_prompts field with no d
    • Next: Constrain rescue_prompts to non-sensitive metadata only (e.g., integer count or token sum) or explicitly mandate a secret-scrubbing pipeline per ADR-0024 before any persistence.

Policy notes

  • GLM 5.1 + DeepSeek V4 Pro are the operator-required model mix for this bot.
  • Optional red-team model is enabled only when PLATFORMCTL_PR_SANITY_REDTEAM_MODEL is configured.
  • Auto-merge is not enabled here.
<!-- patchwarden-pr-sanity:pdurlej/platform:PR-620 --> # Patchwarden PR sanity - Status: `advisory_findings` - PR: `620` - Commit: `31bff8ae845291ba32d14be1d34f5fa1afd92736` - Security-sensitive label: `missing` - Authority: advisory model review plus deterministic blockers only - 3+3 canary: still alive; this does not replace it ## Deterministic findings - **`info` `sensitive-path-touched`** Sensitive path touched — `decisions/0025-memory-control-plane.md` - Evidence: `decisions/0025-memory-control-plane.md` - Next: Route through the existing 3+3/risk-tier process; model review remains advisory. ## Model reviewers ### `global-glm` / `glm-5.1:cloud` - Status: `ok` - Verdict: `ABSTAIN` - **`medium`** reviewer output unparseable - Evidence: `no valid JSON object found in response` - Next: investigate provider response; possibly increase max_tokens or retry ### `global-deepseek` / `deepseek-v4-pro:cloud` - Status: `ok` - Verdict: `OK` - Findings: none ### `redteam` / `kimi-k2.6:cloud` - Status: `ok` - Verdict: `NOT_OK` - **`blocker`** Trust hierarchy bypass via unauthenticated asserted_by - Evidence: `decisions/0025-memory-control-plane.md: The invariants section defines a trust hierarchy (`operator-confirmed > repo/ADR-derived > tool-observed > cousin-inferred > reviewer-suspected`) and states it is 'Encoded as `memory_claim.status` enu` - Next: Amend the ADR to require that `asserted_by` is bound to the writer's authenticated identity (e.g., signed claims, RLS, or harness-enforced identity) and cannot be self-reported before schema implementation in #460. - **`high`** Measurement schema contradicts no-secrets invariant via rescue_prompts - Evidence: `decisions/0025-memory-control-plane.md: The context section describes rescue as the operator pasting '2–3 serie rozmów' (raw conversation transcripts). The `task_run` measurement schema explicitly includes a `rescue_prompts` field with no d` - Next: Constrain `rescue_prompts` to non-sensitive metadata only (e.g., integer count or token sum) or explicitly mandate a secret-scrubbing pipeline per ADR-0024 before any persistence. ## Policy notes - GLM 5.1 + DeepSeek V4 Pro are the operator-required model mix for this bot. - Optional red-team model is enabled only when `PLATFORMCTL_PR_SANITY_REDTEAM_MODEL` is configured. - Auto-merge is not enabled here.
Sign in to join this conversation.
No reviewers
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform!620
No description provided.