# dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1 architecture

> Architecture diagram of the GitHub repository dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1
- Repository: https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1

## Overview

This repository is a hands-on Gate 1 lab for deciding whether a simulated LogiX-VN refund assistant is ready for a customer pilot. The central workflow is to sign acceptance criteria, run the refund simulation and inspect its evidence, implement and checkpoint preventive gates, then evaluate an incident and record a Gate 1 decision. Supporting branches cover operational/legal limits, monitoring, incident grading, and submission completeness. Some modules are represented from the source index and README rather than sampled implementation; edges are limited to relationships visible in those sources.

Main entry points: [`lab10/eval.py`](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/eval.py) (Suite evaluation), [`lab10/ops.py`](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/ops.py) (Ops gate logic), [`lab10/criteria.py`](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/criteria.py) (Acceptance criteria), [`lab10/agent.py`](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/agent.py) (Refund agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_governance["Criteria &amp; Operations"]
  node_criteria["Acceptance criteria<br/>[criteria.py]"]
  node_criteria_config["Signed thresholds"]
  node_operating_gates["Operating limits"]
  node_ops["Ops gate logic<br/>[ops.py]"]
end

subgraph group_runtime["Refund Simulation"]
  node_agent["Refund agent<br/>[agent.py]"]
  node_mock_llm["Mock LLM<br/>[mock_llm.py]"]
  node_tools["Read/write tools<br/>[tools.py]"]
  node_guards["Preventive guards<br/>[guards.py]"]
  node_helpers["Policy helpers<br/>[helpers.py]"]
  node_world[("Mock world<br/>[world.py]")]
  node_world_data["World and tickets<br/>[world.json]"]
end

subgraph group_evaluation["Evaluation &amp; Gate"]
  node_eval["Suite evaluation<br/>[eval.py]"]
  node_monitors["Custom monitors<br/>[monitors.py]"]
  node_gate["Criteria comparison<br/>[gate.py]"]
end

subgraph group_incident["Incident &amp; Grading"]
  node_checkpoint["Round-one snapshot<br/>[checkpoint.py]"]
  node_grade["Incident grading<br/>[grade.py]"]
end

subgraph group_submission["Submission"]
  node_check_submission["Submission checks"]
  node_submission_data["Submission record<br/>[submission.json]"]
end

node_team(("Lab team"))

node_team -->|"sets thresholds"| node_criteria_config
node_team -->|"implements guards"| node_guards
node_team -->|"sets limits"| node_operating_gates
node_criteria -->|"signs and verifies"| node_criteria_config
node_agent -->|"extracts with"| node_mock_llm
node_agent -->|"uses tools"| node_tools
node_agent -->|"uses gate defaults"| node_ops
node_tools -->|"checks writes"| node_guards
node_tools -->|"reads and writes"| node_world
node_guards -->|"uses facts"| node_helpers
node_ops -->|"uses world facts"| node_world
node_ops -->|"loads limits"| node_operating_gates
node_world -->|"loads base data"| node_world_data
node_eval -->|"runs trials"| node_agent
node_eval -->|"loads simulation data"| node_world
node_eval -->|"checks signing state"| node_criteria
node_eval -->|"computes operations"| node_ops
node_eval -->|"runs monitors"| node_monitors
node_gate -->|"loads signed rules"| node_criteria
node_team -->|"freezes round one"| node_checkpoint
node_checkpoint -->|"snapshots guards"| node_guards
node_checkpoint -->|"snapshots gate config"| node_ops
node_grade -->|"compares stages"| node_eval
node_grade -->|"uses prepared stage"| node_checkpoint
node_grade -->|"checks criteria"| node_criteria
node_team -->|"records decisions"| node_submission_data
node_check_submission -->|"validates record"| node_submission_data
node_check_submission -->|"collects grade report"| node_grade
node_check_submission -->|"checks team criteria"| node_criteria

click node_criteria "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/criteria.py"
click node_criteria_config "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/config/acceptance_criteria.json"
click node_operating_gates "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/config/operating_gates.json"
click node_ops "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/ops.py"
click node_agent "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/agent.py"
click node_mock_llm "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/mock_llm.py"
click node_tools "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/tools.py"
click node_guards "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/guards.py"
click node_helpers "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/helpers.py"
click node_world "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/world.py"
click node_world_data "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/data/world.json"
click node_eval "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/eval.py"
click node_monitors "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/monitors.py"
click node_gate "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/gate.py"
click node_checkpoint "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/checkpoint.py"
click node_grade "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/grade.py"
click node_check_submission "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/check_submission.py"
click node_submission_data "https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/submission/submission.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_criteria,node_criteria_config,node_operating_gates,node_ops toneBlue
class node_agent,node_mock_llm,node_tools,node_guards,node_helpers,node_world,node_world_data toneAmber
class node_eval,node_monitors,node_gate toneMint
class node_checkpoint,node_grade toneRose
class node_check_submission,node_submission_data,node_team toneIndigo
```

## Components

### Criteria & Operations

- [Acceptance criteria](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/criteria.py): `lab10/criteria.py`
- [Signed thresholds](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/config/acceptance_criteria.json): `config/acceptance_criteria.json`
- [Operating limits](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/config/operating_gates.json): `config/operating_gates.json`
- [Ops gate logic](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/ops.py): `lab10/ops.py`

### Refund Simulation

- [Refund agent](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/agent.py): `lab10/agent.py`
- [Mock LLM](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/mock_llm.py): `lab10/mock_llm.py`
- [Read/write tools](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/tools.py): `lab10/tools.py`
- [Preventive guards](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/guards.py): `lab10/guards.py`
- [Policy helpers](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/helpers.py): `lab10/helpers.py`
- [Mock world](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/world.py): `lab10/world.py`
- [World and tickets](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/data/world.json): `data/world.json`

### Evaluation & Gate

- [Suite evaluation](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/eval.py): `lab10/eval.py`
- [Custom monitors](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/monitors.py): `lab10/monitors.py`
- [Criteria comparison](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/gate.py): `lab10/gate.py`

### Incident & Grading

- [Round-one snapshot](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/checkpoint.py): `lab10/checkpoint.py`
- [Incident grading](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/grade.py): `lab10/grade.py`

### Submission

- [Submission checks](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/lab10/check_submission.py): `lab10/check_submission.py`
- [Submission record](https://github.com/dpduc313/k5-l3a-day10-daidaidi-poctopilotgate1/blob/main/submission/submission.json): `submission/submission.json`

### Other components

- **Lab team**

## Connections

- Lab team → Signed thresholds: sets thresholds (evidence: `README.md`)
- Lab team → Preventive guards: implements guards (evidence: `README.md`)
- Lab team → Operating limits: sets limits (evidence: `README.md`)
- Acceptance criteria → Signed thresholds: signs and verifies (evidence: `lab10/criteria.py`)
- Refund agent → Mock LLM: extracts with (evidence: `lab10/agent.py`)
- Refund agent → Read/write tools: uses tools (evidence: `lab10/agent.py`)
- Refund agent → Ops gate logic: uses gate defaults (evidence: `lab10/agent.py`)
- Read/write tools → Preventive guards: checks writes (evidence: `lab10/tools.py`)
- Read/write tools → Mock world: reads and writes (evidence: `lab10/tools.py`)
- Preventive guards → Policy helpers: uses facts (evidence: `lab10/guards.py`)
- Ops gate logic → Mock world: uses world facts (evidence: `lab10/ops.py`)
- Ops gate logic → Operating limits: loads limits (evidence: `lab10/ops.py`)
- Mock world → World and tickets: loads base data (evidence: `lab10/world.py`)
- Suite evaluation → Refund agent: runs trials (evidence: `lab10/eval.py`)
- Suite evaluation → Mock world: loads simulation data (evidence: `lab10/eval.py`)
- Suite evaluation → Acceptance criteria: checks signing state (evidence: `lab10/eval.py`)
- Suite evaluation → Ops gate logic: computes operations (evidence: `lab10/eval.py`)
- Suite evaluation → Custom monitors: runs monitors (evidence: `lab10/eval.py`)
- Criteria comparison → Acceptance criteria: loads signed rules (evidence: `lab10/gate.py`)
- Lab team → Round-one snapshot: freezes round one (evidence: `README.md`)
- Round-one snapshot → Preventive guards: snapshots guards (evidence: `lab10/checkpoint.py`)
- Round-one snapshot → Ops gate logic: snapshots gate config (evidence: `lab10/checkpoint.py`)
- Incident grading → Suite evaluation: compares stages (evidence: `lab10/grade.py`)
- Incident grading → Round-one snapshot: uses prepared stage (evidence: `lab10/grade.py`)
- Incident grading → Acceptance criteria: checks criteria (evidence: `lab10/grade.py`)
- Lab team → Submission record: records decisions (evidence: `README.md`)
- Submission checks → Submission record: validates record (evidence: `lab10/check_submission.py`)
- Submission checks → Incident grading: collects grade report (evidence: `lab10/check_submission.py`)
- Submission checks → Acceptance criteria: checks team criteria (evidence: `lab10/check_submission.py`)
