# kartik-idk/accessaudit architecture

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

- Interactive diagram: https://gitdiagram.com/kartik-idk/accessaudit
- Repository: https://github.com/kartik-idk/accessaudit

## Overview

AccessAudit is a research prototype for AI-assisted accessibility remediation, with an interactive audit workflow and offline model benchmarks. The documented end-to-end path starts with browser/Axe violations, localizes them to source, obtains a constrained proposal, validates it, patches source, and verifies the result. The README documents this sequence; sampled code confirms the proposal gatekeeper and source write, but does not expose all runtime wiring, so unsampled stages use the enclosing `scripts` path and uncertain calls are omitted.

Main entry points: [`scripts`](https://github.com/kartik-idk/accessaudit/tree/main/scripts) (Browser Runner), [`src/main.tsx`](https://github.com/kartik-idk/accessaudit/blob/main/src/main.tsx) (Mode Router), [`src/components/PrototypeUI.tsx`](https://github.com/kartik-idk/accessaudit/blob/main/src/components/PrototypeUI.tsx) (Prototype UI), [`scripts/pipeline_v6.js`](https://github.com/kartik-idk/accessaudit/blob/main/scripts/pipeline_v6.js) (Proposal Gatekeeper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_app["Mode Router<br/>[main.tsx]"]
  node_prototype["Prototype UI<br/>[PrototypeUI.tsx]"]
end

subgraph group_detection["Audit and Localization"]
  node_audit_api["Audit Service"]
  node_browser["Browser Runner"]
  node_axe["Axe Scanner"]
  node_violation["DOM Violation"]
  node_provenance["Source Provenance"]
  node_context["Localized Context"]
end

subgraph group_remediation["Proposal and Patching"]
  node_model["LLM Proposal"]
  node_validator["Proposal Gatekeeper<br/>[pipeline_v6.js]"]
  node_patcher["Source Patcher<br/>[pipeline_v6.js]"]
  node_source["Target Source"]
end

subgraph group_evaluation["Verification and Research"]
  node_build["Build Check"]
  node_verify["Axe Verification"]
  node_benchmark["Model Benchmarks<br/>[run_task30.py]"]
end

node_user(("Engineer"))
node_ollama["Ollama"]
node_playwright["Playwright"]

node_user -->|"select mode"| node_app
node_app -->|"renders"| node_prototype
node_prototype -->|"requests audit"| node_audit_api
node_audit_api -->|"runs audit"| node_browser
node_browser -->|"drives browser"| node_playwright
node_browser -->|"scans page"| node_axe
node_axe -->|"reports violation"| node_violation
node_violation -->|"localizes source"| node_provenance
node_provenance -->|"extracts context"| node_context
node_context -->|"provides context"| node_model
node_model -.->|"requests proposal"| node_ollama
node_model -->|"submits proposal"| node_validator
node_validator -->|"accepts proposal"| node_patcher
node_patcher -->|"writes patch"| node_source
node_source -->|"builds source"| node_build
node_build -->|"enables verification"| node_verify
node_verify -->|"checks outcome"| node_axe
node_benchmark -.->|"evaluates models"| node_ollama

click node_app "https://github.com/kartik-idk/accessaudit/blob/main/src/main.tsx"
click node_prototype "https://github.com/kartik-idk/accessaudit/blob/main/src/components/PrototypeUI.tsx"
click node_audit_api "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_browser "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_axe "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_violation "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_provenance "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_context "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_model "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_validator "https://github.com/kartik-idk/accessaudit/blob/main/scripts/pipeline_v6.js"
click node_patcher "https://github.com/kartik-idk/accessaudit/blob/main/scripts/pipeline_v6.js"
click node_build "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_verify "https://github.com/kartik-idk/accessaudit/tree/main/scripts"
click node_benchmark "https://github.com/kartik-idk/accessaudit/blob/main/experiments/task30_base_vs_finetuned/run_task30.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_app,node_prototype toneBlue
class node_audit_api,node_browser,node_axe,node_violation,node_provenance,node_context toneAmber
class node_model,node_validator,node_patcher,node_source toneMint
class node_build,node_verify,node_benchmark toneRose
class node_user,node_ollama,node_playwright toneIndigo
```

## Components

### User Experience

- [Mode Router](https://github.com/kartik-idk/accessaudit/blob/main/src/main.tsx): `src/main.tsx`
- [Prototype UI](https://github.com/kartik-idk/accessaudit/blob/main/src/components/PrototypeUI.tsx): `src/components/PrototypeUI.tsx`

### Audit and Localization

- [Audit Service](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Browser Runner](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Axe Scanner](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [DOM Violation](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Source Provenance](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Localized Context](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`

### Proposal and Patching

- [LLM Proposal](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Proposal Gatekeeper](https://github.com/kartik-idk/accessaudit/blob/main/scripts/pipeline_v6.js): `scripts/pipeline_v6.js`
- [Source Patcher](https://github.com/kartik-idk/accessaudit/blob/main/scripts/pipeline_v6.js): `scripts/pipeline_v6.js`
- **Target Source**

### Verification and Research

- [Build Check](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Axe Verification](https://github.com/kartik-idk/accessaudit/tree/main/scripts): `scripts`
- [Model Benchmarks](https://github.com/kartik-idk/accessaudit/blob/main/experiments/task30_base_vs_finetuned/run_task30.py): `experiments/task30_base_vs_finetuned/run_task30.py`

### Other components

- **Engineer**
- **Ollama**
- **Playwright**

## Connections

- Engineer → Mode Router: select mode
- Mode Router → Prototype UI: renders
- Prototype UI → Audit Service: requests audit
- Audit Service → Browser Runner: runs audit
- Browser Runner → Playwright: drives browser
- Browser Runner → Axe Scanner: scans page
- Axe Scanner → DOM Violation: reports violation
- DOM Violation → Source Provenance: localizes source
- Source Provenance → Localized Context: extracts context
- Localized Context → LLM Proposal: provides context
- LLM Proposal → Ollama: requests proposal
- LLM Proposal → Proposal Gatekeeper: submits proposal
- Proposal Gatekeeper → Source Patcher: accepts proposal
- Source Patcher → Target Source: writes patch
- Target Source → Build Check: builds source
- Build Check → Axe Verification: enables verification
- Axe Verification → Axe Scanner: checks outcome
- Model Benchmarks → Ollama: evaluates models
