# veeruveerendra05/ace architecture

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

- Interactive diagram: https://gitdiagram.com/veeruveerendra05/ace
- Repository: https://github.com/veeruveerendra05/ace

## Overview

ACE is a local repository-context CLI. Its main workflow initializes per-project state, updates structural and symbol-history caches from tracked source and Git, then retrieves relevant symbols and optionally fuses their history into a budgeted context package or prompt. Separate oracle and A/B evaluation harnesses validate tracking and measure historical context utility. The graph follows documented workflows and the supplied source index; several command and evaluation internals were not excerpted, so their links rely on README documentation.

Main entry points: [`src/history/tracker.ts`](https://github.com/veeruveerendra05/ace/blob/main/src/history/tracker.ts) (History tracker), [`src/context/fusion.ts`](https://github.com/veeruveerendra05/ace/blob/main/src/context/fusion.ts) (Context fusion), [`src/commands`](https://github.com/veeruveerendra05/ace/tree/main/src/commands) (Project commands), [`src/eval/ab/runner.ts`](https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/runner.ts) (A/B evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and state"]
  node_cli["CLI router<br/>[cli.ts]"]
  node_commands["Project commands"]
  node_setup["ACE scaffold<br/>[setup.ts]"]
  node_core["State utilities"]
  node_types["Domain types"]
end

subgraph group_indexing["Repository indexing"]
  node_update["Cache updater<br/>[update.ts]"]
  node_extractor["AST extractor<br/>[extractor.ts]"]
  node_tracker["History tracker<br/>[tracker.ts]"]
  node_matcher["Symbol matcher<br/>[matcher.ts]"]
  node_git["Git access<br/>[git.ts]"]
  node_structural[("Structural cache")]
  node_history[("History store<br/>[history-store.ts]")]
end

subgraph group_context["Context retrieval"]
  node_export["Export command<br/>[export.ts]"]
  node_retriever["Symbol retrieval<br/>[retriever.ts]"]
  node_fusion["Context fusion<br/>[fusion.ts]"]
  node_renderer["Prompt renderer<br/>[render.ts]"]
end

subgraph group_evaluation["Evaluation"]
  node_oracle["Oracle evaluation<br/>[evaluate.ts]"]
  node_ab["A/B evaluation<br/>[runner.ts]"]
  node_provider["LLM provider<br/>[provider.ts]"]
  node_report["Evaluation reports<br/>[report.ts]"]
end

node_user(("Engineer"))
node_endpoint(("Configured LLM endpoint"))

node_user -->|"runs commands"| node_cli
node_cli -->|"routes commands"| node_commands
node_commands -->|"initializes state"| node_setup
node_setup -->|"resolves paths"| node_core
node_commands -->|"refreshes caches"| node_update
node_update -->|"tracks changes"| node_tracker
node_tracker -->|"extracts symbols"| node_extractor
node_tracker -->|"matches versions"| node_matcher
node_tracker -->|"walks history"| node_git
node_tracker -->|"writes index"| node_structural
node_tracker -->|"appends versions"| node_history
node_export -->|"builds context"| node_fusion
node_fusion -->|"loads index"| node_structural
node_fusion -->|"ranks symbols"| node_retriever
node_fusion -->|"retrieves history"| node_history
node_fusion -->|"reads revisions"| node_git
node_fusion -->|"renders prompt"| node_renderer
node_export -->|"returns package"| node_user
node_commands -->|"runs oracle"| node_oracle
node_commands -->|"runs comparison"| node_ab
node_ab -->|"queries provider"| node_provider
node_ab -->|"builds historical context"| node_fusion
node_ab -->|"writes reports"| node_report
node_provider -.->|"calls when configured"| node_endpoint
node_oracle -->|"checks tracking"| node_tracker
node_core -->|"uses schemas"| node_types

click node_cli "https://github.com/veeruveerendra05/ace/blob/main/src/cli.ts"
click node_commands "https://github.com/veeruveerendra05/ace/tree/main/src/commands"
click node_setup "https://github.com/veeruveerendra05/ace/blob/main/src/core/setup.ts"
click node_core "https://github.com/veeruveerendra05/ace/tree/main/src/core"
click node_types "https://github.com/veeruveerendra05/ace/tree/main/src/types"
click node_update "https://github.com/veeruveerendra05/ace/blob/main/src/commands/update.ts"
click node_extractor "https://github.com/veeruveerendra05/ace/blob/main/src/structural/extractor.ts"
click node_tracker "https://github.com/veeruveerendra05/ace/blob/main/src/history/tracker.ts"
click node_matcher "https://github.com/veeruveerendra05/ace/blob/main/src/history/matcher.ts"
click node_git "https://github.com/veeruveerendra05/ace/blob/main/src/git/git.ts"
click node_structural "https://github.com/veeruveerendra05/ace/blob/main/src/structural/structural-store.ts"
click node_history "https://github.com/veeruveerendra05/ace/blob/main/src/storage/history-store.ts"
click node_export "https://github.com/veeruveerendra05/ace/blob/main/src/commands/export.ts"
click node_retriever "https://github.com/veeruveerendra05/ace/blob/main/src/structural/retriever.ts"
click node_fusion "https://github.com/veeruveerendra05/ace/blob/main/src/context/fusion.ts"
click node_renderer "https://github.com/veeruveerendra05/ace/blob/main/src/context/render.ts"
click node_oracle "https://github.com/veeruveerendra05/ace/blob/main/src/eval/oracle/evaluate.ts"
click node_ab "https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/runner.ts"
click node_provider "https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/provider.ts"
click node_report "https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/report.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_cli,node_commands,node_setup,node_core,node_types toneBlue
class node_update,node_extractor,node_tracker,node_matcher,node_git,node_structural,node_history toneAmber
class node_export,node_retriever,node_fusion,node_renderer toneMint
class node_oracle,node_ab,node_provider,node_report toneRose
class node_user,node_endpoint toneIndigo
```

## Components

### CLI and state

- [CLI router](https://github.com/veeruveerendra05/ace/blob/main/src/cli.ts): `src/cli.ts`
- [Project commands](https://github.com/veeruveerendra05/ace/tree/main/src/commands): `src/commands`
- [ACE scaffold](https://github.com/veeruveerendra05/ace/blob/main/src/core/setup.ts): `src/core/setup.ts`
- [State utilities](https://github.com/veeruveerendra05/ace/tree/main/src/core): `src/core`
- [Domain types](https://github.com/veeruveerendra05/ace/tree/main/src/types): `src/types`

### Repository indexing

- [Cache updater](https://github.com/veeruveerendra05/ace/blob/main/src/commands/update.ts): `src/commands/update.ts`
- [AST extractor](https://github.com/veeruveerendra05/ace/blob/main/src/structural/extractor.ts): `src/structural/extractor.ts`
- [History tracker](https://github.com/veeruveerendra05/ace/blob/main/src/history/tracker.ts): `src/history/tracker.ts`
- [Symbol matcher](https://github.com/veeruveerendra05/ace/blob/main/src/history/matcher.ts): `src/history/matcher.ts`
- [Git access](https://github.com/veeruveerendra05/ace/blob/main/src/git/git.ts): `src/git/git.ts`
- [Structural cache](https://github.com/veeruveerendra05/ace/blob/main/src/structural/structural-store.ts): `src/structural/structural-store.ts`
- [History store](https://github.com/veeruveerendra05/ace/blob/main/src/storage/history-store.ts): `src/storage/history-store.ts`

### Context retrieval

- [Export command](https://github.com/veeruveerendra05/ace/blob/main/src/commands/export.ts): `src/commands/export.ts`
- [Symbol retrieval](https://github.com/veeruveerendra05/ace/blob/main/src/structural/retriever.ts): `src/structural/retriever.ts`
- [Context fusion](https://github.com/veeruveerendra05/ace/blob/main/src/context/fusion.ts): `src/context/fusion.ts`
- [Prompt renderer](https://github.com/veeruveerendra05/ace/blob/main/src/context/render.ts): `src/context/render.ts`

### Evaluation

- [Oracle evaluation](https://github.com/veeruveerendra05/ace/blob/main/src/eval/oracle/evaluate.ts): `src/eval/oracle/evaluate.ts`
- [A/B evaluation](https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/runner.ts): `src/eval/ab/runner.ts`
- [LLM provider](https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/provider.ts): `src/eval/ab/provider.ts`
- [Evaluation reports](https://github.com/veeruveerendra05/ace/blob/main/src/eval/ab/report.ts): `src/eval/ab/report.ts`

### Other components

- **Engineer**
- **Configured LLM endpoint**

## Connections

- Engineer → CLI router: runs commands
- CLI router → Project commands: routes commands (evidence: `src/cli.ts`)
- Project commands → ACE scaffold: initializes state
- ACE scaffold → State utilities: resolves paths (evidence: `src/core/setup.ts`)
- Project commands → Cache updater: refreshes caches
- Cache updater → History tracker: tracks changes
- History tracker → AST extractor: extracts symbols (evidence: `src/history/tracker.ts`)
- History tracker → Symbol matcher: matches versions (evidence: `src/history/tracker.ts`)
- History tracker → Git access: walks history (evidence: `src/history/tracker.ts`)
- History tracker → Structural cache: writes index (evidence: `src/history/tracker.ts`)
- History tracker → History store: appends versions (evidence: `src/history/tracker.ts`)
- Export command → Context fusion: builds context (evidence: `src/commands/export.ts`)
- Context fusion → Structural cache: loads index (evidence: `src/context/fusion.ts`)
- Context fusion → Symbol retrieval: ranks symbols (evidence: `src/context/fusion.ts`)
- Context fusion → History store: retrieves history (evidence: `src/context/fusion.ts`)
- Context fusion → Git access: reads revisions (evidence: `src/context/fusion.ts`)
- Context fusion → Prompt renderer: renders prompt (evidence: `src/context/fusion.ts`)
- Export command → Engineer: returns package
- Project commands → Oracle evaluation: runs oracle (evidence: `src/commands/eval.ts`)
- Project commands → A/B evaluation: runs comparison (evidence: `src/commands/eval.ts`)
- A/B evaluation → LLM provider: queries provider (evidence: `src/eval/ab/runner.ts`)
- A/B evaluation → Context fusion: builds historical context (evidence: `src/eval/ab/runner.ts`)
- A/B evaluation → Evaluation reports: writes reports
- LLM provider → Configured LLM endpoint: calls when configured
- Oracle evaluation → History tracker: checks tracking (evidence: `src/eval/oracle/evaluate.ts`)
- State utilities → Domain types: uses schemas (evidence: `src/core/setup.ts`)
