Skip to content

fix(lr/06): ramp controller carries the 5% ramp lessons (quality floor, gate tokens, preflight, stop pages) - #22766

Merged
Git-on-my-level merged 2 commits into
integration/legacy-retirefrom
lr/lessons-audit
Oct 20, 2026
Merged

Git-on-my-level merged 2 commits into
integration/legacy-retirefrom
lr/lessons-audit

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

lessons-audit: the ramp controller (contract (g), lane 6) now carries the 5% record-lane ramp lessons that the workspace gate tooling (omi-workspace/infra/rollout, 122 tests) already encodes. The gate stays referenced, not ported: the controller still runs fleet_gate.sh as --gate-cmd. Only the rules the controller decides itself are ported, each with tests:

  • Gate token gap: failed_held_duration_unknown, a fleet_gate.sh verdict since the run 10/11 gate fixes, was not in the closed token lists. A failing cohort therefore HELD as "gate unavailable" instead of rolling back. It is now data loss (ROLLBACK_ZERO), like failed_held_over_budget. Every verdict FAIL token is pinned in test_ramp_controller.py, and the workspace's test_controller_contract.py pins the same list against the gate source.
  • Quality floor: first-summary is a quality guarantee, not a ramp knob. Every tested rollback set keeps FIRST_SUMMARY_DEADLINE_PERCENT=100 (prod's live value). The controller used to roll it back in lockstep, and a lockstep seed would cut it to the batch cohort. This is the same class of mistake as the rollback set that turned multilingual recovery off and stranded 28 units. Now:
    • a rollback moves batch-pipeline only;
    • a first-summary above the lead holds without paging;
    • an unseeded first-summary is never written;
    • ramp_set refuses first-summary below 100 without --allow-quality-decrease.
  • Serving-revision preflight: --preflight-cmd runs before every ADVANCE and never before a rollback. Prod --apply requires it. The workspace's controller_preflight.sh checks that the serving backend-integration revision has multilingual, recovery mode and recovery-all-admitted on, and that per-owner backlog is ≤30. Recovery-all-admitted is a live-only prod setting today, and the source overlay says false.
  • Unsupervised ramp: a --loop --apply run pages the lead when it stops (SIGTERM, SIGHUP, interrupt) and after 3 consecutive failed ticks. The step is kept, since it passed its gate and a restart resumes, but nothing is watching it.

Branch lr/lessons-audit into integration/legacy-retire.

Lane / contract

Lane 06 files (contract (g)): scripts/rollout/ramp_controller.py, ramp_set.py, tests/unit/test_ramp_controller.py. Announced to lane06 and lead on the bus at 04:41Z; lead PROCEED posted (rollback: revert this commit). Lane 6's in-flight staging rehearsal runs from its own worktree and is untouched.

M3 seed note: seed _ramp with first-summary=100, or leave it out. Never seed it equal to the batch percent.

Product invariants affected

  • INV-DATA-1: path match only, inherited from integration/main merges; this PR's own diff does not touch its locked paths.
    This change does not alter the Firebase/Firestore project or serving endpoints.

Verification

  • Unit layer, m5, BACKEND_UNIT_TEST_FILE_LIST + backend/test.sh (nice 19): tests/unit/test_ramp_controller.py, 82 passed. That includes 11 new tests: the token pin, the quality floor (rollback, above-lead, unseeded, M3-style seed through the full ladder), ramp_set's floor refusal, preflight before ADVANCE but not rollback, the preflight probe token, and the loop's stop and error pages, including a real SIGTERM.
  • Workspace layer: python3 -m unittest discover -s infra/rollout passes (122 tests, including the new contract pin and a bash -n check of controller_preflight.sh).
  • Not run: the full backend suite (CI runs it); a staging rehearsal with --preflight-cmd (that needs ro-prod against prod services, so it is a prod-side check by design).

Rollback

Revert the commits. They are pure code: no data written, no env, no deploy.

Failure-Class: none

Review

Grok (read-only, lessons-audit-review): SHIP. Its minors 1–3 (dry-run loop paging, a failing page ending the loop, a below-lead first-summary not paging on rollback) are fixed in 84f4749 with tests.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Git-on-my-level and others added 2 commits October 20, 2026 11:47
…r, gate tokens, preflight, stop pages)

lessons-audit (lessons/batch-rollout-and-staging-traps.md #2-#5), checked against
the tested rules in the workspace's infra/rollout:

- failed_held_duration_unknown, a fleet_gate verdict since the run 10/11 gate
  fixes, was missing from the closed token lists, so it HELD as "gate
  unavailable" and left a failing cohort on. It is data loss (ROLLBACK_ZERO),
  like failed_held_over_budget. Every fleet_gate verdict FAIL token is pinned
  in the tests; the workspace test_controller_contract.py pins the same list
  against the gate source.
- first-summary is a quality floor (QUALITY_FLOOR). Every tested ramp_env.json
  rollback set keeps FIRST_SUMMARY_DEADLINE_PERCENT=100, which is prod's live
  value, but decide_all rolled it back in lockstep, and a lockstep seed would
  cut it to the batch cohort. A rollback now moves batch-pipeline only. A
  first-summary above the lead holds quietly; an unseeded one is never written,
  because serving keeps the env default. ramp_set refuses first-summary below
  100 without --allow-quality-decrease.
- --preflight-cmd runs before any ADVANCE (never before a rollback) with the
  current percent. A non-zero exit HOLDs and pages with its token. Prod --apply
  requires it. The workspace's controller_preflight.sh checks the serving
  backend-integration revision (multilingual, recovery mode, recovery for all
  admitted, which is a live-only prod setting) and the owner backlog.
- A --loop --apply run pages the lead when it stops (SIGTERM, SIGHUP, interrupt)
  and after three consecutive failed ticks. ramp5.sh rolled back on exit. The
  controller keeps its step, because that step passed its gate and a restart
  resumes, but the ramp is then unsupervised and someone must know.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A first-summary below the lead still pages on a lead rollback; only a value at
  or above the lead holds quietly.
- A dry-run loop never pages on tick errors, matching the apply-only stop page.
  A failing error page no longer ends the loop.

Grok review lessons-audit-review: SHIP (minors 1-3 fixed here).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T05:14:03.960665Z 84f4749 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level
Git-on-my-level merged commit de8ac71 into integration/legacy-retire Oct 20, 2026
32 of 34 checks passed
@Git-on-my-level
Git-on-my-level deleted the lr/lessons-audit branch October 20, 2026 05:54
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