Skip to content

fix(release): roll back a severe canary window at once - #97

Draft
mrgoonie wants to merge 1 commit into
mainfrom
fix/89-severe-breach-rolls-back
Draft

mrgoonie wants to merge 1 commit into
mainfrom
fix/89-severe-breach-rolls-back

Conversation

@mrgoonie

Copy link
Copy Markdown
Contributor

What and why

Refs #89. A canary revision that failed every request was judged continue at the 5% window (one breaching window of the two Consecutive needs) and advanced to 25%, so customers saw ~120 server errors where 20 were enough evidence.

This adds MonitorConfig.SevereErrorRate (default 0.5, a starting value to calibrate): a window that has at least MinSamples responses, breaches (above ErrorRateThreshold and more than MinDelta over the baseline) and whose 5xx rate reaches the severe rate rolls back at once. A borderline single breach still waits for the next window. Validation refuses a severe rate at or below the threshold, above 1, or NaN.

This is a governance change (REVIEW.md: rollback rules; ADR 0002: trusted control surface). It needs the Owner's approval of the rule and the 0.5 value before merge. Opened as a draft proposal; the brief §6.2 (both languages), REVIEW.md wording and an ADR amendment are left for the Owner to decide rather than self-applied, per AGENTS.md ("do not edit … to make your own work pass; propose a PR").

How it was tested

  • Unit: monitor_rule_test.go — severe window rolls back at once (100% and exactly 50%); borderline breaches (2.5%, 49.9%) still continue; a severe rate under MinSamples stays low_traffic; a severe rate no higher than the baseline is no breach. config_rules_test.go — severe rate at the threshold or above 1 is refused.
  • Pipeline: auto_rollback_restores_lkg_test.go TestACanaryFailingEveryRequestIsRolledBackAtTheFirstStep — restored to the LKG after one window with one promotion (the split never reached 25%). Red before the change.
  • go build ./... && go test ./... -race && golangci-lint run — all green on the pre-review head (lint 0 issues); package suite re-run green at the pushed head e6f3e78 (go test -race -count=1 ./internal/supervisor/release/, lint 0 issues). make e2e not run (no Docker here).

Checklist

  • build, go test ./... -race, lint pass locally (see above; make check e2e/smoke vetting not run).
  • Tests come with the change; the rule has negative tests.
  • If an action changed: n/a.
  • If the decision brief changed: n/a (proposed, not changed — Owner decision).
  • If an ADR was added: n/a.
  • Docs describe only what code and a passing test prove.
  • Conventional commit, signed off.
  • No secrets, tokens or personal data.

Governance

  • Changes dependencies, lockfiles, base images or CI configuration.
  • Changes the supervisor, signing keys, policy enforcement, the QA baseline or rollback rules.
  • Widens permissions, egress, budget or scope.
  • Ran make e2e (needs Docker).

Quyết định của routine

  • Issue: the fix changes a rollback rule, which REVIEW.md classes as a governance change needing Owner approval.
  • Options: (a) stop without code; (b) open a draft proposal PR with tests and leave doc/ADR wording and the threshold to the Owner; (c) also edit the brief/REVIEW.md/ADR.
  • Chosen: (b) — it makes progress without self-approving a control-surface change; (c) is forbidden by AGENTS.md. The issue is marked blocked + needs-decision.
  • Known trade-offs (from the isolated review): if the LKG baseline is itself broken (e.g. 0.9) and the candidate is at 1.0, the release now rolls back after one window rather than two. SevereErrorRate is not tunable from the manifest (same as the other monitor fields today). Open questions for the Owner: is 0.5 right (vs. 0.25)? Should the immediate path need a larger sample floor than MinSamples?

Generated by Claude Code

A window whose 5xx rate reaches a severe rate (default 0.5) with enough
samples and above the baseline now rolls back immediately instead of
advancing the split for a second breaching window. Borderline single
breaches keep the consecutive-window rule.

Refs #89

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1xMi7Nz9a6hESQxPZs8iQ
Signed-off-by: mrgoonie <mrgoonie@users.noreply.github.com>

Copy link
Copy Markdown
Contributor Author

CI test failed at e6f3e78 in adapters/deploy/local (TestARestartedBackendStopsAProcessItsLauncherExecedInto: fork/exec …/launcher: text file busy). This PR only touches internal/supervisor/release/; the failure is the ETXTBSY race of exec-ing a freshly written binary while another parallel test still holds a write descriptor. It passes locally (go test -race -count=3 -run … ./adapters/deploy/local/). I will re-run the job once when the workflow run finishes (a re-run is refused while it is still running); if it fails again I will open a separate issue for the test rather than widen this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

The re-run of test passed; all checks are green at e6f3e78 and the PR has no conflict. The intermittent adapters/deploy/local failure is filed separately so it is not lost. The PR stays a draft awaiting the Owner's governance decision on the rollback rule (see #89).


Generated by Claude Code

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