# eddydeoleo/sean architecture

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

- Interactive diagram: https://gitdiagram.com/eddydeoleo/sean
- Repository: https://github.com/eddydeoleo/sean

## Overview

Sean is a local-first repository investigator with a horror-game presentation. Users register a local Git repository, submit a question, and receive an evidence-labelled report; the frontend can run the Ouija interlude and archive game during analysis, or launch the demo without the backend. The map includes the documented advisor and repository-management capabilities. Backend orchestration and frontend runtime links are grounded in the supplied index and excerpts; unsampled subsystems are included at supported paths, but uncertain internal calls are omitted.

Main entry points: [`frontend/src/app/App.tsx`](https://github.com/eddydeoleo/sean/blob/main/frontend/src/app/App.tsx) (App shell), [`frontend/src/features/analysis/useAnalysis.ts`](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/analysis/useAnalysis.ts) (Analysis orchestration), [`backend/app/modules/investigation/orchestrator.py`](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/investigation/orchestrator.py) (Investigation orchestrator), [`frontend/src/components/game/GameView.tsx`](https://github.com/eddydeoleo/sean/blob/main/frontend/src/components/game/GameView.tsx) (Archive game view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_analysis["Analysis orchestration<br/>[useAnalysis.ts]"]
  node_analysis_state["Analysis state<br/>[analysisMachine.ts]"]
  node_investigation_client["Investigation client"]
  node_advisor_client["Advisor client<br/>[advisorClient.ts]"]
  node_report["Report presentation<br/>[ReportView.tsx]"]
  node_report_snapshot["Report snapshot<br/>[reportSnapshot.ts]"]
end

subgraph group_investigation["Investigation"]
  node_backend_api["Investigation API<br/>[app.py]"]
  node_orchestrator["Investigation orchestrator<br/>[orchestrator.py]"]
  node_history["Git history and blame<br/>[history.py]"]
  node_git_runner["Guarded Git runner<br/>[git_runner.py]"]
  node_result["Evidence classification and result<br/>[result.py]"]
  node_answer["Answer service<br/>[service.py]"]
  node_groq["Optional AI wording<br/>[groq.py]"]
  node_github["GitHub metadata client<br/>[client.py]"]
end

subgraph group_repository["Repository intelligence"]
  node_advisor_routes["Advisor routes<br/>[advisor_routes.py]"]
  node_repository_routes["Repository routes"]
  node_registry[("Repository registry<br/>[registry.py]")]
  node_management["Repository management<br/>[management.py]"]
  node_profile["Repository profile scanner<br/>[scanner.py]"]
  node_advisor["Kiro advisor and roadmap<br/>[artifacts.py]"]
end

subgraph group_game["Horror experience"]
  node_game["Archive game view<br/>[GameView.tsx]"]
  node_world["Game world<br/>[world.ts]"]
  node_level["Game level<br/>[level.ts]"]
  node_renderer["Game renderer<br/>[renderer.ts]"]
  node_interlude["Ouija interlude"]
  node_audio["Procedural audio<br/>[AudioController.ts]"]
  node_settings["Experience settings<br/>[settingsStore.ts]"]
end

node_user(("User"))
node_groq_service{{"Groq API"}}
node_github_service{{"GitHub"}}

node_user -->|"uses"| node_app
node_app -->|"starts analysis"| node_analysis
node_analysis -->|"dispatches state"| node_analysis_state
node_analysis -->|"submits investigation"| node_investigation_client
node_analysis -->|"requests profile"| node_advisor_client
node_analysis -->|"finalizes snapshot"| node_report_snapshot
node_investigation_client -->|"POSTs investigation"| node_backend_api
node_advisor_client -->|"calls API"| node_advisor_routes
node_backend_api -->|"runs investigation"| node_orchestrator
node_backend_api -->|"creates answer"| node_answer
node_orchestrator -->|"resolves repository"| node_registry
node_orchestrator -->|"retrieves history"| node_history
node_orchestrator -->|"runs Git"| node_git_runner
node_orchestrator -->|"assembles result"| node_result
node_answer -->|"requests wording"| node_groq
node_groq -.->|"calls optionally"| node_groq_service
node_github -.->|"fetches metadata"| node_github_service
node_repository_routes -->|"changes registration"| node_management
node_repository_routes -->|"reloads registry"| node_registry
node_advisor_routes -->|"resolves repository"| node_registry
node_advisor_routes -->|"scans repository"| node_profile
node_advisor_routes -->|"builds advice"| node_advisor
node_report_snapshot -.->|"supplies report"| node_report
node_app -->|"shows interlude"| node_interlude
node_app -->|"renders game"| node_game
node_game -->|"uses world"| node_world
node_game -->|"uses level"| node_level
node_game -->|"uses renderer"| node_renderer
node_world -->|"loads report clues"| node_report_snapshot
node_app -->|"loads settings"| node_settings
node_user -->|"plays demo"| node_game
node_user -->|"manages repositories"| node_repository_routes
node_user -->|"views findings"| node_report

click node_app "https://github.com/eddydeoleo/sean/blob/main/frontend/src/app/App.tsx"
click node_analysis "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/analysis/useAnalysis.ts"
click node_analysis_state "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/analysis/analysisMachine.ts"
click node_investigation_client "https://github.com/eddydeoleo/sean/blob/main/frontend/src/services/investigationClient.ts"
click node_advisor_client "https://github.com/eddydeoleo/sean/blob/main/frontend/src/services/advisorClient.ts"
click node_report "https://github.com/eddydeoleo/sean/blob/main/frontend/src/components/report/ReportView.tsx"
click node_report_snapshot "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/report/reportSnapshot.ts"
click node_backend_api "https://github.com/eddydeoleo/sean/blob/main/backend/app/api/app.py"
click node_advisor_routes "https://github.com/eddydeoleo/sean/blob/main/backend/app/api/advisor_routes.py"
click node_repository_routes "https://github.com/eddydeoleo/sean/blob/main/backend/app/api/repository_routes.py"
click node_orchestrator "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/investigation/orchestrator.py"
click node_history "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/git_history/history.py"
click node_git_runner "https://github.com/eddydeoleo/sean/blob/main/backend/app/core/git_runner.py"
click node_result "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/investigation/result.py"
click node_answer "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/answer/service.py"
click node_groq "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/intent/groq.py"
click node_github "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/github/client.py"
click node_registry "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/repository/registry.py"
click node_management "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/repository/management.py"
click node_profile "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/repository_profile/scanner.py"
click node_advisor "https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/advisor/artifacts.py"
click node_game "https://github.com/eddydeoleo/sean/blob/main/frontend/src/components/game/GameView.tsx"
click node_world "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/game/world.ts"
click node_level "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/game/level.ts"
click node_renderer "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/game/renderer.ts"
click node_interlude "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/interlude/interludeMachine.ts"
click node_audio "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/audio/AudioController.ts"
click node_settings "https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/experience/settingsStore.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_app,node_analysis,node_analysis_state,node_investigation_client,node_advisor_client,node_report,node_report_snapshot,node_user toneBlue
class node_backend_api,node_orchestrator,node_history,node_git_runner,node_result,node_answer,node_groq,node_github toneAmber
class node_advisor_routes,node_repository_routes,node_registry,node_management,node_profile,node_advisor,node_groq_service toneMint
class node_game,node_world,node_level,node_renderer,node_interlude,node_audio,node_settings toneRose
class node_github_service toneIndigo
```

## Components

### Frontend experience

- [App shell](https://github.com/eddydeoleo/sean/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Analysis orchestration](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/analysis/useAnalysis.ts): `frontend/src/features/analysis/useAnalysis.ts`
- [Analysis state](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/analysis/analysisMachine.ts): `frontend/src/features/analysis/analysisMachine.ts`
- [Investigation client](https://github.com/eddydeoleo/sean/blob/main/frontend/src/services/investigationClient.ts): `frontend/src/services/investigationClient.ts`
- [Advisor client](https://github.com/eddydeoleo/sean/blob/main/frontend/src/services/advisorClient.ts): `frontend/src/services/advisorClient.ts`
- [Report presentation](https://github.com/eddydeoleo/sean/blob/main/frontend/src/components/report/ReportView.tsx): `frontend/src/components/report/ReportView.tsx`
- [Report snapshot](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/report/reportSnapshot.ts): `frontend/src/features/report/reportSnapshot.ts`

### Investigation

- [Investigation API](https://github.com/eddydeoleo/sean/blob/main/backend/app/api/app.py): `backend/app/api/app.py`
- [Investigation orchestrator](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/investigation/orchestrator.py): `backend/app/modules/investigation/orchestrator.py`
- [Git history and blame](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/git_history/history.py): `backend/app/modules/git_history/history.py`
- [Guarded Git runner](https://github.com/eddydeoleo/sean/blob/main/backend/app/core/git_runner.py): `backend/app/core/git_runner.py`
- [Evidence classification and result](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/investigation/result.py): `backend/app/modules/investigation/result.py`
- [Answer service](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/answer/service.py): `backend/app/modules/answer/service.py`
- [Optional AI wording](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/intent/groq.py): `backend/app/modules/intent/groq.py`
- [GitHub metadata client](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/github/client.py): `backend/app/modules/github/client.py`

### Repository intelligence

- [Advisor routes](https://github.com/eddydeoleo/sean/blob/main/backend/app/api/advisor_routes.py): `backend/app/api/advisor_routes.py`
- [Repository routes](https://github.com/eddydeoleo/sean/blob/main/backend/app/api/repository_routes.py): `backend/app/api/repository_routes.py`
- [Repository registry](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/repository/registry.py): `backend/app/modules/repository/registry.py`
- [Repository management](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/repository/management.py): `backend/app/modules/repository/management.py`
- [Repository profile scanner](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/repository_profile/scanner.py): `backend/app/modules/repository_profile/scanner.py`
- [Kiro advisor and roadmap](https://github.com/eddydeoleo/sean/blob/main/backend/app/modules/advisor/artifacts.py): `backend/app/modules/advisor/artifacts.py`

### Horror experience

- [Archive game view](https://github.com/eddydeoleo/sean/blob/main/frontend/src/components/game/GameView.tsx): `frontend/src/components/game/GameView.tsx`
- [Game world](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/game/world.ts): `frontend/src/features/game/world.ts`
- [Game level](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/game/level.ts): `frontend/src/features/game/level.ts`
- [Game renderer](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/game/renderer.ts): `frontend/src/features/game/renderer.ts`
- [Ouija interlude](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/interlude/interludeMachine.ts): `frontend/src/features/interlude/interludeMachine.ts`
- [Procedural audio](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/audio/AudioController.ts): `frontend/src/features/audio/AudioController.ts`
- [Experience settings](https://github.com/eddydeoleo/sean/blob/main/frontend/src/features/experience/settingsStore.ts): `frontend/src/features/experience/settingsStore.ts`

### Other components

- **User**
- **Groq API**
- **GitHub**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Analysis orchestration: starts analysis (evidence: `frontend/src/app/App.tsx`)
- Analysis orchestration → Analysis state: dispatches state (evidence: `frontend/src/features/analysis/useAnalysis.ts`)
- Analysis orchestration → Investigation client: submits investigation (evidence: `frontend/src/features/analysis/useAnalysis.ts`)
- Analysis orchestration → Advisor client: requests profile (evidence: `frontend/src/features/analysis/useAnalysis.ts`)
- Analysis orchestration → Report snapshot: finalizes snapshot (evidence: `frontend/src/features/analysis/useAnalysis.ts`)
- Investigation client → Investigation API: POSTs investigation (evidence: `frontend/src/services/investigationClient.ts`)
- Advisor client → Advisor routes: calls API (evidence: `frontend/src/services/advisorClient.ts`)
- Investigation API → Investigation orchestrator: runs investigation (evidence: `backend/app/api/app.py`)
- Investigation API → Answer service: creates answer
- Investigation orchestrator → Repository registry: resolves repository (evidence: `backend/app/modules/investigation/orchestrator.py`)
- Investigation orchestrator → Git history and blame: retrieves history (evidence: `backend/app/modules/investigation/orchestrator.py`)
- Investigation orchestrator → Guarded Git runner: runs Git (evidence: `backend/app/modules/investigation/orchestrator.py`)
- Investigation orchestrator → Evidence classification and result: assembles result (evidence: `backend/app/modules/investigation/orchestrator.py`)
- Answer service → Optional AI wording: requests wording (evidence: `backend/app/modules/answer/service.py`)
- Optional AI wording → Groq API: calls optionally (evidence: `README.md`)
- GitHub metadata client → GitHub: fetches metadata (evidence: `README.md`)
- Repository routes → Repository management: changes registration (evidence: `backend/app/api/repository_routes.py`)
- Repository routes → Repository registry: reloads registry (evidence: `backend/app/api/repository_routes.py`)
- Advisor routes → Repository registry: resolves repository (evidence: `backend/app/api/advisor_routes.py`)
- Advisor routes → Repository profile scanner: scans repository (evidence: `backend/app/api/advisor_routes.py`)
- Advisor routes → Kiro advisor and roadmap: builds advice (evidence: `backend/app/api/advisor_routes.py`)
- Report snapshot → Report presentation: supplies report
- App shell → Ouija interlude: shows interlude (evidence: `frontend/src/app/App.tsx`)
- App shell → Archive game view: renders game (evidence: `frontend/src/main.tsx`)
- Archive game view → Game world: uses world (evidence: `frontend/src/components/game/GameView.tsx`)
- Archive game view → Game level: uses level (evidence: `frontend/src/components/game/GameView.tsx`)
- Archive game view → Game renderer: uses renderer (evidence: `frontend/src/components/game/GameView.tsx`)
- Game world → Report snapshot: loads report clues (evidence: `frontend/src/features/game/world.ts`)
- App shell → Experience settings: loads settings (evidence: `frontend/src/app/App.tsx`)
- User → Archive game view: plays demo (evidence: `README.md`)
- User → Repository routes: manages repositories (evidence: `README.md`)
- User → Report presentation: views findings (evidence: `README.md`)
