Journey engine¶
eAkto turns a validated intent into a versioned, deterministic journey. AI proposes structured context; it does not generate executable workflow code.
Workflow selection¶
workflow_mapper.py applies backend compatibility rules:
- marriage-related record updates map to
POST_MARRIAGE_RECORD_UPDATE; - specific non-marriage record corrections map to
GOVERNMENT_RECORD_INFORMATION_UPDATE; - generic conversation, unsupported goals, portal failures, and completed-status claims do not automatically create a journey.
The selected workflow must be present as an active template.
Declarative rule evaluation¶
Rules use validated operators such as:
equals/not_equalscontains/not_containsin/not_inexists/not_existsis_empty/is_not_empty- nested
all,any, andnone
The evaluator resolves dot-separated fields in a read-only context. It never executes code stored in the database.
WorkflowRule(
field="intent.mentioned_records",
operator=RuleOperator.CONTAINS,
value="NATIONAL_IDENTITY",
)
Dependency ordering¶
Applicable milestones are topologically ordered. A milestone is blocked when:
- it names a dependency not present in the workflow definition;
- its dependency is already blocked; or
- a cycle prevents a valid order.
Within valid dependency order, priority and stable milestone codes provide deterministic ordering.
Journey creation¶
The Personal Engine:
- verifies that the intent exists and is supported;
- loads the active workflow template;
- builds context from intent, redacted document evidence, and assurance;
- resolves every milestone;
- persists applicable and skipped milestone snapshots;
- marks the first applicable milestone
CURRENT; and - links the journey to its citizen owner.
Creating a journey from the same intent is idempotent: an existing journey is returned.
Progress and answers¶
Only the current applicable milestone can be completed. Submitted answers are stored under:
{
"milestone_answers": {
"CONFIRM_REQUESTED_INFORMATION": {
"target_record": "National ID",
"requested_change": "Address"
}
}
}
Progress is calculated from persisted milestone state:
completed applicable milestones / all applicable milestones × 100
Flutter animates from the previous visual value to the new server percentage; the backend remains the source of truth.
Reevaluation¶
Evidence or context updates can re-run resolution. Previously completed milestones remain completed. Newly applicable steps are inserted into the resolved order, and the first incomplete step becomes current.
This allows a newly uploaded, verified document to remove a redundant preparation step without losing citizen progress.