# ishamishra0408/veto architecture

> Architecture diagram of the GitHub repository ishamishra0408/veto, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ishamishra0408/veto
- Repository: https://github.com/ishamishra0408/veto
- Video tour (about a minute): https://gitdiagram.com/ishamishra0408/veto/video

## Overview

Veto is a ship-time trust gate for long-running agents. Its main workflow collects competitor pages, corroborates and pins facts, reasons from those pins, then re-fetches cited facts before shipping. Drift or unreachable sources cause a refusal receipt and can trigger a targeted rebase and another gate. The graph includes the evidence and history capability described in the README; unsampled modules are represented only where paths and responsibilities are documented, so some internal wiring is omitted.

Main entry points: [`veto/report.ts`](https://github.com/ishamishra0408/veto/blob/main/veto/report.ts) (Report builder), [`veto/adapters.ts`](https://github.com/ishamishra0408/veto/blob/main/veto/adapters.ts) (Fetch adapters), [`veto/evidence.ts`](https://github.com/ishamishra0408/veto/blob/main/veto/evidence.ts) (Evidence counts), [`veto/scenario.ts`](https://github.com/ishamishra0408/veto/blob/main/veto/scenario.ts) (Scenario runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Run workflow"]
  node_scenario["Scenario runner<br/>[scenario.ts]"]
  node_planner["Plan tracking<br/>[planner.ts]"]
end

subgraph group_facts["Facts and reasoning"]
  node_adapters["Fetch adapters<br/>[adapters.ts]"]
  node_extract["Fact corroboration<br/>[extract.ts]"]
  node_liquid["Liquid client<br/>[liquid.ts]"]
  node_pins[("Pin store<br/>[pins.ts]")]
  node_report["Report builder<br/>[report.ts]"]
  node_agent["Claim writer<br/>[agent.ts]"]
end

subgraph group_ship["Ship control"]
  node_ship["Ship decision<br/>[ship.ts]"]
  node_gate["Revalidation gate<br/>[gate.ts]"]
  node_receipts["Refusal receipts<br/>[receipts.ts]"]
  node_verify["Pin verification<br/>[verify_pins.ts]"]
end

subgraph group_history["Evidence and history"]
  node_stream["Event stream<br/>[stream.ts]"]
  node_evidence["Evidence counts<br/>[evidence.ts]"]
  node_console["Evidence console<br/>[index.html]"]
  node_captured["Captured run data"]
end

node_operator(("Run initiator"))
node_nimble{{"Nimble MCP"}}
node_ollama{{"Ollama models"}}
node_tinybird{{"Tinybird analytics"}}

node_operator -->|"starts run"| node_scenario
node_scenario -->|"tracks steps"| node_planner
node_scenario -->|"selects source"| node_adapters
node_scenario -->|"requests decision"| node_ship
node_report -->|"fetches pages"| node_adapters
node_adapters -.->|"calls MCP"| node_nimble
node_report -->|"corroborates facts"| node_extract
node_extract -->|"extracts independently"| node_liquid
node_extract -->|"uses parser"| node_adapters
node_liquid -.->|"requests inference"| node_ollama
node_report -->|"stores facts"| node_pins
node_report -->|"requests analysis"| node_agent
node_agent -->|"generates claims"| node_liquid
node_ship -->|"builds draft"| node_report
node_ship -->|"revalidates citations"| node_gate
node_gate -->|"re-fetches sources"| node_adapters
node_gate -->|"reads cited facts"| node_pins
node_ship -->|"records refusal"| node_receipts
node_verify -->|"checks pin hashes"| node_pins
node_evidence -->|"reads counts"| node_pins
node_evidence -->|"reads history"| node_receipts
node_evidence -->|"collects events"| node_stream
node_evidence -.->|"queries analytics"| node_tinybird
node_stream -.->|"streams events"| node_tinybird
node_console -->|"displays artifacts"| node_captured

click node_scenario "https://github.com/ishamishra0408/veto/blob/main/veto/scenario.ts"
click node_planner "https://github.com/ishamishra0408/veto/blob/main/veto/planner.ts"
click node_adapters "https://github.com/ishamishra0408/veto/blob/main/veto/adapters.ts"
click node_extract "https://github.com/ishamishra0408/veto/blob/main/veto/extract.ts"
click node_liquid "https://github.com/ishamishra0408/veto/blob/main/veto/liquid.ts"
click node_pins "https://github.com/ishamishra0408/veto/blob/main/veto/pins.ts"
click node_report "https://github.com/ishamishra0408/veto/blob/main/veto/report.ts"
click node_agent "https://github.com/ishamishra0408/veto/blob/main/veto/agent.ts"
click node_ship "https://github.com/ishamishra0408/veto/blob/main/veto/ship.ts"
click node_gate "https://github.com/ishamishra0408/veto/blob/main/veto/gate.ts"
click node_receipts "https://github.com/ishamishra0408/veto/blob/main/veto/receipts.ts"
click node_verify "https://github.com/ishamishra0408/veto/blob/main/veto/verify_pins.ts"
click node_stream "https://github.com/ishamishra0408/veto/blob/main/veto/stream.ts"
click node_evidence "https://github.com/ishamishra0408/veto/blob/main/veto/evidence.ts"
click node_console "https://github.com/ishamishra0408/veto/blob/main/demo/console/index.html"
click node_captured "https://github.com/ishamishra0408/veto/tree/main/evidence"

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_scenario,node_planner toneBlue
class node_adapters,node_extract,node_liquid,node_pins,node_report,node_agent toneAmber
class node_ship,node_gate,node_receipts,node_verify toneMint
class node_stream,node_evidence,node_console,node_captured toneRose
class node_operator,node_nimble,node_ollama,node_tinybird toneIndigo
```

## Components

### Run workflow

- [Scenario runner](https://github.com/ishamishra0408/veto/blob/main/veto/scenario.ts): `veto/scenario.ts`
- [Plan tracking](https://github.com/ishamishra0408/veto/blob/main/veto/planner.ts): `veto/planner.ts`

### Facts and reasoning

- [Fetch adapters](https://github.com/ishamishra0408/veto/blob/main/veto/adapters.ts): `veto/adapters.ts`
- [Fact corroboration](https://github.com/ishamishra0408/veto/blob/main/veto/extract.ts): `veto/extract.ts`
- [Liquid client](https://github.com/ishamishra0408/veto/blob/main/veto/liquid.ts): `veto/liquid.ts`
- [Pin store](https://github.com/ishamishra0408/veto/blob/main/veto/pins.ts): `veto/pins.ts`
- [Report builder](https://github.com/ishamishra0408/veto/blob/main/veto/report.ts): `veto/report.ts`
- [Claim writer](https://github.com/ishamishra0408/veto/blob/main/veto/agent.ts): `veto/agent.ts`

### Ship control

- [Ship decision](https://github.com/ishamishra0408/veto/blob/main/veto/ship.ts): `veto/ship.ts`
- [Revalidation gate](https://github.com/ishamishra0408/veto/blob/main/veto/gate.ts): `veto/gate.ts`
- [Refusal receipts](https://github.com/ishamishra0408/veto/blob/main/veto/receipts.ts): `veto/receipts.ts`
- [Pin verification](https://github.com/ishamishra0408/veto/blob/main/veto/verify_pins.ts): `veto/verify_pins.ts`

### Evidence and history

- [Event stream](https://github.com/ishamishra0408/veto/blob/main/veto/stream.ts): `veto/stream.ts`
- [Evidence counts](https://github.com/ishamishra0408/veto/blob/main/veto/evidence.ts): `veto/evidence.ts`
- [Evidence console](https://github.com/ishamishra0408/veto/blob/main/demo/console/index.html): `demo/console/index.html`
- [Captured run data](https://github.com/ishamishra0408/veto/tree/main/evidence): `evidence`

### Other components

- **Run initiator**
- **Nimble MCP**
- **Ollama models**
- **Tinybird analytics**

## Connections

- Run initiator → Scenario runner: starts run
- Scenario runner → Plan tracking: tracks steps
- Scenario runner → Fetch adapters: selects source
- Scenario runner → Ship decision: requests decision
- Report builder → Fetch adapters: fetches pages
- Fetch adapters → Nimble MCP: calls MCP
- Report builder → Fact corroboration: corroborates facts
- Fact corroboration → Liquid client: extracts independently
- Fact corroboration → Fetch adapters: uses parser
- Liquid client → Ollama models: requests inference
- Report builder → Pin store: stores facts
- Report builder → Claim writer: requests analysis
- Claim writer → Liquid client: generates claims
- Ship decision → Report builder: builds draft
- Ship decision → Revalidation gate: revalidates citations
- Revalidation gate → Fetch adapters: re-fetches sources
- Revalidation gate → Pin store: reads cited facts
- Ship decision → Refusal receipts: records refusal
- Pin verification → Pin store: checks pin hashes
- Evidence counts → Pin store: reads counts
- Evidence counts → Refusal receipts: reads history
- Evidence counts → Event stream: collects events
- Evidence counts → Tinybird analytics: queries analytics
- Event stream → Tinybird analytics: streams events
- Evidence console → Captured run data: displays artifacts
