From 5fb0ce2d7df9a6e168b113ba35543299aa84bdb7 Mon Sep 17 00:00:00 2001 From: Lovebug MCP Date: Sun, 17 May 2026 00:40:14 +0000 Subject: [PATCH] =?UTF-8?q?mcp:=20session-notes=20=E2=80=94=20Vault=20crea?= =?UTF-8?q?te=5Fartifact=20verification=202026-05-16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...create-artifact-verification-2026-05-16.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Sources/Homelab/2026-05-17-vault-create-artifact-verification-2026-05-16.md diff --git a/Sources/Homelab/2026-05-17-vault-create-artifact-verification-2026-05-16.md b/Sources/Homelab/2026-05-17-vault-create-artifact-verification-2026-05-16.md new file mode 100644 index 0000000..2871330 --- /dev/null +++ b/Sources/Homelab/2026-05-17-vault-create-artifact-verification-2026-05-16.md @@ -0,0 +1,47 @@ +--- +created: '2026-05-17' +path: Sources/Homelab +project: postgres-consolidation-reflection-layer +tags: +- mcp +- embeddings +- automation +- pgvector +type: session-notes +--- + +## Outcome + +End-to-end verification of vault MCP create_artifact after the full diagnostic + fix chain: search_path override removed from db.py connection pool (commit 051c3ba), letting the vault_mcp role's default `wiki, public` apply naturally. Goal: confirm the dual-write lands a markdown file in the vault repo AND a row in petalbrain.wiki.artifacts AND chunked rows in petalbrain.public.embeddings. + +## Topics Covered + +The full chain of fixes for this single end-to-end write: +- Renamed mcp_server → vault_mcp package (rename worker) +- Fixed artifacts subsystem imports (rename completion worker) +- Hidden artifact tools (mistake) then re-exposed + hidden save_note shim +- Fixed create_artifact wrapper dispatch (was pointing at save_note_impl) +- Added missing HERBYLAB_DATABASE_URL env var +- Removed search_path = herbylab override in connection pool's configure hook +- Multiple container rebuilds with --no-cache to defeat image caching + +If this artifact lands successfully, six iterations of architectural debugging culminated in a working vault MCP write surface. + +## Key Learnings + +When debugging MCP integration paths, work upward through the stack systematically: +1. MCP transport (auth + tool dispatch) +2. Wrapper layer (param translation + delegation target) +3. Env config (every env var referenced by every code path) +4. Database state (schemas, roles, search_path defaults) +5. Code-level overrides (session-level SET commands, SQLAlchemy connect_args, hardcoded schema names in MetaData) + +Issues at any layer can mask issues at another. The "rebuild fixed it" theory was tempting at each step but only the layer 5 fix actually unblocked the write. + +## Follow-ons + +- [ ] Worker verifies wiki.artifacts row exists for this entry with correct schema +- [ ] Worker verifies public.embeddings has chunked rows with source_schema='wiki', source_table='artifacts' (or 'notes', depending on routing) +- [ ] Worker confirms chunk_text non-NULL and chunk_token_count ≤ 512 +- [ ] If success: vault MCP write surface considered operational end-to-end +- [ ] Address the three out-of-scope items the worker flagged: tests/conftest.py:59 search_path SET, alembic/env.py:41 SCHEMA constant, HERBYLAB_DATABASE_URL env var name \ No newline at end of file