Skip to content

No guard on direct edits to PRINCIPAL_MEMORY.md / DA_MEMORY.md #2351

Open

Description

@henrique-franze

What happens
A session edited PRINCIPAL_MEMORY.md directly with the Edit tool. That edit skipped everything MemorySystem enforces: the 256-char entry cap (the edited entry went past it), the write log, and the pre-write snapshot. Nothing flagged it.

Why
MEMORY/KNOWLEDGE has hooks/KnowledgeWriteGuard.hook.ts (advisory, PostToolUse) pointing writers back to the canonical writer. The two hot-layer memory files have no equivalent, and the self-healing doctrine doesn't say they belong to MemorySystem, so "fix the system" reads as "edit the file".

Proposed fix
A MemoryWriteGuard hook on PreToolUse (Write | Edit | MultiEdit) for those two paths. It should block, or at least warn, and point to MemorySystem.add / set. Blocking seems justified here, unlike KNOWLEDGE, because the canonical writer is a single call and a bad hot-layer entry is loaded into every turn.

A one-line note in RULES/SelfHealing.md routing memory corrections through MemorySystem would close the doctrine side.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions