Skip to content

6. Runtime

This section will contain sequence diagrams and narrative for the key runtime scenarios. Until those diagrams are authored, refer to the relevant existing content:

Scenario Where it is documented today
User login + MFA stories/STORY-F-006.md (implementation in flight as of Sprint 2)
Clock in → timesheet → payroll architecture/architecture.md §Runtime
AI agent query (conversational tier) architecture/agents.md
Compliance auto-block on roster write ADR-011-F
Event emission → cross-domain consumption ADR-005-F
Strangler-Fig read of ASG Central v2 ADR-010-F, architecture/data.md
Mobile offline → sync architecture/mobile.md

Planned sequence diagrams (authored in Mermaid):

  1. Login + TOTP — worker logs in on mobile, server issues session, TOTP challenge, LiveView mount
  2. Roster write with compliance gateHR creates shift, Compliance.check/2 synchronous, event emitted on success
  3. AI agent query — user types in Cmd+K, MCP registry lookup, tool invocation, streamed response
  4. Payroll run — Oban job triggers award interpretation, reads timesheets, emits payroll.calculated event
  5. Timesheet sync from mobile — offline SQLite queue → connectivity → server ingest → conflict resolution