doc/development/agent_principles/distillation_flow.md
The weekly sync distills AI development principles from documentation. Review this flow before changing the manifest, the distiller gem, or the sync schedule.
For the step-by-step description, see How the sync works.
Each sync run starts with drift detection and ends with a merge request that updates the distilled files.
%%{init: { "fontFamily": "GitLab Sans" }}%%
flowchart TD
accTitle: AI principles distillation flow
accDescr: Flowchart of the weekly sync run, from drift detection through merge request creation
Start([Weekly scheduled CI job]) --> Load
Load[Load manifest.yml] --> Drift
Drift{Checksum matches
distilled file front matter?}
Drift -->|Yes| UpToDate[Principle is up to date]
Drift -->|No| Affected[Principle needs an update]
UpToDate --> AnyAffected
Affected --> AnyAffected
AnyAffected{Any principles
need an update?}
AnyAffected -->|No| Done([Exit: nothing to do])
AnyAffected -->|Yes| Validate
Validate{Source and baseline
files exist?}
Validate -->|No| Fail([Fail: missing source path])
Validate -->|Yes| Distill
Distill[Call GitLab Duo Agent Platform
Workflow API per principle] --> Assemble
Assemble[Assemble distilled file
and absolutize links] --> Meaningful
Meaningful{Content changed?}
Meaningful -->|No| NoChange[Skip principle]
Meaningful -->|Yes| Write[Write file with
new checksum front matter]
NoChange --> Collected
Write --> Collected
Collected[Collect updated files] --> MR
MR[Open merge request
targeting the default branch] --> Review([Human approval and merge])
.ai/principles/manifest.yml.gems/gitlab-ai-principles-distiller
for the gem that drives the sync.