nightjar

Lifecycle stages, mapped to jobs

Each stage is a real job, file or GitLab feature in one project.

StageJobWhat happens
monitorprobe:production, probe:alert, incident timelineA schedule runs synthetic checks against production every 10 minutes. A failed check starts an incident; its steps are written to the GitLab incident timeline.
mitigaterollback:production, incident:openTraffic goes back to the previous Cloud Run revision first. Then an incident issue is opened with the exact failing request, expected vs. actual, and is assigned to the Duo Developer flow.
planDuo DeveloperThe agent writes a regression test, makes the smallest fix and opens a merge request (Closes #<incident>). Rules in AGENTS.md.
verifylint, test, proof:fail-before-pass-after, build:imageThe new test must fail on the base commit and pass with the fix. Existing tests may not be changed or removed.
securesemgrep-sast, secret_detection, container_scanningGitLab security scanners. Release waits for them.
governrisk-gateScores the change against .gitlab/risk-policy.json: auto-merge, escalate to a human, or block. Only findings the change introduces count. On escalation it also requests the Approval Brief flow as reviewer. The gate runs the tooling and policy of the target branch, so a merge request cannot loosen its own gate.
releasedeploy:staging, smoke:staging, promote:production, smoke:production, releaseA no-traffic revision with a per-commit tag is smoke-tested, then exactly that revision is promoted. A failed production smoke test rolls back.
configuredeploy/cloudrun.sh, environments staging and production, feature flag nightjar_auto_mergeCloud Run service settings, traffic tags and rollback are code in the repository and applied by the pipeline. The auto-merge kill switch is a GitLab feature flag: switched off, the gate never merges and only requests a human.
reportpostmortem, sci:reportThe incident is closed with a timeline, time to mitigate and time to fix, plus a Software Carbon Intensity report for the run.

One release pipeline

Pipeline 2990603466: verify, secure, package, release, observe and report stages all passed; the rollback job is skipped
Pipeline 2990603466: every job green; the rollback job is skipped because nothing failed.

GitLab Duo Agent Platform features used