How c9sa/safewatchv2 works
SafeWatch ingests public posts, turns them into structured incident candidates, classifies and evaluates them, then routes them toward publication, rejection, or retry. The sampled source confirms Reddit fetching, Supabase persistence, workflow entry, and agent-node storage calls; the README documents the broader workflow and dashboard/trace goals. Several listed modules were not sampled, so their internal wiring is shown only where the README explicitly describes it.
Main entry points: nodes.py Workflow nodes · fetcher.py Post fetcher · workflow.py Graph workflow · routing.py Retry routing
Components 17
Post ingestion
- Post fetcher
agents/fetcher.py
Agent workflow
- Post processor
pipeline/process_post.py - Graph workflow
graph/workflow.py - Workflow nodes
graph/nodes.py - Retry routing
graph/routing.py - Cleaner agent
agents/cleaner.py - Classifier agent
agents/classifier.py - Decision agent
agents/decision.py - Optional verifier
agents
Incident records
- Raw posts
services/db_readwrites.py - Incident records
services/db_readwrites.py
Audit and review
- Agent messages
services/db_readwrites.py - Trace logging
services/observability.py - Dashboard
Other components
- Workflow caller
- External evidence
Connections 19
- Reddit → Post fetcher: provides posts
- Post fetcher → Reddit: fetches posts
- Post fetcher → Raw posts: inserts posts
- Workflow caller → Post processor: submits post ID
- Post processor → Graph workflow: invokes
- Graph workflow → Workflow nodes: dispatches steps
- Workflow nodes → Raw posts: loads post
- Workflow nodes → Incident records: checks and creates
- Workflow nodes → Cleaner agent: runs cleaning
- Workflow nodes → Classifier agent: runs classification
- Graph workflow → Retry routing: routes retry
- Retry routing → Classifier agent: requests retry
- Decision agent → Retry routing: supplies decision
- Workflow nodes → Incident records: saves outputs
- Workflow nodes → Agent messages: stores agent messages
- Trace logging → Agent messages: logs traces
- Dashboard → Incident records: reviews records
- Dashboard → Agent messages: reviews traces
- Optional verifier → External evidence: checks evidence