Skip to content

Validation & Metrics

Copy page

Plan Desk ships a named validation suite aligned with the RFC validation section.

Assertion IDBehaviorTest location
test:canvas_roundtripPUT 3 nodes + 2 labeled edges; GET returns identical coords + labelspackages/plandesk-api/src/routes/canvas.test.ts
test:doc_linkLink a doc to several tasks; each task’s backlinks return itpackages/plandesk-api/src/routes/documents.test.ts
test:mcp_update_taskMCP update_task → the REST read reflects the changepackages/plandesk-mcp/src/server.test.ts
test:export_importExport → import → node/edge/doc counts + content matchpackages/plandesk-db/src/portability.test.ts
test:factory_adapter_smokeMCP client with token lists ≥1 project on live serverpackages/plandesk-mcp-client/src/client.test.ts

Discover any named assertion:

Terminal window
pnpm test 2>&1 | rg 'test:(canvas_roundtrip|doc_link|mcp_update_task|export_import|factory_adapter_smoke)'
BehaviorTest location
Migration builds the final schema on a fresh DB; idempotent on re-runpackages/plandesk-db/src/migrate.test.ts
Seed works on a freshly migrated DBpackages/plandesk-db/src/migrate.test.ts
API key revoke → subsequent call returns 401packages/plandesk-api/src/better-auth-apikey.test.ts, packages/plandesk-mcp/src/server.test.ts

scripts/validate.sh boots plandesk serve on a temp data directory and ephemeral port, then runs:

Assertion IDCheck
cmd:lint_typecheckturbo run lint typecheck passes (static gate, before the server boots)
cmd:api_healthGET /api/v1/health{ "ok": true }
cmd:plandesk_serveServer responds on the chosen loopback port
cmd:mcp_list_toolsMCP session lists ≥8 tools with a bearer token

The script traps EXIT/INT/TERM and reaps the server process plus temp directory. It never touches ~/.plandesk.

Terminal window
pnpm validate
# equivalent:
bash scripts/validate.sh

Run the full gate before shipping:

Terminal window
pnpm build && pnpm test && pnpm lint && pnpm validate

Performance targets are measured with pnpm metrics (node scripts/metrics.mjs).

Measured: 2026-06-07 — darwin arm64, Apple M1 Pro, Node v22.22.2

MetricTargetMeasuredStatus
Cold start (serve spawn → first POST /projects)< 5 s419.9 ms (0.42 s)PASS
MCP list_projects + get_project p502.6 ms
MCP list_projects + get_project p95< 2 s4.9 msPASS
Export/import lossless (counts + links)losslesstrue (tasks=3, edges=2, docs=2)PASS
  • Isolated temp data dir + ephemeral loopback port; plandesk init before serve.
  • Cold start: fresh plandesk serve spawn until first successful POST /api/v1/projects.
  • MCP: Bearer token; 50 sequential list_projects + get_project pairs via Streamable HTTP MCP.
  • Live updates: the UI polls every ~2.5 s (LIVE_QUERY_POLL_MS); there is no server push stream to measure. (This snapshot predates the removal of the SSE stream.)
  • Export/import: REST fixture → CLI export → import → re-export; compare structure without IDs.