|
| 1 | +# Handoff Spec — Deferred Work |
| 2 | + |
| 3 | +This is the scoped, mechanical work deliberately left out of v1 so it can be |
| 4 | +handed to a cheaper model (in ModelForge, Claude Code, or a Sonnet session) |
| 5 | +rather than spending premium tokens on it. v1 is complete and verified without |
| 6 | +any of the below; these are additive. |
| 7 | + |
| 8 | +## Context for the model picking this up |
| 9 | + |
| 10 | +`mastervault-mcp-server` is a TypeScript stdio MCP server that serves a |
| 11 | +"MasterVault" (a structured Obsidian-style knowledge vault) to any MCP client, |
| 12 | +without Obsidian. It has 9 tools across three tiers (protocol / files / delete). |
| 13 | +The build passes (`npm run build`), a functional harness passes 12/12 including |
| 14 | +path-traversal security tests, and an MCP stdio handshake exposes all 9 tools. |
| 15 | +Read `README.md` first, then `src/` — start at `src/index.ts`. |
| 16 | + |
| 17 | +Do not change the security model in `src/services/vault.ts` without re-running |
| 18 | +`node test-harness.mjs` and keeping all security tests green. |
| 19 | + |
| 20 | +## Task 1 — Evaluation suite (mcp-builder Phase 4) |
| 21 | + |
| 22 | +The mcp-builder skill asks for 10 evaluation questions in XML. Create |
| 23 | +`evaluations/eval.xml` with 10 `<qa_pair>` entries that test whether an LLM can |
| 24 | +use these tools to answer realistic questions about a vault. Each question must |
| 25 | +be independent, read-only, complex (multiple tool calls), realistic, verifiable |
| 26 | +(single string-comparable answer), and stable. |
| 27 | + |
| 28 | +Build a small fixture vault under `evaluations/fixture-vault/` with known |
| 29 | +content so answers are deterministic. Example question shape: "Using orient then |
| 30 | +search, what confidence value is recorded for the vault-structure seed row?" → |
| 31 | +answer a specific string. |
| 32 | + |
| 33 | +Format per the skill: |
| 34 | +```xml |
| 35 | +<evaluation> |
| 36 | + <qa_pair> |
| 37 | + <question>...</question> |
| 38 | + <answer>...</answer> |
| 39 | + </qa_pair> |
| 40 | +</evaluation> |
| 41 | +``` |
| 42 | + |
| 43 | +## Task 2 — Unit tests |
| 44 | + |
| 45 | +Convert `test-harness.mjs` into a proper test suite (node:test or vitest). Cover: |
| 46 | +- VaultService: read (with/without line range), list pagination, search, write, |
| 47 | + append, move (collision + overwrite paths). |
| 48 | +- Security: `../` traversal, absolute path, escaping move, null byte — all must |
| 49 | + throw `PathSecurityError` or stay confined. |
| 50 | +- Tool layer: patch's zero-match and multi-match rejection; log_decision |
| 51 | + section-aware append when the category heading is absent vs present; |
| 52 | + stage_delete collision suffixing. |
| 53 | +Wire it to `npm test` and a `.github/workflows/ci.yml` that runs lint + build + |
| 54 | +test on push. |
| 55 | + |
| 56 | +## Task 3 — Git read tools (v2 tool tier) |
| 57 | + |
| 58 | +Add read-only git helpers as a fourth tier, mirroring ModelForge's own set: |
| 59 | +`mastervault_git_status`, `mastervault_git_log`, `mastervault_git_diff`. All |
| 60 | +`readOnlyHint: true`. Shell out to `git -C <vaultRoot>` with argument arrays |
| 61 | +(never string interpolation — no injection surface). Guard: if the vault is not |
| 62 | +a git repo, return an actionable message, not an error. Keep `git_commit` out |
| 63 | +unless explicitly requested — writes should stay behind the existing tools. |
| 64 | + |
| 65 | +## Task 4 — Packaging niceties |
| 66 | + |
| 67 | +- Add a `LICENSE` file (MIT) to match `package.json`. |
| 68 | +- Add `.gitignore` (`node_modules/`, `dist/`, `*.log`). |
| 69 | +- Consider publishing as an npm package so the ModelForge config can use |
| 70 | + `npx -y mastervault-mcp-server <vault>` like the filesystem-server example. |
| 71 | + |
| 72 | +## Explicitly NOT in scope |
| 73 | + |
| 74 | +- No hard-delete tool, ever. |
| 75 | +- No shell/run_command tool (clients provide their own). |
| 76 | +- No streamable-HTTP transport in v1 (stdio is the target for local clients like |
| 77 | + ModelForge). Add later only if a remote/multi-client use case appears; the |
| 78 | + mcp-builder TypeScript guide has the HTTP transport pattern ready to drop in. |
0 commit comments