# gdiab/x-conversation-finder architecture

> Architecture diagram of the GitHub repository gdiab/x-conversation-finder, 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/gdiab/x-conversation-finder
- Repository: https://github.com/gdiab/x-conversation-finder

## Overview

X Conversation Finder discovers relevant X posts, assembles evidence-backed reply drafts, applies a deterministic claim gate, then presents them for founder review; the founder—not the product—posts approved text manually. Temporal workflows coordinate durable topic watches and per-post reviews. The README documents confidence scoring, editing, steering, follow-up, and long-lived watches. Some subsystem links are supported only by the README or source-index references; unsampled implementation details are not inferred.

Main entry points: [`backend/workflows/review.py`](https://github.com/gdiab/x-conversation-finder/blob/main/backend/workflows/review.py) (Post review), [`backend/worker.py`](https://github.com/gdiab/x-conversation-finder/blob/main/backend/worker.py) (Temporal worker), [`backend/activities/x_activities.py`](https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/x_activities.py) (X research), [`backend/activities/reply_activities.py`](https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/reply_activities.py) (Reply drafting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Review experience"]
  node_review_ui["Review app<br/>[App.tsx]"]
  node_review_card["Review card<br/>[ReviewCard.tsx]"]
  node_watch_form["Watch form<br/>[StartWatchForm.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_orchestration["Temporal orchestration"]
  node_backend_api["Backend API<br/>[api.py]"]
  node_topic_watch["Topic watch<br/>[topic_watch.py]"]
  node_review_workflow["Post review<br/>[review.py]"]
  node_worker["Temporal worker<br/>[worker.py]"]
end

subgraph group_activities["Workflow activities"]
  node_x_activities["X research<br/>[x_activities.py]"]
  node_reply_activities["Reply drafting"]
  node_claim_activity["Claim verification"]
  node_store_activities["Card storage"]
end

subgraph group_integrations["Adapters and safeguards"]
  node_x_adapter["X API client<br/>[http_x_client.py]"]
  node_fake_x_adapter["Fake X client<br/>[fake_x_client.py]"]
  node_reply_adapter["Plain reply agent"]
  node_fake_reply_adapter["Fake reply agent"]
  node_budget["Budget controls<br/>[budget.py]"]
  node_closed_phrases["Allowed phrases<br/>[non_claim_set.py]"]
end

subgraph group_state["Persistence and models"]
  node_database[("SQLite state<br/>[database.py]")]
  node_evidence_model["Evidence model<br/>[evidence.py]"]
  node_post_model["Post model<br/>[post.py]"]
  node_review_model["Review model<br/>[review.py]"]
end

node_founder(("Founder"))
node_x_service(("X service"))

node_founder -->|"uses"| node_review_ui
node_review_ui -->|"renders"| node_watch_form
node_review_ui -->|"renders"| node_review_card
node_review_ui -->|"loads reviews"| node_api_client
node_watch_form -->|"starts watch"| node_api_client
node_review_card -->|"sends actions"| node_api_client
node_api_client -->|"HTTP requests"| node_backend_api
node_backend_api -->|"starts workflow"| node_topic_watch
node_backend_api -->|"routes actions"| node_review_workflow
node_backend_api -->|"reads cards"| node_store_activities
node_worker -->|"runs"| node_topic_watch
node_worker -->|"runs"| node_review_workflow
node_worker -->|"registers"| node_x_activities
node_worker -->|"registers"| node_reply_activities
node_worker -->|"registers"| node_store_activities
node_worker -->|"registers"| node_claim_activity
node_topic_watch -->|"polls posts"| node_x_activities
node_topic_watch -->|"starts reviews"| node_review_workflow
node_review_workflow -->|"researches post"| node_x_activities
node_review_workflow -->|"drafts reply"| node_reply_activities
node_review_workflow -->|"checks draft"| node_claim_activity
node_review_workflow -->|"updates card"| node_store_activities
node_x_activities -->|"calls client"| node_x_adapter
node_x_activities -->|"reserves reads"| node_budget
node_reply_activities -->|"tracks inference"| node_budget
node_claim_activity -->|"validates phrases"| node_closed_phrases
node_store_activities -->|"reads and writes"| node_database
node_budget -->|"records usage"| node_database
node_x_adapter -->|"searches posts"| node_x_service
node_reply_activities -->|"uses agent"| node_reply_adapter
node_x_activities -.->|"test adapter"| node_fake_x_adapter
node_reply_activities -.->|"test adapter"| node_fake_reply_adapter
node_founder -->|"reviews drafts"| node_review_card
node_founder -->|"posts manually"| node_x_service

click node_review_ui "https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/App.tsx"
click node_review_card "https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/components/ReviewCard.tsx"
click node_watch_form "https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/components/StartWatchForm.tsx"
click node_api_client "https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/api/client.ts"
click node_backend_api "https://github.com/gdiab/x-conversation-finder/blob/main/backend/api.py"
click node_topic_watch "https://github.com/gdiab/x-conversation-finder/blob/main/backend/workflows/topic_watch.py"
click node_review_workflow "https://github.com/gdiab/x-conversation-finder/blob/main/backend/workflows/review.py"
click node_worker "https://github.com/gdiab/x-conversation-finder/blob/main/backend/worker.py"
click node_x_activities "https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/x_activities.py"
click node_reply_activities "https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/reply_activities.py"
click node_claim_activity "https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/claim_gate_activity.py"
click node_store_activities "https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/store_activities.py"
click node_x_adapter "https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/http_x_client.py"
click node_fake_x_adapter "https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/fake_x_client.py"
click node_reply_adapter "https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/plain_reply_agent.py"
click node_fake_reply_adapter "https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/fake_reply_agent.py"
click node_budget "https://github.com/gdiab/x-conversation-finder/blob/main/backend/budget.py"
click node_closed_phrases "https://github.com/gdiab/x-conversation-finder/blob/main/backend/gate/non_claim_set.py"
click node_database "https://github.com/gdiab/x-conversation-finder/blob/main/backend/database.py"
click node_evidence_model "https://github.com/gdiab/x-conversation-finder/blob/main/backend/models/evidence.py"
click node_post_model "https://github.com/gdiab/x-conversation-finder/blob/main/backend/models/post.py"
click node_review_model "https://github.com/gdiab/x-conversation-finder/blob/main/backend/models/review.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_review_ui,node_review_card,node_watch_form,node_api_client toneBlue
class node_backend_api,node_topic_watch,node_review_workflow,node_worker toneAmber
class node_x_activities,node_reply_activities,node_claim_activity,node_store_activities toneMint
class node_x_adapter,node_fake_x_adapter,node_reply_adapter,node_fake_reply_adapter,node_budget,node_closed_phrases toneRose
class node_database,node_evidence_model,node_post_model,node_review_model,node_founder,node_x_service toneIndigo
```

## Components

### Review experience

- [Review app](https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Review card](https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/components/ReviewCard.tsx): `frontend/src/components/ReviewCard.tsx`
- [Watch form](https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/components/StartWatchForm.tsx): `frontend/src/components/StartWatchForm.tsx`
- [API client](https://github.com/gdiab/x-conversation-finder/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Temporal orchestration

- [Backend API](https://github.com/gdiab/x-conversation-finder/blob/main/backend/api.py): `backend/api.py`
- [Topic watch](https://github.com/gdiab/x-conversation-finder/blob/main/backend/workflows/topic_watch.py): `backend/workflows/topic_watch.py`
- [Post review](https://github.com/gdiab/x-conversation-finder/blob/main/backend/workflows/review.py): `backend/workflows/review.py`
- [Temporal worker](https://github.com/gdiab/x-conversation-finder/blob/main/backend/worker.py): `backend/worker.py`

### Workflow activities

- [X research](https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/x_activities.py): `backend/activities/x_activities.py`
- [Reply drafting](https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/reply_activities.py): `backend/activities/reply_activities.py`
- [Claim verification](https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/claim_gate_activity.py): `backend/activities/claim_gate_activity.py`
- [Card storage](https://github.com/gdiab/x-conversation-finder/blob/main/backend/activities/store_activities.py): `backend/activities/store_activities.py`

### Adapters and safeguards

- [X API client](https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/http_x_client.py): `backend/adapters/http_x_client.py`
- [Fake X client](https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/fake_x_client.py): `backend/adapters/fake_x_client.py`
- [Plain reply agent](https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/plain_reply_agent.py): `backend/adapters/plain_reply_agent.py`
- [Fake reply agent](https://github.com/gdiab/x-conversation-finder/blob/main/backend/adapters/fake_reply_agent.py): `backend/adapters/fake_reply_agent.py`
- [Budget controls](https://github.com/gdiab/x-conversation-finder/blob/main/backend/budget.py): `backend/budget.py`
- [Allowed phrases](https://github.com/gdiab/x-conversation-finder/blob/main/backend/gate/non_claim_set.py): `backend/gate/non_claim_set.py`

### Persistence and models

- [SQLite state](https://github.com/gdiab/x-conversation-finder/blob/main/backend/database.py): `backend/database.py`
- [Evidence model](https://github.com/gdiab/x-conversation-finder/blob/main/backend/models/evidence.py): `backend/models/evidence.py`
- [Post model](https://github.com/gdiab/x-conversation-finder/blob/main/backend/models/post.py): `backend/models/post.py`
- [Review model](https://github.com/gdiab/x-conversation-finder/blob/main/backend/models/review.py): `backend/models/review.py`

### Other components

- **Founder**
- **X service**

## Connections

- Founder → Review app: uses (evidence: `README.md`)
- Review app → Watch form: renders (evidence: `frontend/src/App.tsx`)
- Review app → Review card: renders (evidence: `frontend/src/App.tsx`)
- Review app → API client: loads reviews (evidence: `frontend/src/App.tsx`)
- Watch form → API client: starts watch (evidence: `frontend/src/components/StartWatchForm.tsx`)
- Review card → API client: sends actions (evidence: `frontend/src/components/ReviewCard.tsx`)
- API client → Backend API: HTTP requests (evidence: `frontend/src/api/client.ts`)
- Backend API → Topic watch: starts workflow (evidence: `backend/api.py`)
- Backend API → Post review: routes actions (evidence: `backend/api.py`)
- Backend API → Card storage: reads cards (evidence: `backend/api.py`)
- Temporal worker → Topic watch: runs (evidence: `backend/worker.py`)
- Temporal worker → Post review: runs (evidence: `backend/worker.py`)
- Temporal worker → X research: registers (evidence: `backend/worker.py`)
- Temporal worker → Reply drafting: registers (evidence: `backend/worker.py`)
- Temporal worker → Card storage: registers (evidence: `backend/worker.py`)
- Temporal worker → Claim verification: registers (evidence: `backend/worker.py`)
- Topic watch → X research: polls posts (evidence: `backend/workflows/topic_watch.py`)
- Topic watch → Post review: starts reviews (evidence: `backend/workflows/topic_watch.py`)
- Post review → X research: researches post (evidence: `backend/workflows/review.py`)
- Post review → Reply drafting: drafts reply (evidence: `backend/workflows/review.py`)
- Post review → Claim verification: checks draft (evidence: `backend/workflows/review.py`)
- Post review → Card storage: updates card (evidence: `backend/workflows/review.py`)
- X research → X API client: calls client (evidence: `backend/activities/x_activities.py`)
- X research → Budget controls: reserves reads (evidence: `backend/activities/x_activities.py`)
- Reply drafting → Budget controls: tracks inference (evidence: `backend/activities/reply_activities.py`)
- Claim verification → Allowed phrases: validates phrases (evidence: `backend/activities/claim_gate_activity.py`)
- Card storage → SQLite state: reads and writes (evidence: `backend/activities/store_activities.py`)
- Budget controls → SQLite state: records usage (evidence: `backend/budget.py`)
- X API client → X service: searches posts (evidence: `backend/adapters/http_x_client.py`)
- Reply drafting → Plain reply agent: uses agent (evidence: `backend/activities/reply_activities.py`)
- X research → Fake X client: test adapter
- Reply drafting → Fake reply agent: test adapter
- Founder → Review card: reviews drafts (evidence: `README.md`)
- Founder → X service: posts manually (evidence: `README.md`)
