Skip to main content

DEC-AIC-0065: Migrate the knowledge base to the Reasonry npm package

Accepted

Status: accepted · 2026-12-04 · supersedes DEC-AIC-0049

Context​

DEC-AIC-0049 placed the decision records in kb/ as a kb-kit / docs-mcp v3 workspace. At the time (observed: 2026-11-15), docs-mcp v3 was not published to npm, so contributors needed a private binary on PATH and CI could not run workspace checks.

The former private kb-template / docs-mcp project has now been released publicly under the MIT license as Reasonry (https://github.com/push-based/reasonry) with @push-based/reasonry@2.0.0 published on npm (observed: 2026-12-04). Reasonry v2 auto-discovers an embedded knowledge base only under <repo-root>/reasonry/ and provides reasonry migrate to upgrade legacy docs-mcp workspaces.

Decision​

  1. Move the knowledge base from kb/ to reasonry/ so @push-based/reasonry auto-discovers it from the repository root without shell wrappers. This replaces DEC-AIC-0049 Decisions 1, 6, 7, 8, and 9.
  2. Install @push-based/reasonry@^2.0.0 as a root devDependency and expose npm run kb:check (reasonry check). CI runs npm run kb:check on every push and pull request.
  3. Adopt the Reasonry v2 workspace contract via reasonry migrate: reasonry.config.json (version 3), strict prefix in initiative.json, plain document types (decision / DEC-* and question / Q-*, replacing ADR-* and RFC-*), Open Knowledge Format v0.3 wiki concepts, and the preset workspace AGENTS.md.
  4. Serve the knowledge base to agents via reasonry-keeper (npx -y @push-based/reasonry@2 serve) in .mcp.example.json, replacing the legacy ai-coach-kb shell wrapper.
  5. Keep the three small vault files adapted from kb-template in place (libs/vault/domain/src/lib/note/md.ts, libs/vault/adapter-markdown/src/lib/markdown.ts, apps/vault-mcp-server/src/mcp/tool-types.ts, and apps/vault-mcp-server/src/main.ts). Do not import @push-based/reasonry-core or @push-based/reasonry-mcp into the vault runtime: vault-domain stays dependency-free, and vault-mcp-server remains on MCP SDK v1. Update libs/vault/adapter-fs protected-root detection to recognize reasonry.config.json alongside docs-mcp.config.json.
  6. Build the docs site from reasonry/source/initiatives/ai-coach/decisions/ (DEC-AIC-NNNN) and keep /reasonry in .prettierignore.

Consequences​

  • Contributors and CI no longer need a private docs-mcp binary on PATH; npm install provides reasonry deterministically.
  • reasonry check now runs in CI on every pull request and push to main.
  • All 80 existing records were migrated from ADR-*/RFC-* to DEC-*/Q-* and kb/ links across docs, package READMEs, and apps/docs were updated.
  • The vault server keeps its small local helpers without taking on @push-based/reasonry-* runtime dependencies.

Alternatives Considered​

  • Keep the folder named kb/ with a wrapper script. Reasonry v2's plugin and CLI only auto-discover <repo-root>/reasonry/, so keeping kb/ would require custom wrappers for every command and harness.
  • Replace apps/vault-mcp-server/src/mcp/tool-types.ts with @push-based/reasonry-mcp. Pulling in @push-based/reasonry-mcp for 35 lines of types would bring @modelcontextprotocol/server v2 and @push-based/reasonry-core into a v1 MCP server.