Record verified releases and prepare recovery exercises

This commit is contained in:
2026-11-15 23:00:00 -05:00
parent 231d11528a
commit 6c5342219a
23 changed files with 1619 additions and 119 deletions
+64
View File
@@ -0,0 +1,64 @@
# Reviewed recovery exercises
V1 and v2 have now completed Jenkins releases 5 and 6 with real human approvals.
The four exact successful records in `../releases/` need review/commit before
recovery. Do not use the earlier failed attempts' records.
The patch here is a deliberate **staging-only** configuration fault: Gunicorn
binds to 8001 while the unchanged image healthcheck probes 8000. It changes no
image, host port, credential, shared service, production command or stored data.
The reviewed Jenkins `staging-failure` mode requires a staging record and uses
that record's existing v2 digest; it does not publish/rebuild an image.
## Commit and review sequence
1. Commit the actual release records, evidence, monitoring helper, manual and
this patch while the active template remains correct.
2. Apply this patch and commit the one changed template as
`Exercise staging-only Gunicorn bind mismatch`.
3. Immediately revert that second commit, creating a third commit. The final
branch/main template must be good; the bad configuration survives only as
a reviewed historical commit selected explicitly by SHA for the exercise.
4. Billy reviews all three commits, including the intermediate configuration
fault and its restoration. Use a merge commit, preserving history.
After the first commit, the two configuration commits can be made with:
```powershell
git apply delivery/exercises/staging-bind-mismatch.patch
git add delivery/ansible/templates/compose.yaml.j2
git commit -m "Exercise staging-only Gunicorn bind mismatch"
git revert --no-edit HEAD
```
## Execution after review/merge
First record the planned healthy production rollback decision and start the
HTTPS observer. Use `MODE=rollback-production` and
`RELEASE_RECORD=delivery/releases/v1-production.json`. The approved operation
must restore v1's exact image/configuration, source SHA and total 30. This is
an exercise on healthy v2, not a claimed production incident. A real human
must approve the Jenkins production input.
Then start a separate staging observer and select:
```text
MODE=staging-failure
RELEASE_RECORD=delivery/releases/v2-staging.json
STAGING_FAILURE_CONFIG=<full SHA of the reviewed bind-mismatch commit>
```
The SHA must be the actual preserved intermediate commit, not the final
revert or an invented placeholder. Leave SOURCE_COMMIT blank so the job uses
reviewed current main for its control code. Compose wait must block within
its 90-second bound and stop before production. Preserve that failure.
Recover with `MODE=recover-staging` and the same good v2 staging record, leaving
STAGING_FAILURE_CONFIG blank. It must restore the recorded good configuration,
verify source/version/total 36, and pass the unchanged rerun with changed=0.
Save decision/start/completion times, recaps, observer samples and monitoring
correlation. Samples cannot establish zero interruption between requests.
Both exercises remain unexecuted. No failure configuration is deployed merely
by merging this PR: its net template is unchanged and the bad SHA is selected
only in the explicit staging exercise.
@@ -0,0 +1,13 @@
diff --git a/delivery/ansible/templates/compose.yaml.j2 b/delivery/ansible/templates/compose.yaml.j2
--- a/delivery/ansible/templates/compose.yaml.j2
+++ b/delivery/ansible/templates/compose.yaml.j2
@@ -1,6 +1,9 @@
services:
app:
image: "{{ release_image }}"
+{% if target_env == 'staging' %}
+ command: ["gunicorn", "--bind", "0.0.0.0:8001", "--workers", "1", "--worker-tmp-dir", "/tmp", "app:app"]
+{% endif %}
restart: unless-stopped
read_only: true
tmpfs: