What is platform discipline as code?
Platform discipline as code is the practice of writing a platform's structure and standards down as declarations that tools read and check, instead of as documents that people are expected to remember. Which components exist, how each kind is built and shipped, what runs in which lane, and which environment promotes after which: all of it lives in the repository, versioned and reviewed like code, and is verified before anything runs.
It is the idea orun is built on. This page describes it on its own terms; the last section maps it to orun.
Why "discipline"
Every platform team has standards. The trouble is keeping them. A standard that lives in a wiki, a review checklist, or a CI file copied from the last project is a recommendation: it holds while people remember it and slips the first time someone is in a hurry. Nothing notices.
That was tolerable when every change passed a human who knew the rules. It is not tolerable when coding agents open pull requests at machine speed and learn the platform by imitating whatever code is nearest. Discipline that depends on memory does not scale to contributors that have none.
Platform discipline as code moves the standard from the reviewer's head into a declaration the platform enforces, so it holds for every team and every agent without anyone having to remember it.
The four practices
- Declare. The platform's structure (components, environments, dependencies) and its standards (golden paths, lane rules, promotion order) are typed documents in the repository, checked against schemas.
- Package and evolve. Standards travel like libraries: versioned, published, pulled by reference, and pinned. Improving a standard is a version bump each repository reviews, not a migration project.
- Ground agents. Coding agents read the same declarations, catalog, and run history as the platform, and what they may touch is declared too, so they work inside the standards instead of guessing them.
- Verify, plan, execute. Before anything runs, a planner checks the declarations and compiles them into a deterministic plan a reviewer can read as a diff. Execution runs exactly that plan and records what happened.
How it differs from related practices
| Practice | What it puts in code | What stays outside |
|---|---|---|
| Infrastructure as code | The resources: networks, databases, clusters | How every component gets built and shipped, and in what order |
| Policy as code | Rules evaluated against configuration, such as "no public buckets" | The golden paths themselves, the structure, the plan |
| CI/CD as code | The pipeline steps for one repository | The standard those pipelines are meant to share |
| Platform discipline as code | The platform's structure and standards, and the plan compiled from them | Nothing a tool needs to read |
Platform discipline as code does not replace the others. Terraform still manages the resources and your CI still provides the compute; the declarations decide what runs, with which inputs, in which order.
Signs you need it
- The golden path is a template that was applied once and a wiki page that is out of date.
- Rolling out a pipeline improvement takes a pull request per repository.
- No one can say what a change will deploy, or in what order, without running it.
- The service catalog is maintained by hand and nobody trusts it.
- Coding agents produce code that works but does not follow the platform's conventions.
How orun implements it
orun is a single open-source binary that implements each practice:
| Practice | In orun |
|---|---|
| Declare | intent.yaml and component.yaml, and compositions that turn golden paths into typed contracts |
| Package and evolve | Stacks and intent presets published as OCI artifacts, pinned by digest, and baselines for whole products |
| Ground agents | The MCP server, task contracts, and an agent runtime with deny-by-default tool policies |
| Verify, plan, execute | orun validate, orun plan (a deterministic plan DAG), and orun run on your shell, Docker, or GitHub Actions |
What is orun? walks through each pillar, and the design principles explain the choices behind them.