Layer 6: Data Flow¶
DTO-to-storage chains and transformation steps.
Overview¶
Data flows through the system in well-defined stages:
- Input — User prompts (stdin), recipe YAML (files), hook events (JSON stdin)
- Parsing & Validation — Clap CLI parser,
recipe::parser(serde_yaml),HookInput(serde_json),security::XpiaDefender(XPIA pattern scan) - Routing & Classification —
commands::dispatch(match on Command enum),workflows::WorkflowClassifier(Q&A / Investigation / Development),recipe::condition_eval - Execution —
agent_core::session(conversation state),agentic_loop::loop_core(tool-use cycle),recipe::executor(step runner) - State Persistence —
state::AtomicJsonFile(file lock + atomic write),memory::backend(store/retrieve), LadybugDB Kuzu (graph insert/query) - Output — stdout (user response), file output (generated code), GitHub issues (gh API)
Key transformation: user prompt string -> Clap Command enum ->
WorkflowType classification -> agent session -> tool-use cycle ->
memory store + stdout response.
Diagram (Graphviz)¶
Diagram source¶
- data-flow.dot (Graphviz DOT)
- data-flow.mmd (Mermaid)