# novia-rdi-seafaring/anchor architecture

> Architecture diagram of the GitHub repository novia-rdi-seafaring/anchor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/novia-rdi-seafaring/anchor
- Repository: https://github.com/novia-rdi-seafaring/anchor

## Overview

ANCHOR is a local engineering-document canvas shared by a browser, CLI, and agent-facing MCP tools. A user creates a project, adds PDFs, and works with an external agent to extract and organize evidence-linked specifications; they can inspect source regions and review agent questions or proposed edits. The backend’s shared project runtime connects protocol adapters to workspace and document services, with file-based persistence. PDF, CAD, SysML, and FMU extensions add domain capabilities. Some extension and frontend links are based on README descriptions and repository structure; unsampled implementation details are not asserted.

Main entry points: [`src/anchor/adapters/project_runtime.py`](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/project_runtime.py) (Project Runtime), [`src/intent_layer/service.py`](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/intent_layer/service.py) (Intent Service), [`web/src/App.tsx`](https://github.com/novia-rdi-seafaring/anchor/blob/main/web/src/App.tsx) (Browser Canvas), [`src/anchor/adapters/cli/main.py`](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/cli/main.py) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_web["Browser Canvas<br/>[App.tsx]"]
  node_cli["CLI<br/>[main.py]"]
  node_mcp["MCP Server<br/>[server.py]"]
  node_http["HTTP API<br/>[app.py]"]
  node_pdf_view["Source Review<br/>[PdfSourceView.tsx]"]
end

subgraph group_canvas["Canvas and Requests"]
  node_workspace["Workspace Service"]
  node_intent["Intent Service<br/>[service.py]"]
end

subgraph group_documents["PDF Evidence"]
  node_pdf_api["PDF Ingest API<br/>[ingest_sessions.py]"]
  node_pdf_ingest["PDF Processing<br/>[services.py]"]
  node_gold["Gold Regions<br/>[gold_ingest.py]"]
  node_doc_store[("Document Store<br/>[doc_store.py]")]
end

subgraph group_extensions["Engineering Extensions"]
  node_cad["CAD Extension<br/>[services.py]"]
  node_sysml["SysML Extension<br/>[services.py]"]
  node_fmu["FMU Extension<br/>[services.py]"]
end

subgraph group_runtime["Shared Runtime"]
  node_project["Project Runtime<br/>[project_runtime.py]"]
  node_canvas_store[("Canvas Storage")]
  node_intent_store[("Intent Storage<br/>[fs_store.py]")]
  node_env["Environment Config<br/>[environment.py]"]
end

node_engineer(("Engineer"))
node_agent(("External Agent"))

node_engineer -->|"uses"| node_web
node_engineer -->|"uses"| node_cli
node_agent -->|"requests tools"| node_mcp
node_web -->|"calls API"| node_http
node_cli -->|"uses services"| node_project
node_http -->|"configures runtime"| node_project
node_mcp -->|"uses runtime"| node_project
node_project -->|"wires service"| node_workspace
node_project -->|"wires service"| node_intent
node_project -->|"wires service"| node_cad
node_project -->|"wires service"| node_sysml
node_project -->|"wires service"| node_fmu
node_workspace -.->|"persists workspaces"| node_canvas_store
node_intent -->|"persists requests"| node_intent_store
node_agent -->|"retrieves requests"| node_intent
node_engineer -->|"uploads PDF"| node_pdf_api
node_pdf_api -.->|"starts ingestion"| node_pdf_ingest
node_pdf_ingest -.->|"extracts regions"| node_gold
node_gold -->|"writes regions"| node_doc_store
node_pdf_view -.->|"views sources"| node_doc_store
node_engineer -->|"checks citations"| node_pdf_view
node_project -->|"loads settings"| node_env

click node_web "https://github.com/novia-rdi-seafaring/anchor/blob/main/web/src/App.tsx"
click node_cli "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/cli/main.py"
click node_mcp "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/mcp/server.py"
click node_http "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/http/app.py"
click node_project "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/project_runtime.py"
click node_workspace "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/core/services/workspace_service.py"
click node_canvas_store "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/infra/stores/fs_workspace_store.py"
click node_intent "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/intent_layer/service.py"
click node_intent_store "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/intent_layer/fs_store.py"
click node_pdf_api "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/adapters/http/ingest_sessions.py"
click node_pdf_ingest "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/core/services.py"
click node_gold "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/core/gold_ingest.py"
click node_doc_store "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/core/ports/doc_store.py"
click node_pdf_view "https://github.com/novia-rdi-seafaring/anchor/blob/main/web/src/canvas/primitives/viewers/PdfSourceView.tsx"
click node_cad "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_cad/core/services.py"
click node_sysml "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_sysml/core/services.py"
click node_fmu "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_fmus/core/services.py"
click node_env "https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/infra/environment.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_cli,node_mcp,node_http,node_pdf_view toneBlue
class node_workspace,node_intent toneAmber
class node_pdf_api,node_pdf_ingest,node_gold,node_doc_store toneMint
class node_cad,node_sysml,node_fmu toneRose
class node_project,node_canvas_store,node_intent_store,node_env,node_engineer,node_agent toneIndigo
```

## Components

### User Interfaces

- [Browser Canvas](https://github.com/novia-rdi-seafaring/anchor/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [CLI](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/cli/main.py): `src/anchor/adapters/cli/main.py`
- [MCP Server](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/mcp/server.py): `src/anchor/adapters/mcp/server.py`
- [HTTP API](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/http/app.py): `src/anchor/adapters/http/app.py`
- [Source Review](https://github.com/novia-rdi-seafaring/anchor/blob/main/web/src/canvas/primitives/viewers/PdfSourceView.tsx): `web/src/canvas/primitives/viewers/PdfSourceView.tsx`

### Canvas and Requests

- [Workspace Service](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/core/services/workspace_service.py): `src/anchor/core/services/workspace_service.py`
- [Intent Service](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/intent_layer/service.py): `src/intent_layer/service.py`

### PDF Evidence

- [PDF Ingest API](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/adapters/http/ingest_sessions.py): `src/anchor/extensions/anchor_pdfs/adapters/http/ingest_sessions.py`
- [PDF Processing](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/core/services.py): `src/anchor/extensions/anchor_pdfs/core/services.py`
- [Gold Regions](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/core/gold_ingest.py): `src/anchor/extensions/anchor_pdfs/core/gold_ingest.py`
- [Document Store](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_pdfs/core/ports/doc_store.py): `src/anchor/extensions/anchor_pdfs/core/ports/doc_store.py`

### Engineering Extensions

- [CAD Extension](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_cad/core/services.py): `src/anchor/extensions/anchor_cad/core/services.py`
- [SysML Extension](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_sysml/core/services.py): `src/anchor/extensions/anchor_sysml/core/services.py`
- [FMU Extension](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/extensions/anchor_fmus/core/services.py): `src/anchor/extensions/anchor_fmus/core/services.py`

### Shared Runtime

- [Project Runtime](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/adapters/project_runtime.py): `src/anchor/adapters/project_runtime.py`
- [Canvas Storage](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/infra/stores/fs_workspace_store.py): `src/anchor/infra/stores/fs_workspace_store.py`
- [Intent Storage](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/intent_layer/fs_store.py): `src/intent_layer/fs_store.py`
- [Environment Config](https://github.com/novia-rdi-seafaring/anchor/blob/main/src/anchor/infra/environment.py): `src/anchor/infra/environment.py`

### Other components

- **Engineer**
- **External Agent**

## Connections

- Engineer → Browser Canvas: uses (evidence: `README.md`)
- Engineer → CLI: uses (evidence: `README.md`)
- External Agent → MCP Server: requests tools (evidence: `README.md`)
- Browser Canvas → HTTP API: calls API (evidence: `README.md`)
- CLI → Project Runtime: uses services
- HTTP API → Project Runtime: configures runtime (evidence: `src/anchor/adapters/http/app.py`)
- MCP Server → Project Runtime: uses runtime (evidence: `src/anchor/adapters/mcp/server.py`)
- Project Runtime → Workspace Service: wires service (evidence: `src/anchor/adapters/project_runtime.py`)
- Project Runtime → Intent Service: wires service (evidence: `src/anchor/adapters/project_runtime.py`)
- Project Runtime → CAD Extension: wires service (evidence: `src/anchor/adapters/project_runtime.py`)
- Project Runtime → SysML Extension: wires service (evidence: `src/anchor/adapters/project_runtime.py`)
- Project Runtime → FMU Extension: wires service (evidence: `src/anchor/adapters/project_runtime.py`)
- Workspace Service → Canvas Storage: persists workspaces
- Intent Service → Intent Storage: persists requests (evidence: `src/intent_layer/service.py`)
- External Agent → Intent Service: retrieves requests (evidence: `README.md`)
- Engineer → PDF Ingest API: uploads PDF (evidence: `README.md`)
- PDF Ingest API → PDF Processing: starts ingestion
- PDF Processing → Gold Regions: extracts regions
- Gold Regions → Document Store: writes regions (evidence: `src/anchor/extensions/anchor_pdfs/core/gold_ingest.py`)
- Source Review → Document Store: views sources
- Engineer → Source Review: checks citations (evidence: `README.md`)
- Project Runtime → Environment Config: loads settings (evidence: `src/anchor/adapters/project_runtime.py`)
