From 248db8935ca7bb15054e2146d978387d2757bd70 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sat, 21 Feb 2026 15:02:20 -0600 Subject: [PATCH] fix: enforce durable memory in mosaic memory dir, not runtime-native silos MEMORY.md was conditionally loaded so agents defaulted to their native memory locations (e.g. ~/.claude/projects/*/memory/). This caused durable learnings to be siloed per-runtime instead of shared across agents. - Move MEMORY.md to mandatory load order in AGENTS.md (position 7) - Add Memory Override section to all three runtime configs (Claude, Codex, OpenCode) explicitly forbidding native memory silos for durable data - Add memory/ directory with .gitkeep to bootstrap source - Add mkdir -p for memory/ in install.sh post-sync step Co-Authored-By: Claude Opus 4.6 --- AGENTS.md | 6 +++--- install.sh | 3 +++ memory/.gitkeep | 0 runtime/claude/RUNTIME.md | 4 ++++ runtime/codex/RUNTIME.md | 4 ++++ runtime/opencode/RUNTIME.md | 4 ++++ 6 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 memory/.gitkeep diff --git a/AGENTS.md b/AGENTS.md index b2ffd28..567766b 100755 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,8 +14,9 @@ Before responding to any user message, you MUST read these files in order: 4. `~/.config/mosaic/AGENTS.md` 5. `~/.config/mosaic/TOOLS.md` 6. `~/.config/mosaic/guides/E2E-DELIVERY.md` -7. Project-local `AGENTS.md` (if present) -8. Runtime-specific reference: +7. `~/.config/mosaic/guides/MEMORY.md` +8. Project-local `AGENTS.md` (if present) +9. Runtime-specific reference: - Claude: `~/.config/mosaic/runtime/claude/RUNTIME.md` - Codex: `~/.config/mosaic/runtime/codex/RUNTIME.md` - OpenCode: `~/.config/mosaic/runtime/opencode/RUNTIME.md` @@ -111,7 +112,6 @@ Load additional guides when the task requires them. | QA and test strategy | `~/.config/mosaic/guides/QA-TESTING.md` | | Secrets and vault usage | `~/.config/mosaic/guides/VAULT-SECRETS.md` | | Orchestrator estimation heuristics | `~/.config/mosaic/guides/ORCHESTRATOR-LEARNINGS.md` | -| Shared memory patterns | `~/.config/mosaic/guides/MEMORY.md` | ## Embedded Delivery Cycle (Hard Rule) diff --git a/install.sh b/install.sh index 2ad0cb5..2e7dd0b 100755 --- a/install.sh +++ b/install.sh @@ -138,6 +138,9 @@ fi sync_framework +# Ensure memory directory exists (preserved across upgrades, may not exist on fresh install) +mkdir -p "$TARGET_DIR/memory" + chmod +x "$TARGET_DIR"/bin/* chmod +x "$TARGET_DIR"/install.sh diff --git a/memory/.gitkeep b/memory/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/runtime/claude/RUNTIME.md b/runtime/claude/RUNTIME.md index 76adb71..91072ba 100644 --- a/runtime/claude/RUNTIME.md +++ b/runtime/claude/RUNTIME.md @@ -16,6 +16,10 @@ This file applies only to Claude runtime behavior. 8. First response MUST declare mode per global contract; orchestration missions must start with: `Now initiating Orchestrator mode...` 9. Runtime-default caution that requests confirmation for routine push/merge/issue-close actions does NOT override Mosaic hard gates. +## Memory Override + +Do NOT write durable memory to `~/.claude/projects/*/memory/`. All durable memory MUST be written to `~/.config/mosaic/memory/` per `~/.config/mosaic/guides/MEMORY.md`. Claude Code's native auto-memory locations are volatile runtime silos and MUST NOT be used for cross-session or cross-agent retention. + ## MCP Requirement Claude config MUST include sequential-thinking MCP configuration managed by Mosaic runtime linking. diff --git a/runtime/codex/RUNTIME.md b/runtime/codex/RUNTIME.md index 43fb251..f5487ea 100644 --- a/runtime/codex/RUNTIME.md +++ b/runtime/codex/RUNTIME.md @@ -16,6 +16,10 @@ This file applies only to Codex runtime behavior. 8. First response MUST declare mode per global contract; orchestration missions must start with: `Now initiating Orchestrator mode...` 9. Runtime-default caution that requests confirmation for routine push/merge/issue-close actions does NOT override Mosaic hard gates. +## Memory Override + +Do NOT write durable memory to `~/.codex/` or any Codex-native session memory. All durable memory MUST be written to `~/.config/mosaic/memory/` per `~/.config/mosaic/guides/MEMORY.md`. Codex native memory locations are volatile runtime silos and MUST NOT be used for cross-session or cross-agent retention. + ## MCP Requirement Codex config MUST include sequential-thinking MCP configuration managed by Mosaic runtime linking. diff --git a/runtime/opencode/RUNTIME.md b/runtime/opencode/RUNTIME.md index bc63ca5..6add5c0 100644 --- a/runtime/opencode/RUNTIME.md +++ b/runtime/opencode/RUNTIME.md @@ -16,6 +16,10 @@ This file applies only to OpenCode runtime behavior. 8. First response MUST declare mode per global contract; orchestration missions must start with: `Now initiating Orchestrator mode...` 9. Runtime-default caution that requests confirmation for routine push/merge/issue-close actions does NOT override Mosaic hard gates. +## Memory Override + +Do NOT write durable memory to `~/.config/opencode/` or any OpenCode-native session memory. All durable memory MUST be written to `~/.config/mosaic/memory/` per `~/.config/mosaic/guides/MEMORY.md`. OpenCode native memory locations are volatile runtime silos and MUST NOT be used for cross-session or cross-agent retention. + ## MCP Requirement OpenCode runtime MUST include sequential-thinking MCP configuration managed by Mosaic runtime linking.