# aaronxyliu/recall architecture

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

## Overview

ReCall recovers original library functions from production JavaScript bundles. The main workflow prepares source and bundle inventories, establishes POG anchors and relationship graphs, then propagates matches using AST checks followed by embedding-ranked model validation. It also supports catalog-based reference selection and optional browser capture. The graph reflects documented stages and sampled calls; unsampled runtime details are omitted where their wiring cannot be verified.

Main entry points: [`components/pipeline/index.mjs`](https://github.com/aaronxyliu/recall/blob/main/components/pipeline/index.mjs) (Recovery pipeline), [`src/workflow/run.mjs`](https://github.com/aaronxyliu/recall/blob/main/src/workflow/run.mjs) (Run orchestration), [`bin/components.mjs`](https://github.com/aaronxyliu/recall/blob/main/bin/components.mjs) (CLI commands), [`src/workflow/inputs.mjs`](https://github.com/aaronxyliu/recall/blob/main/src/workflow/inputs.mjs) (Input preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Run workflow"]
  node_cli["CLI commands<br/>[components.mjs]"]
  node_run["Run orchestration<br/>[run.mjs]"]
  node_preflight["Preflight checks<br/>[preflight.mjs]"]
  node_config["Configuration<br/>[config.mjs]"]
end

subgraph group_inputs["Input preparation"]
  node_input_prep["Input preparation<br/>[inputs.mjs]"]
  node_project["Function inventory<br/>[project.mjs]"]
end

subgraph group_analysis["Structural analysis"]
  node_pog["POG anchors<br/>[index.mjs]"]
  node_bundler["Bundler detection<br/>[index.mjs]"]
  node_recognition["Runtime recognition<br/>[recognize.mjs]"]
  node_module_resolution["Module resolution<br/>[index.mjs]"]
  node_module_solver["Value-flow solver<br/>[analyzer.mjs]"]
  node_graph["Relationship graphs<br/>[index.mjs]"]
end

subgraph group_recovery["Function recovery"]
  node_pipeline["Recovery pipeline<br/>[index.mjs]"]
  node_ast_match["AST matching<br/>[ast-match.mjs]"]
  node_models["Embedding and validation<br/>[models.mjs]"]
end

subgraph group_support["Capture and artifacts"]
  node_capture["Browser capture<br/>[index.mjs]"]
  node_artifacts[("Artifact storage<br/>[artifacts.mjs]")]
end

node_user(("Engineer"))
node_ollama(("Ollama service"))

node_user -->|"runs commands"| node_cli
node_cli -->|"starts run"| node_run
node_run -->|"checks readiness"| node_preflight
node_run -->|"prepares inputs"| node_input_prep
node_input_prep -->|"builds inventories"| node_project
node_input_prep -->|"extracts features"| node_pog
node_pipeline -->|"identifies anchors"| node_pog
node_pipeline -->|"detects bundlers"| node_bundler
node_pipeline -->|"resolves modules"| node_module_resolution
node_module_resolution -->|"analyzes modules"| node_module_solver
node_pipeline -->|"builds graphs"| node_graph
node_bundler -->|"recognizes runtimes"| node_recognition
node_pipeline -->|"checks ASTs"| node_ast_match
node_pipeline -->|"ranks and validates"| node_models
node_models -.->|"requests models"| node_ollama
node_cli -->|"captures pages"| node_capture
node_run -->|"saves run data"| node_artifacts
node_cli -->|"normalizes settings"| node_config
node_run -->|"recovers functions"| node_pipeline
node_input_prep -->|"reads inventories"| node_artifacts
node_pipeline -.->|"persists recovery"| node_artifacts

click node_cli "https://github.com/aaronxyliu/recall/blob/main/bin/components.mjs"
click node_run "https://github.com/aaronxyliu/recall/blob/main/src/workflow/run.mjs"
click node_preflight "https://github.com/aaronxyliu/recall/blob/main/src/workflow/preflight.mjs"
click node_input_prep "https://github.com/aaronxyliu/recall/blob/main/src/workflow/inputs.mjs"
click node_project "https://github.com/aaronxyliu/recall/blob/main/src/project.mjs"
click node_pog "https://github.com/aaronxyliu/recall/blob/main/components/pog/index.mjs"
click node_bundler "https://github.com/aaronxyliu/recall/blob/main/components/bundler/index.mjs"
click node_recognition "https://github.com/aaronxyliu/recall/blob/main/src/engine/recognize.mjs"
click node_module_resolution "https://github.com/aaronxyliu/recall/blob/main/components/modules/index.mjs"
click node_module_solver "https://github.com/aaronxyliu/recall/blob/main/src/engine/analyzer.mjs"
click node_graph "https://github.com/aaronxyliu/recall/blob/main/components/graph/index.mjs"
click node_pipeline "https://github.com/aaronxyliu/recall/blob/main/components/pipeline/index.mjs"
click node_ast_match "https://github.com/aaronxyliu/recall/blob/main/src/analysis/ast-match.mjs"
click node_models "https://github.com/aaronxyliu/recall/blob/main/components/pipeline/models.mjs"
click node_capture "https://github.com/aaronxyliu/recall/blob/main/components/capture/index.mjs"
click node_artifacts "https://github.com/aaronxyliu/recall/blob/main/src/shared/artifacts.mjs"
click node_config "https://github.com/aaronxyliu/recall/blob/main/src/config.mjs"

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_run,node_preflight,node_config toneBlue
class node_input_prep,node_project toneAmber
class node_pog,node_bundler,node_recognition,node_module_resolution,node_module_solver,node_graph toneMint
class node_pipeline,node_ast_match,node_models toneRose
class node_capture,node_artifacts,node_user,node_ollama toneIndigo
```

## Components

### Run workflow

- [CLI commands](https://github.com/aaronxyliu/recall/blob/main/bin/components.mjs): `bin/components.mjs`
- [Run orchestration](https://github.com/aaronxyliu/recall/blob/main/src/workflow/run.mjs): `src/workflow/run.mjs`
- [Preflight checks](https://github.com/aaronxyliu/recall/blob/main/src/workflow/preflight.mjs): `src/workflow/preflight.mjs`
- [Configuration](https://github.com/aaronxyliu/recall/blob/main/src/config.mjs): `src/config.mjs`

### Input preparation

- [Input preparation](https://github.com/aaronxyliu/recall/blob/main/src/workflow/inputs.mjs): `src/workflow/inputs.mjs`
- [Function inventory](https://github.com/aaronxyliu/recall/blob/main/src/project.mjs): `src/project.mjs`

### Structural analysis

- [POG anchors](https://github.com/aaronxyliu/recall/blob/main/components/pog/index.mjs): `components/pog/index.mjs`
- [Bundler detection](https://github.com/aaronxyliu/recall/blob/main/components/bundler/index.mjs): `components/bundler/index.mjs`
- [Runtime recognition](https://github.com/aaronxyliu/recall/blob/main/src/engine/recognize.mjs): `src/engine/recognize.mjs`
- [Module resolution](https://github.com/aaronxyliu/recall/blob/main/components/modules/index.mjs): `components/modules/index.mjs`
- [Value-flow solver](https://github.com/aaronxyliu/recall/blob/main/src/engine/analyzer.mjs): `src/engine/analyzer.mjs`
- [Relationship graphs](https://github.com/aaronxyliu/recall/blob/main/components/graph/index.mjs): `components/graph/index.mjs`

### Function recovery

- [Recovery pipeline](https://github.com/aaronxyliu/recall/blob/main/components/pipeline/index.mjs): `components/pipeline/index.mjs`
- [AST matching](https://github.com/aaronxyliu/recall/blob/main/src/analysis/ast-match.mjs): `src/analysis/ast-match.mjs`
- [Embedding and validation](https://github.com/aaronxyliu/recall/blob/main/components/pipeline/models.mjs): `components/pipeline/models.mjs`

### Capture and artifacts

- [Browser capture](https://github.com/aaronxyliu/recall/blob/main/components/capture/index.mjs): `components/capture/index.mjs`
- [Artifact storage](https://github.com/aaronxyliu/recall/blob/main/src/shared/artifacts.mjs): `src/shared/artifacts.mjs`

### Other components

- **Engineer**
- **Ollama service**

## Connections

- Engineer → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Run orchestration: starts run (evidence: `bin/components.mjs`)
- Run orchestration → Preflight checks: checks readiness (evidence: `src/workflow/run.mjs`)
- Run orchestration → Input preparation: prepares inputs (evidence: `src/workflow/run.mjs`)
- Input preparation → Function inventory: builds inventories (evidence: `src/workflow/inputs.mjs`)
- Input preparation → POG anchors: extracts features (evidence: `src/workflow/inputs.mjs`)
- Recovery pipeline → POG anchors: identifies anchors (evidence: `components/pipeline/index.mjs`)
- Recovery pipeline → Bundler detection: detects bundlers (evidence: `components/pipeline/index.mjs`)
- Recovery pipeline → Module resolution: resolves modules (evidence: `components/pipeline/index.mjs`)
- Module resolution → Value-flow solver: analyzes modules (evidence: `components/modules/index.mjs`)
- Recovery pipeline → Relationship graphs: builds graphs (evidence: `components/pipeline/index.mjs`)
- Bundler detection → Runtime recognition: recognizes runtimes (evidence: `components/bundler/index.mjs`)
- Recovery pipeline → AST matching: checks ASTs (evidence: `components/pipeline/index.mjs`)
- Recovery pipeline → Embedding and validation: ranks and validates (evidence: `components/pipeline/index.mjs`)
- Embedding and validation → Ollama service: requests models (evidence: `README.md`)
- CLI commands → Browser capture: captures pages (evidence: `bin/components.mjs`)
- Run orchestration → Artifact storage: saves run data (evidence: `src/workflow/run.mjs`)
- CLI commands → Configuration: normalizes settings (evidence: `bin/components.mjs`)
- Run orchestration → Recovery pipeline: recovers functions (evidence: `README.md`)
- Input preparation → Artifact storage: reads inventories (evidence: `src/workflow/inputs.mjs`)
- Recovery pipeline → Artifact storage: persists recovery (evidence: `components/pipeline/index.mjs`)
