# lee-dongwook/e2e-self-heal architecture

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

- Interactive diagram: https://gitdiagram.com/lee-dongwook/e2e-self-heal
- Repository: https://github.com/lee-dongwook/e2e-self-heal

## Overview

This repository is an AI-driven Playwright E2E self-healing engine, with a separate result-ingestion API and status UI. The primary workflow starts at the CLI: preprocess failure and diff context, run a LangGraph diagnosis-and-repair loop, verify candidate locators, rerun tests, and emit a heal result; review mode produces source-level advice instead. Shadow testing and the optional CI upload path are additional capabilities. Some subsystem links reflect README documentation; unsampled implementation details are not inferred.

Main entry points: [`app/graph.py`](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/graph.py) (Repair graph), [`app/cli.py`](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/cli.py) (CLI workflow), [`app/preprocess`](https://github.com/lee-dongwook/e2e-self-heal/tree/main/app/preprocess) (Failure preprocessing), [`app/llm.py`](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/llm.py) (LLM client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_cli["CLI workflow<br/>[cli.py]"]
  node_preprocess["Failure preprocessing"]
  node_error_parser["Log parser"]
  node_diff_analyzer["Diff analyzer"]
  node_aria_snapshot["ARIA snapshot<br/>[aria_snapshot.py]"]
end

subgraph group_repair["Repair workflow"]
  node_agent_graph["Repair graph<br/>[graph.py]"]
  node_agent_state["Loop state<br/>[state.py]"]
  node_diagnoser["Diagnoser<br/>[diagnoser.py]"]
  node_patch_generator["Patch generator<br/>[patch_generator.py]"]
  node_selector_verifier["Selector verifier"]
  node_test_runner["Test runner<br/>[runner.py]"]
  node_reviewer["Review mode<br/>[reviewer.py]"]
  node_llm["LLM client<br/>[llm.py]"]
  node_ast_lock["AST safety lock<br/>[ast_lock.py]"]
  node_sandbox["Sandbox policy<br/>[sandbox.py]"]
  node_orcarouter["OrcaRouter provider<br/>[orcarouter.py]"]
end

subgraph group_shadow["Shadow testing"]
  node_shadow_runtime["Shadow runtime<br/>[runtime.py]"]
  node_trace_parser["Trace parser<br/>[trace_parser.py]"]
  node_har_parser["HAR parser<br/>[har_parser.py]"]
  node_snapshot_store[("Snapshot storage<br/>[snapshot_store.py]")]
end

subgraph group_results["Results and integrations"]
  node_report_generator["Report generator<br/>[generator.ts]"]
  node_action_reporter["Playwright reporter<br/>[index.ts]"]
  node_product_api["Result API<br/>[main.py]"]
  node_ingest["Run ingestion<br/>[ingest.py]"]
  node_run_database[("Run database<br/>[db.py]")]
  node_product_web["Status UI<br/>[App.tsx]"]
end

node_user(("Engineer or CI"))
node_service["Playwright and LLM services"]

node_user -->|"starts"| node_cli
node_cli -->|"prepares context"| node_preprocess
node_preprocess -->|"parses logs"| node_error_parser
node_preprocess -->|"analyzes diff"| node_diff_analyzer
node_preprocess -.->|"captures DOM context"| node_aria_snapshot
node_cli -->|"runs workflow"| node_agent_graph
node_agent_graph -->|"dispatches"| node_diagnoser
node_agent_graph -->|"dispatches"| node_patch_generator
node_agent_graph -->|"dispatches"| node_selector_verifier
node_agent_graph -->|"dispatches"| node_reviewer
node_agent_graph -->|"runs tests"| node_test_runner
node_agent_graph -->|"tracks loop state"| node_agent_state
node_reviewer -->|"requests suggestions"| node_llm
node_cli -->|"invokes"| node_shadow_runtime
node_har_parser -->|"uses trace parser"| node_trace_parser
node_cli -.->|"generates report"| node_report_generator
node_action_reporter -.->|"uploads results"| node_product_api
node_product_api -->|"routes uploads"| node_ingest
node_ingest -->|"persists runs"| node_run_database
node_product_web -->|"fetches status"| node_product_api
node_llm -->|"calls provider"| node_service
node_test_runner -->|"runs Playwright"| node_service
node_selector_verifier -->|"checks live DOM"| node_service
node_llm -->|"supports optional provider"| node_orcarouter
node_patch_generator -.->|"checks patch safety"| node_ast_lock
node_cli -->|"uses access policy"| node_sandbox

click node_cli "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/cli.py"
click node_preprocess "https://github.com/lee-dongwook/e2e-self-heal/tree/main/app/preprocess"
click node_error_parser "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/preprocess/error_log_parser.py"
click node_diff_analyzer "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/preprocess/diff_ast_analyzer.py"
click node_aria_snapshot "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/preprocess/aria_snapshot.py"
click node_agent_graph "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/graph.py"
click node_agent_state "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/state.py"
click node_diagnoser "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/diagnoser.py"
click node_patch_generator "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/patch_generator.py"
click node_selector_verifier "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/selector_verifier.py"
click node_test_runner "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/runner.py"
click node_reviewer "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/reviewer.py"
click node_llm "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/llm.py"
click node_ast_lock "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/verify/ast_lock.py"
click node_sandbox "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/sandbox.py"
click node_shadow_runtime "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/runtime.py"
click node_trace_parser "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/trace_parser.py"
click node_har_parser "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/har_parser.py"
click node_snapshot_store "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/snapshot_store.py"
click node_report_generator "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/core/report/generator.ts"
click node_action_reporter "https://github.com/lee-dongwook/e2e-self-heal/blob/main/integrations/playwright-reporter/src/index.ts"
click node_product_api "https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/api/src/product_api/main.py"
click node_ingest "https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/api/src/product_api/ingest.py"
click node_run_database "https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/api/src/product_api/db.py"
click node_product_web "https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/web/src/App.tsx"
click node_orcarouter "https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/providers/orcarouter.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_cli,node_preprocess,node_error_parser,node_diff_analyzer,node_aria_snapshot toneBlue
class node_agent_graph,node_agent_state,node_diagnoser,node_patch_generator,node_selector_verifier,node_test_runner,node_reviewer,node_llm,node_ast_lock,node_sandbox,node_orcarouter toneAmber
class node_shadow_runtime,node_trace_parser,node_har_parser,node_snapshot_store toneMint
class node_report_generator,node_action_reporter,node_product_api,node_ingest,node_run_database,node_product_web toneRose
class node_user,node_service toneIndigo
```

## Components

### Entry and orchestration

- [CLI workflow](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/cli.py): `app/cli.py`
- [Failure preprocessing](https://github.com/lee-dongwook/e2e-self-heal/tree/main/app/preprocess): `app/preprocess`
- [Log parser](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/preprocess/error_log_parser.py): `app/preprocess/error_log_parser.py`
- [Diff analyzer](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/preprocess/diff_ast_analyzer.py): `app/preprocess/diff_ast_analyzer.py`
- [ARIA snapshot](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/preprocess/aria_snapshot.py): `app/preprocess/aria_snapshot.py`

### Repair workflow

- [Repair graph](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/graph.py): `app/graph.py`
- [Loop state](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/state.py): `app/state.py`
- [Diagnoser](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/diagnoser.py): `app/nodes/diagnoser.py`
- [Patch generator](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/patch_generator.py): `app/nodes/patch_generator.py`
- [Selector verifier](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/selector_verifier.py): `app/nodes/selector_verifier.py`
- [Test runner](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/runner.py): `app/runner.py`
- [Review mode](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/nodes/reviewer.py): `app/nodes/reviewer.py`
- [LLM client](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/llm.py): `app/llm.py`
- [AST safety lock](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/verify/ast_lock.py): `app/verify/ast_lock.py`
- [Sandbox policy](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/sandbox.py): `app/sandbox.py`
- [OrcaRouter provider](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/providers/orcarouter.py): `app/providers/orcarouter.py`

### Shadow testing

- [Shadow runtime](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/runtime.py): `app/shadow/runtime.py`
- [Trace parser](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/trace_parser.py): `app/shadow/trace_parser.py`
- [HAR parser](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/har_parser.py): `app/shadow/har_parser.py`
- [Snapshot storage](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/shadow/snapshot_store.py): `app/shadow/snapshot_store.py`

### Results and integrations

- [Report generator](https://github.com/lee-dongwook/e2e-self-heal/blob/main/app/core/report/generator.ts): `app/core/report/generator.ts`
- [Playwright reporter](https://github.com/lee-dongwook/e2e-self-heal/blob/main/integrations/playwright-reporter/src/index.ts): `integrations/playwright-reporter/src/index.ts`
- [Result API](https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/api/src/product_api/main.py): `product/api/src/product_api/main.py`
- [Run ingestion](https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/api/src/product_api/ingest.py): `product/api/src/product_api/ingest.py`
- [Run database](https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/api/src/product_api/db.py): `product/api/src/product_api/db.py`
- [Status UI](https://github.com/lee-dongwook/e2e-self-heal/blob/main/product/web/src/App.tsx): `product/web/src/App.tsx`

### Other components

- **Engineer or CI**
- **Playwright and LLM services**

## Connections

- Engineer or CI → CLI workflow: starts (evidence: `README.md`)
- CLI workflow → Failure preprocessing: prepares context (evidence: `README.md`)
- Failure preprocessing → Log parser: parses logs (evidence: `README.md`)
- Failure preprocessing → Diff analyzer: analyzes diff (evidence: `README.md`)
- Failure preprocessing → ARIA snapshot: captures DOM context
- CLI workflow → Repair graph: runs workflow (evidence: `app/cli.py`)
- Repair graph → Diagnoser: dispatches (evidence: `app/graph.py`)
- Repair graph → Patch generator: dispatches (evidence: `app/graph.py`)
- Repair graph → Selector verifier: dispatches (evidence: `app/graph.py`)
- Repair graph → Review mode: dispatches (evidence: `app/graph.py`)
- Repair graph → Test runner: runs tests (evidence: `README.md`)
- Repair graph → Loop state: tracks loop state (evidence: `app/graph.py`)
- Review mode → LLM client: requests suggestions (evidence: `app/nodes/reviewer.py`)
- CLI workflow → Shadow runtime: invokes (evidence: `app/cli.py`)
- HAR parser → Trace parser: uses trace parser (evidence: `app/shadow/har_parser.py`)
- CLI workflow → Report generator: generates report
- Playwright reporter → Result API: uploads results (evidence: `README.md`)
- Result API → Run ingestion: routes uploads (evidence: `product/api/src/product_api/main.py`)
- Run ingestion → Run database: persists runs (evidence: `product/api/src/product_api/ingest.py`)
- Status UI → Result API: fetches status (evidence: `product/web/src/App.tsx`)
- LLM client → Playwright and LLM services: calls provider (evidence: `app/llm.py`)
- Test runner → Playwright and LLM services: runs Playwright (evidence: `README.md`)
- Selector verifier → Playwright and LLM services: checks live DOM (evidence: `README.md`)
- LLM client → OrcaRouter provider: supports optional provider (evidence: `app/llm.py`)
- Patch generator → AST safety lock: checks patch safety
- CLI workflow → Sandbox policy: uses access policy (evidence: `app/cli.py`)
