Architecture
Auto-generated structural diagrams of the Go MCP server and the Node.js Lambda functions.
These diagrams are generated directly from source code — never hand-drawn — so
they cannot drift out of sync with the implementation. On every change to the Go
or Lambda sources, the docs-watcher pane re-runs the pipeline:
tree-sitter parses each source file and extracts structural primitives
(packages/modules, structs, interfaces, functions, methods, and entry points)
using the queries in scripts/lib/treesitter/. Those primitives are rendered to
D2 and compiled to native SVG, which is dropped straight into this site’s
static/diagrams/ tree.
Regenerate manually with task docs:generate (one-time toolchain setup via
task docs:setup). Entry points (main, Lambda handler) are highlighted in
amber; interfaces are hexagons; structs with methods are shown as class shapes.
Arrows are import dependencies — the Go package graph (main → mcp → api/mpp)
and the Lambda fan-in to the shared store/otel layer — extracted from the
actual import statements.
The same extraction emits a deterministic structure.json manifest
(/diagrams/structure.json) that downstream checks consume: task docs:check
asserts OpenAPI ⇄ SAM ⇄ Lambda-handler parity — every documented operation is
routed and backed by a real handler, and every implemented route is documented.