{
  "uid": "cogitave.learn.operate-from-day-1.the-day-1-operating-model",
  "kind": "moduleUnit",
  "href": "/modules/operate-from-day-1/the-day-1-operating-model/",
  "title": "The Day 1 operating model",
  "summary": "",
  "type": null,
  "products": [],
  "roles": [],
  "levels": [],
  "subjects": [],
  "headings": [
    "The reproducible, pinned toolchain",
    "The parity contract",
    "Trunk-based delivery and preview environments",
    "Measuring the loop honestly"
  ],
  "source": "The **inner loop** is how an engineer, or an agent, goes from a clean checkout to\na green PR: edit, build, test, repeat, measured in seconds. Its full contract is\n[development-process](../../../../standards/docs/standards/development-process.md).\nThe load-bearing rule of that standard, stated once and never restated, is this:\n\n```\nlefthook commands  ==  CI commands  ==  just targets\n```\n\n## The reproducible, pinned toolchain\n\nThe toolchain is layered, floor to ceiling: **`dev-setup.sh`** bootstraps the\nfloor (installs `mise` itself plus host prerequisites); **`mise`** is the org's\npinned-toolchain layer - a single polyglot binary, versions committed in\n`.mise.toml` so a laptop and a CI runner get the byte-identical toolchain; **`just`**\nis the canonical task surface; a **devcontainer** is optional editor/LSP parity on\ntop of the first three. Every repo exposes the **same canonical target names** -\n`build`, `test`, `lint`, `fmt`, `run`, `watch`, `bench`, `cov` - so muscle memory\nand automation transfer across Rust, Go, and TypeScript repos. A repo may add\nrepo-specific recipes but **must not rename or omit** a canonical target.\n\n## The parity contract\n\nThe pre-commit hook calls `just fmt --check` / `just lint`; CI calls the *same*\n`just` targets; both resolve tools through the same `.mise.toml`. There is no\nfourth, hand-written copy of any command anywhere. This is why \"green locally, red\nin CI\" becomes a near-impossible state instead of a daily tax. The git hook is a\n**convenience and is bypassable** (`--no-verify`); **CI is the real, unbypassable\ngate**. If a check ever passes locally and fails in CI, that is not a flaky test -\nit is a parity bug in this contract, and the fix is to close the gap, never to\nrelax CI to match.\n\n## Trunk-based delivery and preview environments\n\n`main` is protected; branches are short-lived; every change lands through a\nmandatory PR with linear history. Long-lived feature branches are an\nanti-pattern - incomplete work hides behind **feature flags**, not branches.\nSmall, frequent PRs are the single biggest lever on lead time and review latency.\nEvery PR produces a **deploy preview** on the same Terraform, secret pattern, and\nobservability stack as production - environment parity, not a bespoke snowflake.\n\n## Measuring the loop honestly\n\n**DORA** (deployment frequency, lead time for changes, change failure rate, MTTR)\nand **SPACE** are read at team level, as trends - never to rank individuals and\nnever as a target to be gamed. A metric that becomes a target stops being a\nmetric, which is why the standard pairs a throughput signal with a quality one\n(deployment frequency *with* change failure rate) and reviews the metric set\nquarterly.\n\nThis inner loop is the loop the request-lifecycle's **implement** stage runs in:\na change leaves that stage only when `fmt --check`, `lint`, `test`, and the\ncoverage gate pass locally *and* in CI, the PR has a deploy preview, and the\nlifecycle's own\n[Definition of Done](../../../../agents/lifecycle/definition-of-done.md) is\nsatisfied.\n",
  "partOf": "cogitave.learn.operate-from-day-1",
  "durationInMinutes": 6,
  "quiz": null
}