Session handoff for vault
What was implemented (high level)
Discovery-first read surfaces for attachment and analysis categories across MCP resources and REST.
Canonical rule:
attachment.purposeis spec-facing;attachment.typeis legacy compatibility only.analysis.typeunchanged.Query layer: distinct values for attachment types, attachment purposes, analysis types (Supabase + Mongo); Supabase persists and reads
attachment.purpose.Shared helpers:
src/utils/read-surfaces.ts(filter, tags extract, discovery value shaping).Docs: REST + resources + README; four system-instruction copy-pastes in
docs/examples/system-instruction-assets.md; thread bootstrap indocs/optimization/thread-context-bootstrap.md.
URIs and REST (cheat sheet)
MCP discovery
vcon://v1/discovery/attachments/purposes(preferred)vcon://v1/discovery/attachments/types(legacy)vcon://v1/discovery/analysis/types
MCP filtered reads
vcon://v1/vcons/{uuid}/attachments/purpose/{purpose}(preferred)vcon://v1/vcons/{uuid}/attachments/type/{type}(legacy)vcon://v1/vcons/{uuid}/analysis/type/{type}
REST
GET /api/v1/discovery/attachments/purposesGET /api/v1/discovery/attachments/typesGET /api/v1/discovery/analysis/typesGET /api/v1/vcons/:uuid/attachments?purpose=...(preferred)GET /api/v1/vcons/:uuid/attachments?type=...(legacy)GET /api/v1/vcons/:uuid/analysis?type=...
Key files
MCP resource list + resolve
src/resources/index.ts
REST discovery
src/api/routes/discovery.ts
REST vCon reads
src/api/routes/vcons.ts
Router mount
src/api/rest-router.ts
Filters
src/utils/read-surfaces.ts
Types
src/types/vcon.ts
IVConQueries
src/db/interfaces.ts
Supabase
src/db/queries.ts
Mongo
src/db/mongo-queries.ts
add_attachment schema
src/tools/vcon-crud.ts
Instruction assets (4 variants)
docs/examples/system-instruction-assets.md
Optimization bootstrap
docs/optimization/thread-context-bootstrap.md
Tests touched / added
tests/new-tools-resources.test.tstests/api/routes/discovery.test.tstests/api/routes/vcons.test.tstests/db-queries.test.tstests/api/helpers.ts
Commands that were green
npm run buildnpx vitest run(targeted suites during work)npm run docs:build
Policy for agents (one line)
Discover attachment purposes and analysis types first; read by purpose for attachments and type for analysis; use attachment.type only for legacy data; use tags only when data lives in tags.
Next thread (optimization) — suggested focus
Performance of distinct-category queries at scale (SQL vs batch fallback).
Whether to add write-path normalization (
type→purpose) on ingest.Optional deprecation timeline for attachment-
typediscovery surfaces.
Checkpoint 2026-05-13 — shape graph, capabilities, tests
Shipped in repo (local commit, not pushed)
OSS shape graph:
src/types/vcon-shape-graph.ts;getVconShapeGraph()onIVConQuerieswith Postgres materialization (SQL path + fallback) and Mongo implementation; optional co-occurrence edges where supported.Surfaces: MCP resource
vcon://v1/graph/shape; read toolvcon_graph_shape;vcon_capabilitieslists the tool and ashape_graphblock (resource URI, JSON schema id, short description).describe_response_shapeincludesvcon_graph_shape.Docs:
docs/api/shape-graph-and-plugins.md(default graph plus how proprietary graphs attach via plugins).Tests:
tests/handlers/schema.test.tsandtests/tools/templates.test.tsaligned to 0.4.0 and real handler responses (raw JSON Schema forget_schema, file body for TypeScript mode); registry and tool-category counts; resource tests for shape graph; stress read forvcon://v1/graph/shape.
Suggested next hardening pass
Re-read SQL for
getVconShapeGraphunder tenant RLS and large corpora (timeouts,exec_sqlavailability).Optional caching for shape graph (same Redis optional pattern as other queries).
Contract tests for
SHAPE_GRAPH_FAILEDand oversized payloads if you add strict byte limits later.
Copy this file into your vault, or keep it in-repo and @ it from the optimization thread.
Last updated