How isjustabhi/farmshield-ai works
FarmShield AI coordinates tractor jobs in a deterministic farm simulator, then exposes fleet state and operational insights through a live dashboard. The core workflow is: a user monitors or controls the fleet; the API invokes scheduling, navigation, and safety checks before assignments are committed; simulation ticks track travel and work; disruption recovery preserves progress and replans through those gates. The README documents benchmark, chaos, memory, and metrics capabilities. Some subsystem links reflect README-level documentation because their implementation excerpts were not shown.
Main entry points: App.tsx Dashboard shell · orchestration.py Agent orchestration · main.py FastAPI routes · simulation.py Authoritative simulator
Components 26
Fleet dashboard
- Dashboard shell
frontend/src/App.tsx - Fleet data hook
frontend/src/hooks/useFleetData.ts - Command center
frontend/src/pages/CommandCenterPage.tsx - Fleet monitor
frontend/src/pages/FleetMonitorPage.tsx - Mission queue
frontend/src/pages/MissionQueuePage.tsx - Chaos lab
frontend/src/pages/ChaosLabPage.tsx - Agent network
frontend/src/pages/AgentNetworkPage.tsx - Incident memory
frontend/src/pages/IncidentMemoryPage.tsx - Benchmark lab
frontend/src/pages/BenchmarkLabPage.tsx - Intelligence view
frontend/src/pages/IntelligencePage.tsx
API boundary
- HTTP API client
frontend/src/services/api.ts - Shared API types
frontend/src/types/api.ts - FastAPI routes
backend/app/main.py
Simulation runtime
- Authoritative simulator
backend/app/simulation.py - Domain models
backend/app/models.py
Planning and recovery
- Fleet scheduler
backend/app/scheduler.py - FCFS baseline
backend/app/baseline.py - Agent orchestration
backend/app/orchestration.py - A-star navigation
backend/app/navigation.py - Safety validation
backend/app/safety.py - Recovery agent
backend/app/recovery.py
Operational insights
- Seeded disruptions
backend/app/chaos.py - Benchmark harness
backend/app/benchmark.py - Productivity analytics
backend/app/metrics.py - Operational memory
backend/app/memory.py
Other components
- Fleet operator
Connections 35
- Fleet operator → Dashboard shell: uses
README.md - Dashboard shell → Fleet data hook: loads data
frontend/src/App.tsx - Dashboard shell → Command center: renders
frontend/src/App.tsx - Dashboard shell → Fleet monitor: renders
frontend/src/App.tsx - Dashboard shell → Mission queue: renders
frontend/src/App.tsx - Dashboard shell → Chaos lab: renders
frontend/src/App.tsx - Dashboard shell → Agent network: renders
frontend/src/App.tsx - Dashboard shell → Incident memory: renders
frontend/src/App.tsx - Dashboard shell → Benchmark lab: renders
frontend/src/App.tsx - Dashboard shell → Intelligence view: renders
frontend/src/App.tsx - Fleet data hook → HTTP API client: calls
frontend/src/hooks/useFleetData.ts - HTTP API client → FastAPI routes: HTTP requests
README.md - FastAPI routes → Authoritative simulator: controls state
backend/app/main.py - FastAPI routes → Agent orchestration: dispatches events
README.md - FastAPI routes → Benchmark harness: runs comparisons
backend/app/main.py - FastAPI routes → Seeded disruptions: exposes disruptions
backend/app/main.py - FastAPI routes → Productivity analytics: serves analytics
backend/app/main.py - Agent orchestration → Fleet scheduler: requests schedule
backend/app/orchestration.py - Agent orchestration → A-star navigation: requests routes
backend/app/orchestration.py - Agent orchestration → Safety validation: validates proposals
backend/app/orchestration.py - Agent orchestration → Authoritative simulator: commits assignments
README.md - Agent orchestration → Recovery agent: requests replans
backend/app/orchestration.py - FCFS baseline → A-star navigation: requests routes
backend/app/baseline.py - FCFS baseline → Safety validation: validates commits
backend/app/baseline.py - Authoritative simulator → Productivity analytics: records activity
backend/app/simulation.py - Authoritative simulator → Operational memory: records events
README.md - Seeded disruptions → Authoritative simulator: injects events
backend/app/chaos.py - Benchmark harness → FCFS baseline: compares planner
README.md - Benchmark harness → Fleet scheduler: compares planner
README.md - Agent orchestration → Operational memory: persists traces
README.md - Productivity analytics → Operational memory: reads history
backend/app/metrics.py - Fleet monitor → Shared API types: uses data types
frontend/src/pages/FleetMonitorPage.tsx - Command center → Shared API types: uses data types
frontend/src/pages/CommandCenterPage.tsx - Benchmark lab → HTTP API client: requests results
frontend/src/pages/BenchmarkLabPage.tsx - Intelligence view → HTTP API client: requests analytics
frontend/src/pages/IntelligencePage.tsx