How ashokknayak1234/outcome-water works
OutcomeLoop is a local water-outcome case demo: users review evidence, receive staged AI recommendations, record human approval and work, then assess measured changes and evidence sufficiency. The React dashboard calls a FastAPI API; its workflow combines deterministic metrics, validated model responses, and optional candidate ranking. State is in memory and seeded from demo files. The graph reflects shown calls and README-described behavior; unsampled implementation details are not inferred.
Main entry points: workflow.py Stage orchestrator · App.jsx Page router · routes.py Case endpoints · Dashboard.jsx Case dashboard
Components 21
User interface
- Page router
frontend/src/App.jsx - Landing page
frontend/src/pages/Landing.jsx - Workflow guide
frontend/src/pages/HowItWorks.jsx - Case dashboard
frontend/src/pages/Dashboard.jsx - API client
frontend/src/lib/api.js
API and case state
- FastAPI server
backend/app/main.py - Case endpoints
backend/app/routes.py - Validated records
backend/app/schemas.py - In-memory case state
backend/app/case_store.py - Demo case data
demo-data/case-001.json
Case workflow
- Stage orchestrator
backend/app/workflow.py - Investigation
backend/app/workflow.py - Analysis
backend/app/workflow.py - Resolution
backend/app/workflow.py - Outcome verification
backend/app/workflow.py - Deterministic metrics
backend/app/calculations.py - State transitions
backend/app/transitions.py
Model and ranking
- Local Ollama
- Model client
backend/app/ollama_client.py - Candidate ranker
backend/app/decision_ranker.py
Other components
- Case user
Connections 22
- Case user → Page router: opens
frontend/src/App.jsx - Page router → Landing page: routes to
frontend/src/App.jsx - Page router → Workflow guide: routes to
frontend/src/App.jsx - Page router → Case dashboard: routes to
frontend/src/App.jsx - Case user → Case dashboard: uses
frontend/src/pages/Dashboard.jsx - Case dashboard → API client: calls
frontend/src/pages/Dashboard.jsx - API client → FastAPI server: HTTP requests
- FastAPI server → Case endpoints: registers
backend/app/main.py - Case endpoints → In-memory case state: reads and edits
backend/app/routes.py - Case endpoints → Stage orchestrator: runs
backend/app/routes.py - Case endpoints → State transitions: changes state
backend/app/routes.py - In-memory case state → Demo case data: loads seed
backend/app/case_store.py - Stage orchestrator → Investigation: runs stages
backend/app/workflow.py - Stage orchestrator → Analysis: runs stages
backend/app/workflow.py - Stage orchestrator → Resolution: runs stages
backend/app/workflow.py - Stage orchestrator → Outcome verification: runs stage
backend/app/workflow.py - Stage orchestrator → Deterministic metrics: calculates metrics
backend/app/workflow.py - Stage orchestrator → In-memory case state: edits case
backend/app/workflow.py - Stage orchestrator → Model client: requests generation
backend/app/workflow.py - Model client → Local Ollama: generates JSON
backend/app/ollama_client.py - Stage orchestrator → Candidate ranker: ranks candidates
backend/app/workflow.py - Stage orchestrator → Validated records: validates outputs
backend/app/workflow.py