Skip to content

ci(daemon): gate PRs on daemon protocol crossing from the newest release - #24089

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/node-rt-protocol-gate
Oct 1, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/node-rt-protocol-gate

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​219 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​191
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​252 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​252

ELI5

When a user updates Orca, their open terminals survive only if the new version can still talk to the terminal daemon that is already running. This adds a PR check that compares the change against the latest release and fails if it would break that.

What Changed

  • config/scripts/daemon-protocol-facts.mjs comes from the Windows update-diagnostic branch, with a stricter parser that fails loudly on formats it doesn't understand instead of passing quietly. It is also newly unit-tested.
  • config/scripts/check-daemon-protocol-crossing.mjs reads daemon-protocol-version.ts from the newest vX.Y.Z tag. It fails when the working tree neither speaks that release's protocol nor lists it in PREVIOUS_DAEMON_PROTOCOL_VERSIONS. Rollback compatibility is printed for information only. --release-ref or ORCA_CROSS_VERSION_BASELINE_REF pins the tag.
  • It runs as a step in the existing cross-version-wire job (full history, no new runner) and as pnpm run check:daemon-protocol-crossing. The job's path filter now includes daemon-protocol-version.ts.
  • Tag selection moved to config/scripts/stable-release-tags.mjs and is shared with the cross-version harness.

Why

The existing unit test only checks that the version list is append-only. Nothing on main compared a PR against what users actually run. The daemon protocol moved 36 → 38 in about two days, so an accidental break is a realistic risk.

Linked Issue

Part of the Node runtime plan (compatibility rule R1).

Visual Proof

N/A. This is a CI check only.

Testing

  • Against the real v1.4.217 (protocol 37 vs 38): OK. With 37 removed from the previous list: fails with a clear message.

  • Ran it against all 137 tags that have the file: 0 failures.

  • 61 unit tests plus the cross-version-wire unit tests pass. Lint and the changed-code gate pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Lands daemon-protocol-facts.mjs from the Windows update diagnostic branch with a
stricter parser, and adds check-daemon-protocol-crossing.mjs (rule R1): the working
tree must attach the newest release tag's daemon. Rollback crossing is reported only.
Runs in the cross-version-wire job, which already has full tags; tag selection moves
to config/scripts/stable-release-tags.mjs so both use one rule.
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Adds a new CI gate that checks daemon protocol compatibility.

The PR appears safe to merge based on the reviewed changes.

Summary

This PR adds a CI gate that compares the candidate’s daemon protocol compatibility with the newest stable release. It also shares release-tag selection with the cross-version harness and routes relevant changes to the gate.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[PR path classification] --> B[cross-version-wire job]
  B --> C[Select newest stable release tag]
  C --> D[Read release and candidate protocol facts]
  D --> E{Candidate can attach release daemon?}
  E -->|Yes| F[Pass; report rollback compatibility]
  E -->|No| G[Fail PR gate]
Loading

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7d08b19f-899e-4c28-861e-b3f08d5c0db8

📥 Commits

Reviewing files that changed from the base of the PR and between 2f506b3 and df0ba86.

📒 Files selected for processing (4)
  • .github/workflows/pr.yml
  • config/scripts/pr-code-change-scope-daemon-protocol.test.mjs
  • config/scripts/pr-code-change-scope.mjs
  • package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds daemon protocol parsing and attachability checks between the working tree and a stable release. The check selects a baseline release, reports upgrade and rollback compatibility, and fails when upgrade attachability fails. The cross-version wire workflow runs the check. Path classification and tests cover the new workflow routing.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to df0ba

The compatibility check rejects upgrades that drop the newest release’s protocol, and no remaining issue in the reviewed changes blocks merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to df0ba

The change adds a compatibility check within an existing CI job without introducing a new runtime endpoint or additional credentials. No concrete security concern was established. The assessment remains qualified because an independent full comparison with the base revision was unavailable.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated incremental exposure is additional file changes selecting an existing CI runner and executing the added check. No new access to production daemons, tenant data, or deployment credentials is demonstrated by that execution path.

Trust Boundaries and Controls

  • observed — PR-controlled paths influence CI selection, and source declarations influence the compatibility result. The added checker parses declaration text rather than evaluating it and invokes Git without shell interpolation. The selected job inherits contents: read and checks out with persist-credentials disabled.

Resilience and Maintainability Implications

  • inferred — The added CI check reads protocol facts and returns a verdict; it does not perform the daemon upgrade or mutate session ownership. Failure, interruption, and repetition therefore do not create a partial daemon transition requiring rollback or cleanup within this check.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.58% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 9 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: adding a CI gate for daemon protocol compatibility with the newest release.
Description check ✅ Passed The description is mostly complete and directly addresses the change. It includes the ELI5 summary, implementation details, rationale, visual proof, testing results, and agent-boundary declaration. It…
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: Docstring Coverage

Explanation

Docstring coverage is 31.58% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 9 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

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

ℹ️ No critical issues — one minor nitpick.

Reviewed changes

This PR adds a CI gate that fails a PR when the working tree can no longer attach the terminal daemon shipped by the newest stable release — the failure mode that strands live terminals across an update. CI-only; no runtime behavior changes.

  • New check:daemon-protocol-crossing gate — reads daemon-protocol-version.ts at the newest vX.Y.Z tag and fails when the candidate neither speaks that release's PROTOCOL_VERSION nor lists it in PREVIOUS_DAEMON_PROTOCOL_VERSIONS. Rollback crossing is reported for information only. --release-ref / ORCA_CROSS_VERSION_BASELINE_REF pin the tag.
  • Shared strict parser — config/scripts/daemon-protocol-facts.mjs parses the two declarations from source text and throws loudly on missing, duplicate, non-literal, empty, or out-of-range forms; canAttach / crossingRequirements encode the attach contract.
  • Shared tag selection — config/scripts/stable-release-tags.mjs extracts selectLatestStableReleaseTag / compareReleaseTags from the e2e harness; tests/e2e/cross-version-wire/release-checkout.ts now imports and re-exports it with no behavior change.
  • CI wiring — the step runs in the existing cross-version-wire job (full history, no new runner), and config/scripts/pr-code-change-scope.mjs adds the protocol file and the three scripts to the job's path filter.
  • Tests — parser, crossing-assessment, tag-selector, and path-classification tests; all land in config/scripts/**/*.test.mjs, so the sharded test job runs them.

I verified the runtime contract the gate encodes: PREVIOUS_DAEMON_PROTOCOL_VERSIONS is consumed by src/main/daemon/daemon-legacy-adapters.ts:32, which probes a per-protocol socket for each entry and adopts it — so the declared list is exactly the attach surface, and the gate's direction and message are correct. The gate also fails loudly on a shallow clone (no tags), and the job checks out with fetch-depth: 0.

ℹ️ Nitpicks

  • crossingRequirements computes rollback and bothDirections, but its only production caller (assessDaemonProtocolCrossing) reads just upgrade: rollback is asserted by a test yet never consumed, and bothDirections is referenced nowhere. Dropping the unused field, or wiring it into the failure output, would keep the helper honest.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@OrcaWin
OrcaWin merged commit 2a83c95 into main Oct 1, 2026
42 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