How jerryhieu2102/lattice-web works
LATTICE is a local, sandbox-only financial orchestration app for international students. Users capture life events and document evidence, review verified finances, generate and activate a deterministic funding plan, stress-test it, evaluate conditional rescue options, then prepare and approve sandbox actions. The API coordinates these stages; PostgreSQL-backed state, resource permissions and an append-only audit chain provide shared internal controls. The graph preserves README capabilities, but some branches use directory-level paths because their implementations were not sampled; edges are limited to documented or indexed relationships.
Main entry points: main.py FastAPI routes · planning.py Plan orchestration · route.ts API proxy · routes_plans.py Plan endpoints
Components 30
Web experience
- Workspace UI
apps/web/app/[[...slug]]/page.tsx - API proxy
apps/web/app/api/v1/[...path]/route.ts - Life capture
apps/web/components/life/capture.tsx - Document review
apps/web/components/documents.tsx - Plan and scenarios
apps/web/components/planning.tsx - Funding graph
apps/web/components/graph.tsx
API workflows
- FastAPI routes
apps/api/main.py - Life-event workflow
apps/api/routes_life.py - Document workflow
apps/api/routes_documents.py - Finance and access
apps/api/routes_data.py - Plan endpoints
apps/api/routes_plans.py - Action approvals
apps/api/routes_actions.py - Session authentication
apps/api/auth.py
Verification and domain
- Evidence extraction
lattice_ai/extraction/service.py - Deterministic interpreter
connectors/llm/mock.py - Provenance validation
lattice_core/provenance/validation.py - Life-event ledger
lattice_core/life/service.py
Planning and repair
- Constraint optimizer
optimizer/model/solver.py - Plan orchestration
apps/api/planning.py - Stress simulation
simulation/scenarios/engine.py - Rescue evaluation
optimizer/rescue/planner.py - Allocation graph
lattice_core/graph/service.py
State and controls
- Financial state
lattice_core/state.py - Resource permissions
lattice_core/permissions/service.py - Action policy
lattice_core/policy/engine.py - Sandbox bank
connectors/sandbox_bank/provider.py - Hash-chain audit
lattice_core/audit/service.py - Application database
lattice_core/db.py - Domain records
lattice_core/models.py
Other components
- Demo user
Connections 38
- Demo user → Workspace UI: uses
README.md - Workspace UI → API proxy: requests
- Life capture → API proxy: submits events
- Document review → API proxy: submits evidence
- Plan and scenarios → API proxy: requests plans
- Funding graph → API proxy: requests graph
- API proxy → FastAPI routes: proxies API
- FastAPI routes → Session authentication: authenticates
- FastAPI routes → Life-event workflow: routes life events
- FastAPI routes → Document workflow: routes documents
- FastAPI routes → Finance and access: routes finance
- FastAPI routes → Plan endpoints: routes planning
- FastAPI routes → Action approvals: routes actions
- Document workflow → Evidence extraction: extracts facts
apps/api/routes_documents.py - Evidence extraction → Deterministic interpreter: parses text
lattice_ai/extraction/service.py - Evidence extraction → Provenance validation: validates evidence
lattice_ai/extraction/service.py - Life-event workflow → Life-event ledger: manages events
apps/api/routes_life.py - Life-event ledger → Deterministic interpreter: interprets intent
lattice_core/life/service.py - Life-event ledger → Plan orchestration: requests replanning
lattice_core/life/service.py - Life-event ledger → Hash-chain audit: records changes
lattice_core/life/service.py - Finance and access → Resource permissions: checks visibility
apps/api/routes_data.py - Plan endpoints → Plan orchestration: generates plans
apps/api/planning.py - Plan orchestration → Financial state: loads finances
apps/api/planning.py - Plan orchestration → Constraint optimizer: optimizes allocations
apps/api/planning.py - Plan orchestration → Stress simulation: runs scenarios
apps/api/planning.py - Plan endpoints → Rescue evaluation: evaluates rescue
apps/api/routes_plans.py - Plan endpoints → Allocation graph: builds graph
apps/api/routes_plans.py - Action approvals → Action policy: checks authorization
apps/api/routes_actions.py - Action approvals → Sandbox bank: executes sandbox action
apps/api/routes_actions.py - Action approvals → Plan orchestration: checks plan freshness
apps/api/routes_actions.py - Action approvals → Hash-chain audit: records actions
apps/api/routes_actions.py - Financial state → Resource permissions: filters resources
lattice_core/state.py - Financial state → Domain records: reads records
lattice_core/state.py - Resource permissions → Domain records: queries permissions
lattice_core/permissions/service.py - Hash-chain audit → Domain records: stores events
lattice_core/audit/service.py - Domain records → Application database: maps tables
lattice_core/models.py - Life-event workflow → Hash-chain audit: records lifecycle
apps/api/routes_life.py - Plan endpoints → Hash-chain audit: records plans
apps/api/routes_plans.py