Repository navigation
feat(relay): support protocol 3 in cell rollout gates - #20174
Conversation
There was a problem hiding this comment.
Caution
rehomeProtocol() now accepts protocol 3, but the same flag is still rejected one call earlier by parseCapacityPlanArguments, so a protocol-3 same-cap dispatch fails at plan validation. See the inline comment.
Reviewed changes
- Workflow inputs accept 3 — the
target-rehome-protocol/rollback-rehome-protocoldispatch choices and the reusable job's^(0|1|3)$guard now admit protocol 3. - Plan validator trust rule —
rehomeProtocol()accepts3, and rehome trust lines are expected forprotocol >= 1rather than only1. - Transition validator —
--regional-rehome-protocolaccepts3; the error message is updated. - Census test helper —
rollPlanmarks a cell trusted forprotocol >= 1.
⚠️ Protocol-3 rolls skip the post-restart trust proof
The job's Prove exact per-host trust and idempotent no-neighbor behavior step still runs probe-relay-rehome-trust.mjs only when the resulting protocol is exactly 1. Now that the dispatch inputs admit 3 and the plan validator emits trust lines for any protocol >= 1, a protocol-3 roll reaches regionalRehomeProtocol: 3 without running the per-host trust probe. If that is intentional (for example because protocol-3 trust is already proven by an earlier protocol-1 roll) it is worth a comment saying so; otherwise the gate should widen to != '0'.
Technical details
# Protocol-3 roll bypasses the application-mediated trust proof
## Affected sites
- `.github/workflows/cloud-deploy-relay-production-same-cap-job.yml:601-608` — step condition is `(mode == 'rollback' && rollback-rehome-protocol == '1') || (mode != 'rollback' && target-rehome-protocol == '1')`, so `target-rehome-protocol: 3` skips the probe.
- `cloud/apps/relay/src/app.ts:690` — the trust-probe endpoint accepts any `regionalRehomeProtocol >= 1`, so it is valid for `3` and not tied to the legacy `1`.
## Required outcome
- Decide whether a protocol-`3` roll must prove per-host trust. If yes, the step gate must cover `3`.
## Open questions for the human
- Is the `== '1'` gate a deliberate "only when trust is newly introduced" check, or did it predate protocol 3?openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
| // Only cells listed as regional rehome sources get rehome trust lines in their startup script. | ||
| function rehomeProtocol({ regionalRehomeProtocol }) { | ||
| if (![0, 1, '0', '1'].includes(regionalRehomeProtocol)) { | ||
| if (![0, 1, 3, '0', '1', '3'].includes(regionalRehomeProtocol)) { |
There was a problem hiding this comment.
parseCapacityPlanArguments still restricts this same flag to ['0', '1'] at line 46, so --regional-rehome-protocol 3 throws same-cap validation requires rollback image and rehome trust config before this function runs. Both plan-validation calls in the same-cap job pass DESIRED_REHOME_PROTOCOL, so a protocol-3 dispatch fails at the apply step (and on rollback-resume), defeating this PR's goal.
Technical details
# Protocol 3 rejected by the plan-validator argument parser
## Affected sites
- `cloud/dev/scripts/validate-relay-capacity-plan.mjs:46` — `!['0', '1'].includes(values['regional-rehome-protocol'])` rejects `3` in `same-cap-cell` mode; the sibling `rehomeProtocol()` at line 12 now accepts it.
- `.github/workflows/cloud-deploy-relay-production-same-cap-job.yml:504,531` — both `validate-relay-capacity-plan.mjs` calls pass `--regional-rehome-protocol "${DESIRED_REHOME_PROTOCOL}"`, which can now be `3`.
## Required outcome
- `--regional-rehome-protocol 3` must parse and reach `validateCapacityPlan`; the accepted set in `parseCapacityPlanArguments` and `rehomeProtocol()` must agree.
## Suggested approach
- Add `'3'` to the list at line 46 (or derive both lists from one shared constant), and add a `parseCapacityPlanArguments(..., '3')` case to `validate-relay-capacity-plan.test.mjs:740`; the existing parser test only covers `''`, `'2'`, and `'true'`.|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe change adds regional rehome protocol value Merge Risk: 🟠 High · up to Protocol-3 rollouts are currently blocked by the validator and could bypass the trust probe once unblocked. Both rollout-path defects should be fixed before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the main change and its scope, but it omits the required ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, boundary, Notes, and Checklist sections. Resolution Complete the required template sections. Add the linked issue after Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 09d2b753-6595-44a8-8144-e2fd818aff77
📒 Files selected for processing (5)
.github/workflows/cloud-deploy-relay-production-same-cap-job.yml.github/workflows/cloud-deploy-relay-production-same-cap.ymlcloud/dev/scripts/relay-same-cap-script-census.test.mjscloud/dev/scripts/validate-relay-capacity-plan.mjscloud/dev/scripts/verify-relay-capacity-transition.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Follow-up required to roll the idle regional rehome cell protocol safely. Extends the existing same-cap canary validators and workflow inputs to accept protocol 3 and emit rehome trust lines. Keeps the existing generation-bound and canary gates intact.