feat(memory): add control plane foundation #679
No reviewers
Labels
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/platform!679
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "codex/m07-memory-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Canary status: missing - fire canary 3+3 manually before merge
Summary
Adds the first Memory Control Plane foundation: reviewed SQL migration artifact,
platformctl memoryread helpers, checkpoint hook endpoints, and tests.Closes #661
Closes #663
Refs #662
I am intentionally not closing #460/#461: those remain docs/spec verification issues unless Claude/operator confirms their AC separately. I am also not closing #662 yet because this PR adds hook endpoints and registration documentation, but does not install them into live Claude/Codex harness config.
Canary Context Pack
Product story
Codex and Claude need external task memory so future sessions can reconstruct state without transcript paste, while keeping live Postgres and runtime hooks behind explicit gates.
What changed
migrations/20260601_memory_control_plane.sqlfor task runs, checkpoints, task events, and procedure registry tables.platformctl memory brief,procedures, andcontradictions.platformctl memory hook session-start/pre-compact/post-compact/pre-tool-use.Why it changed
M07 needs concrete schema and local command surfaces before live Postgres apply or harness registration can be safely gated.
Files touched
migrations/20260601_memory_control_plane.sqlcontrol-plane/platformctl/memory.pycontrol-plane/platformctl/cli.pycontrol-plane/platformctl/tests/test_memory_control_plane.pystate/memory/hooks/README.mdRelevant context
decisions/0025-memory-control-plane.mdstate/memory/task-run-schema.mdstate/memory/procedure-registry-schema.mdstate/memory/CODEX_TASK_PACKET.mdstate/memory/CODEX_CHECKPOINT.mdstate/memory/procedures-seed-v0.mdRuntime evidence
No live Postgres migration was applied. No runtime hook was installed. Verification is local only.
Known constraints
pre-compactwrites a local checkpoint artifact when invoked; it does not connect to Postgres. Live Postgres apply remains operator-gated.Explicit out-of-scope
Requested decision
Review whether this is sufficient as the M07 local foundation and migration artifact before a later live apply gate.
Merge blockers
Spec sources read
decisions/0025-memory-control-plane.md- architecture and invariantsstate/memory/task-run-schema.md- task/checkpoint schemastate/memory/procedure-registry-schema.md- procedure registry schemastate/memory/procedures-seed-v0.md- seed proceduresstate/memory/CODEX_TASK_PACKET.md- packet contractstate/memory/CODEX_CHECKPOINT.md- checkpoint contractcontrol-plane/platformctl/cli.py- CLI conventionsValidation
uv run pytest control-plane/platformctl/tests/test_memory_control_plane.py- 10 passedPYTHONPATH=control-plane uv run --project control-plane python -m platformctl.cli memory brief --json- exit 0PYTHONPATH=control-plane uv run --project control-plane python -m platformctl.cli validate all --json- exitCode 0python3 -m py_compile control-plane/platformctl/memory.py control-plane/platformctl/cli.py- passedNotes
uvrefreshed trackedcontrol-plane/platformctl.egg-info/*files in the local worktree during validation, but those generated changes are intentionally unstaged and not part of this PR.Patchwarden PR sanity
advisory_findings679ec142d8890c72a9c476fac6ed7bd67a93bc41bc2presentDeterministic findings
No deterministic findings.
Model reviewers
global-glm/glm-5.1:cloudStatus:
okVerdict:
NOT_OKhightask_checkpoint.completed type mismatch between SQL schema and Python checkpoint writerIn migrations/20260601_memory_control_plane.sql line 89:completed text NOT NULL DEFAULT ''defines completed as scalar text. In control-plane/platformctl/memory.py line 167:"completed": completed or []writes completed as a JSON arraycompleted text NOT NULL DEFAULT ''tocompleted text[] NOT NULL DEFAULT '{}'to match the Python array format and align with changed_files/followups pattern.mediumMissing indexes on foreign key columns in migrationmigrations/20260601_memory_control_plane.sql creates tables task_run_event (task_id REFERENCES task_run), task_checkpoint (task_id REFERENCES task_run), memory_procedure_version (slug REFERENCES memory_procedure), memory_procedure_event (sllowHardcoded repo name in memory_brief outputcontrol-plane/platformctl/memory.py line 148:"repo": "pdurlej/platform"is hardcoded rather than derived from git or passed as parameter.global-deepseek/deepseek-v4-pro:cloudokOKredteam/kimi-k2.6:clouderror-Policy notes
PLATFORMCTL_PR_SANITY_REDTEAM_MODELis configured.