feat(FN-1772): add backend-aware memory instruction context API

- Add MemoryBackendContext interface for backend-aware memory integration
- Implement getMemoryInstructions() method with backend-specific logic in project-memory.ts
- Add QMD memory backend type detection and instruction context for QMD-backed projects
- Update memory-plugin-contract.md with backend-variant instruction requirements (section 3.8.7)
- Update settings reference for memoryBackendType with custom backend support
- Add comprehensive regression tests for backend-variant memory instruction behavior
- Add changeset for @gsxdsm/fusion package
This commit is contained in:
gsxdsm
2026-04-13 22:03:42 -07:00
parent ce518f3b61
commit f6ae0e2e82
9 changed files with 502 additions and 18 deletions

View File

@@ -0,0 +1,10 @@
---
"@gsxdsm/fusion": patch
---
Make memory instruction injection backend-aware for the triage and executor prompts. Behavior now branches correctly based on `memoryBackendType` setting:
- `file` backend → includes `.fusion/memory.md` read/write guidance
- `readonly` backend → read-only wording without write/update directives
- `qmd`/non-file backends → generic instructions without unconditional `.fusion/memory.md` reference
The `resolveMemoryInstructionContext()` function provides backend metadata for instruction generation. Backward compatible: omitting `memoryBackendType` or using unknown types falls back to file-style output with explicit path.