Skip to content

feat: the deploy rail's second half — promotion, rollback, and the Phase 9 skeletons - #39

Merged
MCKRUZ merged 1 commit into
mainfrom
feat/deploy-promotion-rollback
Aug 1, 2026
Merged

feat: the deploy rail's second half — promotion, rollback, and the Phase 9 skeletons#39
MCKRUZ merged 1 commit into
mainfrom
feat/deploy-promotion-rollback

Conversation

@MCKRUZ

@MCKRUZ MCKRUZ commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes part of #11 (the promotion/rollback half; the dependency axis is #11's other half, in the follow-on PR).

GOLD-STANDARD promised rollback plans (Phase 8) and incident runbooks (Phase 9). The kit shipped deploy-dev.yml, which reaches the development environment and stops.

What this adds

deploy-promote.yml across the core and both CI/CD packs. Manual trigger only. Two rules that were prose are now mechanical:

  • It refuses to run against a target environment with no approver configured. Without that check, promotion beyond dev is silently automatic — the standard's most protected stop, absent, with nothing on screen to say so.
  • It refuses to promote a build the source environment has never run. Otherwise an operator can send a green CI run straight to prod having skipped test, and the pipeline obliges.

The go/no-go is the platform's own approval mechanism (GitHub required reviewers, Azure DevOps environment checks) rather than logic in a workflow file — the client's security team can already audit it, and it can't be edited away without branch protection noticing.

Three closing-phase skeletons: ROLLBACK.md, ALERTS.md, INCIDENT-PLAYBOOK.md. Documents with reusable structure get one; records of an event don't, so the go/no-go record and drill log stay drafted from the real system.

ROLLBACK.md forces the question teams skip — what a rollback does not undo. Code reverts cleanly; a destructive migration or a published message does not, and the restored version may not understand the data it finds.

The platform split, deliberately

GitHub's environment: key creates a Deployment record queryable by environment name, so that pack asks the API. Azure records deployments against an environment ID behind a separate service area, so that pack has the deploy stamp deployed-<env> on the CI build and the promotion require it. Same governance rule, each realized in the idiom its platform makes reliable — which is what the two-axis pack model is for.

Coupling worth knowing: removing the tagging step from the Azure deploy-dev.yml makes dev a dead end — nothing becomes promotable. Called out in that pack's RAILS.md.

Drift fixed on the way in

Both pack copies of deploy-dev.yml still hard-failed every merge, having never received the DEPLOY_WIRED guard the core file gained. The pack copies are what clients actually install.

Test plan

  • python scripts/check_standard.py — no drift (193 rooted paths, 81 enumerated components)
  • python -m pytest scripts/tests -q — 46 passing
  • All kit YAML parses; both pack manifests consistent with disk (declared / overlaid / present)

Not yet proven, and the standard is explicit that this is what counts: none of it has been made to fail on purpose. docs/the-rails.md §9 — a rail that has never failed safely has not been proven. The three new drills are in RAILS.md; the promotion gate and the skip-an-environment refusal both need exercising against a real repo.

Two things I could not verify and did not pretend to: whether GITHUB_TOKEN can read environment protection rules under every repo visibility, and the exact Azure REST api-version behaviour. Both fail closed with messages that distinguish "no gate configured" from "couldn't check", and both are flagged in-file as rehearsal-verified.

🤖 Generated with Claude Code

…ase 9 skeletons

GOLD-STANDARD promised rollback plans (Phase 8) and incident runbooks (Phase 9); the
kit shipped only deploy-dev.yml, which reaches the development environment and stops.

deploy-promote.yml closes that gap across the core and both CI/CD packs. It is
manual-trigger only, and the go/no-go is the target environment's own approval
mechanism (GitHub required reviewers, Azure DevOps environment checks) rather than
logic invented in a workflow file — the client's security team can already audit it,
and it cannot be edited away without branch protection noticing. Two rules that were
prose are now mechanical: the workflow refuses to run against a target environment
with no approver configured, and refuses to promote a build the source environment
has never run. Both failures previously looked exactly like success.

The platforms diverge on one point, deliberately. GitHub's `environment:` key creates
a Deployment record queryable by environment name, so that pack asks the API directly.
Azure records deployments against an environment id behind a separate service area, so
that pack has the deploy stamp `deployed-<env>` on the CI build and the promotion
require it. Same governance rule, each realized in the idiom its platform makes
reliable — which is what the two-axis pack model is for.

Three skeletons ship alongside: ROLLBACK.md (the written "roll back if X", and the
question teams skip — what a rollback does *not* undo), ALERTS.md, and
INCIDENT-PLAYBOOK.md. Documents with reusable structure get a skeleton; records of an
event do not, so the go/no-go record and drill log stay drafted from the real system.

Also fixes drift found on the way in: both pack copies of deploy-dev.yml still
hard-failed every merge, having never received the DEPLOY_WIRED guard the core file
gained. The pack copies are what clients actually install.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant