# eduardd76/rfc-visual architecture

> Architecture diagram of the GitHub repository eduardd76/rfc-visual, 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/eduardd76/rfc-visual
- Repository: https://github.com/eduardd76/rfc-visual

## Overview

rfc-visual turns an RFC number or RFC-editor URL into a browsable explanation: users search or open an RFC page, then inspect its status/relations, lineage, text, and—when available—an interactive protocol visual. The repository also supports machine-generated visual drafts with quote validation and repair. The graph covers the sampled page and rendering calls plus README-documented generator behavior; several modules are indexed but unsampled, so their internal wiring is intentionally not inferred.

Main entry points: [`src/app/rfc/[slug]/page.tsx`](https://github.com/eduardd76/rfc-visual/blob/main/src/app/rfc/%5Bslug%5D/page.tsx) (RFC page), [`src/app/page.tsx`](https://github.com/eduardd76/rfc-visual/blob/main/src/app/page.tsx) (Search landing), [`src/rfc/load.ts`](https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/load.ts) (Index loading), [`src/components/rfc-visuals.tsx`](https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-visuals.tsx) (Visual presentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["RFC Web Experience"]
  node_home["Search landing<br/>[page.tsx]"]
  node_rfcpage["RFC page<br/>[page.tsx]"]
  node_header["RFC status header<br/>[rfc-header.tsx]"]
  node_relations["RFC relations<br/>[rfc-relations.tsx]"]
  node_text["RFC text<br/>[rfc-text.tsx]"]
  node_searchui["RFC search UI<br/>[rfc-search.tsx]"]
  node_lineagegraph["Lineage graph view<br/>[lineage-graph.tsx]"]
end

subgraph group_data["RFC Data and Discovery"]
  node_indexload["Index loading<br/>[load.ts]"]
  node_indexparse["Index parsing<br/>[parse-index.ts]"]
  node_search["Search logic<br/>[search.ts]"]
  node_canonical["Canonical RFC paths<br/>[canonical.ts]"]
  node_lineage["Lineage model<br/>[lineage.ts]"]
end

subgraph group_visual["Protocol Visuals"]
  node_visualregistry["Visual registry<br/>[registry.ts]"]
  node_visualmodels["Hand-built protocol visuals<br/>[rfc4271.ts]"]
  node_visualcompile["Visual compilation<br/>[compile.ts]"]
  node_visualui["Visual presentation<br/>[rfc-visuals.tsx]"]
  node_mermaid["Mermaid renderer"]
  node_viewport["Diagram viewport"]
  node_pointer["Pointer gestures"]
  node_diagramhelpers["Diagram helpers"]
  node_validator["Visual validator<br/>[validate.ts]"]
end

subgraph group_drafts["Visual Draft Generation"]
  node_draftqueue["Draft scheduling<br/>[queue.ts]"]
  node_openrouter["Model requests<br/>[openrouter.ts]"]
  node_draftparse["Draft parsing<br/>[parse.ts]"]
  node_draftprune["Quote validation and pruning<br/>[prune.ts]"]
end

node_visitor(("RFC reader"))
node_rfcsource["RFC Editor"]
node_modelservice["OpenRouter"]

node_visitor -->|"opens"| node_home
node_visitor -->|"opens RFC"| node_rfcpage
node_home -->|"renders"| node_searchui
node_home -->|"lists visuals"| node_visualregistry
node_home -->|"links RFCs"| node_canonical
node_searchui -.->|"queries"| node_search
node_search -.->|"uses index"| node_indexload
node_indexload -.->|"parses data"| node_indexparse
node_rfcpage -->|"loads entries"| node_indexload
node_rfcpage -->|"selects visual"| node_visualregistry
node_rfcpage -->|"renders"| node_header
node_rfcpage -->|"renders"| node_relations
node_rfcpage -->|"renders"| node_text
node_rfcpage -->|"builds graph data"| node_lineage
node_rfcpage -->|"renders"| node_lineagegraph
node_lineage -->|"links RFC nodes"| node_canonical
node_rfcpage -.->|"resolves paths"| node_canonical
node_visualregistry -.->|"provides models"| node_visualmodels
node_rfcpage -->|"renders visual"| node_visualui
node_visualui -->|"formats diagrams"| node_visualcompile
node_visualui -->|"renders charts"| node_mermaid
node_mermaid -.->|"uses viewport"| node_viewport
node_viewport -->|"handles gestures"| node_pointer
node_pointer -->|"uses geometry"| node_diagramhelpers
node_viewport -->|"uses geometry"| node_diagramhelpers
node_rfcsource -.->|"supplies RFC data"| node_indexload
node_draftqueue -.->|"schedules requests"| node_openrouter
node_openrouter -.->|"requests drafts"| node_modelservice
node_openrouter -.->|"returns output"| node_draftparse
node_draftparse -.->|"passes draft"| node_draftprune
node_draftprune -->|"checks quotes"| node_validator
node_draftprune -.->|"checks against text"| node_rfcsource
node_validator -.->|"retries failures"| node_draftqueue

click node_home "https://github.com/eduardd76/rfc-visual/blob/main/src/app/page.tsx"
click node_rfcpage "https://github.com/eduardd76/rfc-visual/blob/main/src/app/rfc/%5Bslug%5D/page.tsx"
click node_header "https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-header.tsx"
click node_relations "https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-relations.tsx"
click node_text "https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-text.tsx"
click node_searchui "https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-search.tsx"
click node_indexload "https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/load.ts"
click node_indexparse "https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/parse-index.ts"
click node_search "https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/search.ts"
click node_canonical "https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/canonical.ts"
click node_lineage "https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/lineage.ts"
click node_lineagegraph "https://github.com/eduardd76/rfc-visual/blob/main/src/components/lineage-graph.tsx"
click node_visualregistry "https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/registry.ts"
click node_visualmodels "https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/rfc4271.ts"
click node_visualcompile "https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/compile.ts"
click node_visualui "https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-visuals.tsx"
click node_mermaid "https://github.com/eduardd76/rfc-visual/blob/main/src/components/mermaid-diagram.tsx"
click node_viewport "https://github.com/eduardd76/rfc-visual/blob/main/src/hooks/use-mermaid-viewport.ts"
click node_pointer "https://github.com/eduardd76/rfc-visual/blob/main/src/hooks/use-diagram-pointer-gestures.ts"
click node_diagramhelpers "https://github.com/eduardd76/rfc-visual/blob/main/src/components/mermaid-diagram-helpers.ts"
click node_draftqueue "https://github.com/eduardd76/rfc-visual/blob/main/src/generator/queue.ts"
click node_openrouter "https://github.com/eduardd76/rfc-visual/blob/main/src/generator/openrouter.ts"
click node_draftparse "https://github.com/eduardd76/rfc-visual/blob/main/src/generator/parse.ts"
click node_draftprune "https://github.com/eduardd76/rfc-visual/blob/main/src/generator/prune.ts"
click node_validator "https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/validate.ts"

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_home,node_rfcpage,node_header,node_relations,node_text,node_searchui,node_lineagegraph toneBlue
class node_indexload,node_indexparse,node_search,node_canonical,node_lineage toneAmber
class node_visualregistry,node_visualmodels,node_visualcompile,node_visualui,node_mermaid,node_viewport,node_pointer,node_diagramhelpers,node_validator,node_modelservice toneMint
class node_draftqueue,node_openrouter,node_draftparse,node_draftprune toneRose
class node_visitor,node_rfcsource toneIndigo
```

## Components

### RFC Web Experience

- [Search landing](https://github.com/eduardd76/rfc-visual/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [RFC page](https://github.com/eduardd76/rfc-visual/blob/main/src/app/rfc/%5Bslug%5D/page.tsx): `src/app/rfc/[slug]/page.tsx`
- [RFC status header](https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-header.tsx): `src/components/rfc-header.tsx`
- [RFC relations](https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-relations.tsx): `src/components/rfc-relations.tsx`
- [RFC text](https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-text.tsx): `src/components/rfc-text.tsx`
- [RFC search UI](https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-search.tsx): `src/components/rfc-search.tsx`
- [Lineage graph view](https://github.com/eduardd76/rfc-visual/blob/main/src/components/lineage-graph.tsx): `src/components/lineage-graph.tsx`

### RFC Data and Discovery

- [Index loading](https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/load.ts): `src/rfc/load.ts`
- [Index parsing](https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/parse-index.ts): `src/rfc/parse-index.ts`
- [Search logic](https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/search.ts): `src/rfc/search.ts`
- [Canonical RFC paths](https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/canonical.ts): `src/rfc/canonical.ts`
- [Lineage model](https://github.com/eduardd76/rfc-visual/blob/main/src/rfc/lineage.ts): `src/rfc/lineage.ts`

### Protocol Visuals

- [Visual registry](https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/registry.ts): `src/visuals/registry.ts`
- [Hand-built protocol visuals](https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/rfc4271.ts): `src/visuals/rfc4271.ts`
- [Visual compilation](https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/compile.ts): `src/visuals/compile.ts`
- [Visual presentation](https://github.com/eduardd76/rfc-visual/blob/main/src/components/rfc-visuals.tsx): `src/components/rfc-visuals.tsx`
- [Mermaid renderer](https://github.com/eduardd76/rfc-visual/blob/main/src/components/mermaid-diagram.tsx): `src/components/mermaid-diagram.tsx`
- [Diagram viewport](https://github.com/eduardd76/rfc-visual/blob/main/src/hooks/use-mermaid-viewport.ts): `src/hooks/use-mermaid-viewport.ts`
- [Pointer gestures](https://github.com/eduardd76/rfc-visual/blob/main/src/hooks/use-diagram-pointer-gestures.ts): `src/hooks/use-diagram-pointer-gestures.ts`
- [Diagram helpers](https://github.com/eduardd76/rfc-visual/blob/main/src/components/mermaid-diagram-helpers.ts): `src/components/mermaid-diagram-helpers.ts`
- [Visual validator](https://github.com/eduardd76/rfc-visual/blob/main/src/visuals/validate.ts): `src/visuals/validate.ts`

### Visual Draft Generation

- [Draft scheduling](https://github.com/eduardd76/rfc-visual/blob/main/src/generator/queue.ts): `src/generator/queue.ts`
- [Model requests](https://github.com/eduardd76/rfc-visual/blob/main/src/generator/openrouter.ts): `src/generator/openrouter.ts`
- [Draft parsing](https://github.com/eduardd76/rfc-visual/blob/main/src/generator/parse.ts): `src/generator/parse.ts`
- [Quote validation and pruning](https://github.com/eduardd76/rfc-visual/blob/main/src/generator/prune.ts): `src/generator/prune.ts`

### Other components

- **RFC reader**
- **RFC Editor**
- **OpenRouter**

## Connections

- RFC reader → Search landing: opens (evidence: `README.md`)
- RFC reader → RFC page: opens RFC (evidence: `README.md`)
- Search landing → RFC search UI: renders (evidence: `src/app/page.tsx`)
- Search landing → Visual registry: lists visuals (evidence: `src/app/page.tsx`)
- Search landing → Canonical RFC paths: links RFCs (evidence: `src/app/page.tsx`)
- RFC search UI → Search logic: queries
- Search logic → Index loading: uses index
- Index loading → Index parsing: parses data
- RFC page → Index loading: loads entries (evidence: `src/app/rfc/[slug]/page.tsx`)
- RFC page → Visual registry: selects visual (evidence: `src/app/rfc/[slug]/page.tsx`)
- RFC page → RFC status header: renders (evidence: `src/app/rfc/[slug]/page.tsx`)
- RFC page → RFC relations: renders (evidence: `src/app/rfc/[slug]/page.tsx`)
- RFC page → RFC text: renders (evidence: `src/app/rfc/[slug]/page.tsx`)
- RFC page → Lineage model: builds graph data (evidence: `src/app/rfc/[slug]/page.tsx`)
- RFC page → Lineage graph view: renders (evidence: `src/app/rfc/[slug]/page.tsx`)
- Lineage model → Canonical RFC paths: links RFC nodes (evidence: `src/rfc/lineage.ts`)
- RFC page → Canonical RFC paths: resolves paths
- Visual registry → Hand-built protocol visuals: provides models
- RFC page → Visual presentation: renders visual (evidence: `src/app/rfc/[slug]/page.tsx`)
- Visual presentation → Visual compilation: formats diagrams (evidence: `src/components/rfc-visuals.tsx`)
- Visual presentation → Mermaid renderer: renders charts (evidence: `src/components/rfc-visuals.tsx`)
- Mermaid renderer → Diagram viewport: uses viewport
- Diagram viewport → Pointer gestures: handles gestures (evidence: `src/hooks/use-mermaid-viewport.ts`)
- Pointer gestures → Diagram helpers: uses geometry (evidence: `src/hooks/use-diagram-pointer-gestures.ts`)
- Diagram viewport → Diagram helpers: uses geometry (evidence: `src/hooks/use-mermaid-viewport.ts`)
- RFC Editor → Index loading: supplies RFC data (evidence: `README.md`)
- Draft scheduling → Model requests: schedules requests (evidence: `README.md`)
- Model requests → OpenRouter: requests drafts (evidence: `README.md`)
- Model requests → Draft parsing: returns output
- Draft parsing → Quote validation and pruning: passes draft
- Quote validation and pruning → Visual validator: checks quotes (evidence: `src/generator/prune.ts`)
- Quote validation and pruning → RFC Editor: checks against text (evidence: `README.md`)
- Visual validator → Draft scheduling: retries failures (evidence: `README.md`)
