fix(FN-2078): adopt canonical .fusion/memory paths

- Update core and engine prompt text to reference .fusion/memory/ with MEMORY.md and daily-note guidance
- Allow worktree tool boundary access to .fusion/memory/ files while preserving legacy .fusion/memory.md compatibility
- Revise memory compaction/insight extraction messaging and related type/docs comments to use canonical memory paths
- Refresh dashboard and test expectations across core/engine/dashboard/docs for the new memory path wording
This commit is contained in:
Fusion
2026-04-18 22:02:46 -07:00
committed by gsxdsm
parent 94bbca31da
commit 53cad3ba9d
18 changed files with 110 additions and 85 deletions

View File

@@ -2114,7 +2114,7 @@ describe("buildExecutionPrompt", () => {
"# test",
"## Context to Read First",
"- `/home/user/project/web/app/page.tsx`",
"- `/home/user/project/.fusion/memory.md`",
"- `/home/user/project/.fusion/memory/MEMORY.md`",
"## Steps",
"### Step 0: Preflight",
"- [ ] inspect `/home/user/project/web/app/layout.tsx`",
@@ -2130,8 +2130,8 @@ describe("buildExecutionPrompt", () => {
expect(result).toContain("/home/user/project/.worktrees/happy-robin/web/app/page.tsx");
expect(result).toContain("/home/user/project/.worktrees/happy-robin/web/app/layout.tsx");
expect(result).toContain("/home/user/project/.fusion/memory.md");
expect(result).not.toContain("/home/user/project/.worktrees/happy-robin/.fusion/memory.md");
expect(result).toContain("/home/user/project/.fusion/memory/MEMORY.md");
expect(result).not.toContain("/home/user/project/.worktrees/happy-robin/.fusion/memory/MEMORY.md");
});
it("omits attachment section when no attachments", () => {
@@ -2417,7 +2417,7 @@ describe("buildExecutionPrompt", () => {
} as any);
expect(result).toContain("Execute this task.");
expect(result).toContain("## Project Memory");
expect(result).toContain(".fusion/memory.md");
expect(result).toContain(".fusion/memory/");
});
it("excludes memory instructions when memoryEnabled: false", () => {
@@ -2434,7 +2434,7 @@ describe("buildExecutionPrompt", () => {
const result = buildExecutionPrompt(task, "/project", {} as any);
expect(result).toContain("Execute this task.");
expect(result).toContain("## Project Memory");
expect(result).toContain(".fusion/memory.md");
expect(result).toContain(".fusion/memory/");
});
it("includes selective memory write instruction for durable learnings at end of execution", () => {
@@ -2456,22 +2456,22 @@ describe("buildExecutionPrompt", () => {
const result = buildExecutionPrompt(task, "/project", {
memoryEnabled: true,
} as any);
expect(result).toContain("`.fusion/memory.md`");
expect(result).toContain(".fusion/memory/");
});
});
describe("memoryBackendType setting", () => {
it("includes .fusion/memory.md for file backend", () => {
it("includes .fusion/memory/ guidance for file backend", () => {
const task = createMockTaskDetail();
const result = buildExecutionPrompt(task, "/project", {
memoryEnabled: true,
memoryBackendType: "file",
} as any);
expect(result).toContain("## Project Memory");
// Check that the Project Memory section contains .fusion/memory.md
// Check that the Project Memory section contains .fusion/memory/ guidance
const memorySectionMatch = result.match(/## Project Memory\n([\s\S]*?)(?=\n## [^#]|$)/);
expect(memorySectionMatch).toBeTruthy();
expect(memorySectionMatch![1]).toContain(".fusion/memory.md");
expect(memorySectionMatch![1]).toContain(".fusion/memory/");
});
it("includes read-only wording for readonly backend without write directives in memory section", () => {
@@ -10620,7 +10620,7 @@ describe("buildExecutionPrompt", () => {
const prompt = buildExecutionPrompt(task, "/project");
expect(prompt).toContain(".fusion/memory.md");
expect(prompt).toContain(".fusion/memory/");
expect(prompt).toContain("memory");
expect(prompt).toContain("durable");
});