Skip to content

feat(relay): support protocol 3 in cell rollout gates - #20174

Merged
Jinwoo-H merged 4 commits into
mainfrom
relay-protocol3-rollout
Sep 12, 2026
Merged

Jinwoo-H merged 4 commits into
mainfrom
relay-protocol3-rollout

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​17 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-protocol dispatch choices and the reusable job's ^(0|1|3)$ guard now admit protocol 3.
  • Plan validator trust rule — rehomeProtocol() accepts 3, and rehome trust lines are expected for protocol >= 1 rather than only 1.
  • Transition validator — --regional-rehome-protocol accepts 3; the error message is updated.
  • Census test helper — rollPlan marks a cell trusted for protocol >= 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?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'`.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ccf62aae-1d85-4258-8ac6-b132d57941d8

📥 Commits

Reviewing files that changed from the base of the PR and between ad81735 and 66f6128.

📒 Files selected for processing (5)
  • .github/workflows/cloud-deploy-relay-production-same-cap-job.yml
  • cloud/dev/scripts/relay-same-cap-script-census.test.mjs
  • cloud/dev/scripts/validate-relay-capacity-plan.mjs
  • cloud/dev/scripts/validate-relay-capacity-plan.test.mjs
  • cloud/docs/orca-relay-operations.md

📝 Walkthrough

Walkthrough

The change adds regional rehome protocol value 3 to workflow inputs and validation checks. Capacity-plan validation now treats protocols 1 and 3 as rehome-trusted. Transition validation reports the expanded accepted values. Tests verify protocol 3 parsing, trust handling, and workflow probes. Operational documentation defines protocol 3 readiness requirements.

Merge Risk: 🟠 High · up to ad817

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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 se… Complete the required template sections. Add the linked issue after Fixes #, testing details and checklist status, the required Visual Proof response (N/A with a reason if applicable), and the remaining review, compatibility, and checkl…
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: support for protocol 3 in relay cell rollout gates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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 Fixes #, testing details and checklist status, the required Visual Proof response (N/A with a reason if applicable), and the remaining review, compatibility, and checklist information.

Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 09d2b753-6595-44a8-8144-e2fd818aff77

📥 Commits

Reviewing files that changed from the base of the PR and between 9c918b9 and ad81735.

📒 Files selected for processing (5)
  • .github/workflows/cloud-deploy-relay-production-same-cap-job.yml
  • .github/workflows/cloud-deploy-relay-production-same-cap.yml
  • cloud/dev/scripts/relay-same-cap-script-census.test.mjs
  • cloud/dev/scripts/validate-relay-capacity-plan.mjs
  • cloud/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.

@Jinwoo-H
Jinwoo-H merged commit 113e58f into main Sep 12, 2026
24 checks passed
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