The MCP tool manage_adr writes/reads ADRs as files at <root>/.codebase-memory/adr.md. The HTTP UI's /api/adr endpoints read/write SQLite via cbm_store_adr_get / cbm_store_adr_store. Writes via either interface are invisible to the other.
Reproduction (v0.6.0, macOS arm64):
# write via CLI
codebase-memory-mcp cli manage_adr '{"project":"<name>","mode":"update","content":"## PURPOSE\ntest\n"}'
# CLI roundtrips
codebase-memory-mcp cli manage_adr '{"project":"<name>","mode":"get"}' # -> returns content
cat <repo>/.codebase-memory/adr.md # -> content present
# UI endpoint
curl http://localhost:9749/api/adr?project=<name> # -> {"has_adr": false}
The UI's + ADR button stays + ADR because hasAdr comes from that /api/adr response (graph-ui/src/components/StatsTab.tsx:111).
Code pointers:
src/mcp/mcp.c:3498-3555 — handle_manage_adr, file-backed at <root>/.codebase-memory/adr.md.
src/ui/http_server.c:449-559 — handle_adr_get / handle_adr_save, SQLite-backed via cbm_store_adr_* (src/store/store.c:4537,4560).
Expected: one canonical backend. The file-on-disk path is likely the right target since it's committable and lives with the repo; the SQLite-backed UI handlers would need to switch to reading/writing the file.
Impact: ADRs created by agents via MCP don't surface in the graph UI. ADRs created by humans in the UI aren't readable by agents.
The MCP tool
manage_adrwrites/reads ADRs as files at<root>/.codebase-memory/adr.md. The HTTP UI's/api/adrendpoints read/write SQLite viacbm_store_adr_get/cbm_store_adr_store. Writes via either interface are invisible to the other.Reproduction (v0.6.0, macOS arm64):
The UI's
+ ADRbutton stays+ ADRbecausehasAdrcomes from that/api/adrresponse (graph-ui/src/components/StatsTab.tsx:111).Code pointers:
src/mcp/mcp.c:3498-3555—handle_manage_adr, file-backed at<root>/.codebase-memory/adr.md.src/ui/http_server.c:449-559—handle_adr_get/handle_adr_save, SQLite-backed viacbm_store_adr_*(src/store/store.c:4537,4560).Expected: one canonical backend. The file-on-disk path is likely the right target since it's committable and lives with the repo; the SQLite-backed UI handlers would need to switch to reading/writing the file.
Impact: ADRs created by agents via MCP don't surface in the graph UI. ADRs created by humans in the UI aren't readable by agents.