How khanakhun/yakhnama works
Yakhnama is a modular-monolith system of record for community-observed high-mountain hazards. Its central workflow takes reports through triage and moderation, then creates verified canonical events with sourced impact claims; media and provenance support traceability, while verification preserves moderator decisions. Separate capabilities ingest historical datasets and export/import data through background jobs. The graph follows the README’s documented boundaries and sampled query/pipeline behavior; several runtime connections are based on README architecture rather than inspected router or handler source.
Main entry points: events/application Canonical events · db.py Persistent records · reports/application Reports and triage · verification/application Verification cases
Components 22
Reports and review
- Report API
src/yakhnama/modules/reports/api - Reports and triage
src/yakhnama/modules/reports/application - Media handling
src/yakhnama/modules/media/application - Media object storage
src/yakhnama/modules/media/infrastructure/adapters/s3_storage.py - Verification cases
src/yakhnama/modules/verification/application
Canonical record
- Canonical events
src/yakhnama/modules/events/application - Impact claims
src/yakhnama/modules/impacts/application - Sources and citations
src/yakhnama/modules/provenance/application - Geographic references
src/yakhnama/modules/geography - Hazard references
src/yakhnama/modules/hazards - Audit log
src/yakhnama/modules/audit
Data exchange
- Dataset ingestion
src/yakhnama/modules/ingestion/application/pipeline.py - Source adapters
src/yakhnama/modules/ingestion/infrastructure/adapters - Import and export jobs
src/yakhnama/modules/exchange/application - Format adapters
src/yakhnama/modules/exchange/infrastructure/adapters - Export artifacts
src/yakhnama/modules/exchange/infrastructure/adapters/s3_artifact_store.py
Application platform
- API application
src/yakhnama/main.py - Identity and policy
src/yakhnama/modules/identity/public.py - Background task runtime
src/yakhnama/platform/tasks - Outbox relay
src/yakhnama/platform/outbox - Persistent records
src/yakhnama/platform/db.py
Other components
- Community / moderator
Connections 32
- Community / moderator → API application: sends requests
- API application → Report API: mounts routes
- Report API → Reports and triage: dispatches report requests
- Reports and triage → Verification cases: moderates reports
- Reports and triage → Media handling: handles attachments
- Media handling → Media object storage: stores and retrieves media
- Verification cases → Canonical events: verifies into events
- Canonical events → Impact claims: anchors impact claims
- Canonical events → Sources and citations: cites sources
- Canonical events → Geographic references: uses geographic references
- Canonical events → Hazard references: uses hazard references
- Reports and triage → Identity and policy: checks access policies
- Verification cases → Identity and policy: checks moderator access
- Canonical events → Identity and policy: checks visibility
- Impact claims → Identity and policy: checks visibility
- Canonical events → Verification cases: reads transition history
- Canonical events → Impact claims: reads impact timeline
- Sources and citations → Canonical events: checks published citations
- Community / moderator → Dataset ingestion: requests data intake
- Dataset ingestion → Source adapters: fetches source data
- Dataset ingestion → Background task runtime: runs pipeline jobs
- Community / moderator → Import and export jobs: requests data exchange
- Import and export jobs → Background task runtime: runs import and export jobs
- Import and export jobs → Format adapters: converts datasets
- Import and export jobs → Export artifacts: stores and presigns exports
- Reports and triage → Persistent records: persists report records
- Verification cases → Persistent records: persists case history
- Canonical events → Persistent records: persists event records
- Impact claims → Persistent records: persists claims
- Sources and citations → Persistent records: persists source records
- Audit log → Persistent records: reads audit entries
- Outbox relay → Background task runtime: dispatches queued work