Skip to content

feat(hosts): servers publish a host descriptor - #27193

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/d4-d4-i2b-1
Oct 10, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/d4-d4-i2b-1

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​220 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​220
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​162 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​160

ELI5

Each Orca server now has a name tag that stays the same for as long as its profile exists. It shows that tag when you pair with it and whenever a client asks for its status. Nothing reads the tag yet. The next PR uses it so that re-pairing the same server keeps its sessions.

What Changed

Before: a client could recognise a paired server only by its encryption key. That key can't tell "the same server, paired again", "a server whose profile was moved to a new machine" and "a copy of a server" apart.

After: for users nothing changes yet. On the wire, status.get and runtime pairing offers carry a new optional hostDescriptor:

  • installationId: a random id the server creates once and stores in its profile (host-installation.json). The file is created under a cross-process file lock (the existing withFileTransactionLock). The server reads it again after getting the lock and then writes it with an atomic rename, so two processes starting at the same moment, or repairing a corrupt file at the same moment, end up with one id. If the server can't read an existing file, it publishes no descriptor rather than making a new id, which would silently split its identity.
  • machineBinding (optional): HMAC-SHA256 with the installation id as the key, over the machine id plus the profile path. The machine id is Windows MachineGuid, Linux /etc/machine-id or macOS kern.hostuuid, read through the existing profileStateAccessMachineIdentity. Because the installation id is the key, the binding can't serve as a machine identifier across apps. If no machine id is readable (common in containers), the binding is left out. It is only a hint that the profile moved or was copied, never an identity by itself.

How it works: the RPC server loads the descriptor next to the pairing keypair, since it owns the profile. It adds the descriptor to runtime-scope offers and publishes it under its runtime id. status.get reads it from there. Mobile-scope offers leave it out: the phone never pins it, and extra bytes make the QR code denser.

Why

This is step one of the host-descriptor plan (host publishes; the client pins it in the follow-up). The design considered the encryption key alone and found it can't separate a re-pair from a moved profile or a copy.

Wire compatibility:

  • Both fields are optional. Older hosts don't send them. Older clients drop them, because the offer schema has always been a non-strict object.
  • On the new side, an unreadable descriptor in an offer is dropped (.catch(undefined)) instead of failing the whole offer, so a future format change can never block pairing.
  • No new RPC method or stream opcode is added, so there is nothing to negotiate. A present field means the server publishes a descriptor.

Two changes from the design, with reasons:

  • No host-descriptor.v1 capability. With no new method, the capability would only repeat what the field's presence already says.
  • orca serve --reset-identity moves to the follow-up (I2b-2). Its only use is deliberately cloning a server so that clone detection treats the copies as different, and clone detection lands with I2b-2. It also has to rotate the pairing keypair, which un-pairs every device. That should ship together with the client rules that explain it.

Linked Issue

None. This is groundwork for #11574, which the client-side follow-up closes.

Visual Proof

N/A: wire and persistence change only, nothing visible.

Testing

  • Automated tests added/updated
  • host-descriptor.test.ts: the id is created once and reused. Concurrent creators, and concurrent repairs of a malformed file, all return the one stored id. A file that exists but can't be read publishes nothing and writes nothing. Moving the profile to another machine changes only the binding. A copied profile path gives a different binding. Different installations on one machine get different bindings. No machine id means no binding.
  • runtime-rpc-pairing-offer.test.ts: status.get and a runtime offer carry the same descriptor. The mobile offer has none. The descriptor stays the same across a server restart on the same profile. It is withdrawn on stop.
  • tests/e2e/cross-version-wire/cross-version-host-descriptor.unit.test.ts runs against the real v1.4.224 release. The old release parses an offer from the new host and drops the descriptor. The new build parses an offer from an old host. A descriptor in a shape this build can't read never blocks pairing.
  • pnpm tc, oxlint and check:code-quality:changed pass. The runtime RPC suites pass. Tested on macOS; Linux and Windows are covered by CI.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the installation id is not a secret, since it is published to paired clients. The machine id itself is never sent, only an HMAC keyed per installation. The file is written with mode 0600.
  • SSH and remote: managed and tunneled orcad offers re-encode the parsed offer, so they keep the descriptor.
  • Mobile: mobile offers are unchanged, and status.get to mobile gains one optional field that older apps ignore.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

A paired server now reports a stable installation id, created once per
profile, plus an optional machine binding (HMAC keyed by that id over
the machine id and profile path) in status.get and in runtime pairing
offers. Optional fields only: older clients ignore them and older hosts
omit them. Clients start using it in the follow-up.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 56bccf1f-595f-4bc6-84c0-e5ec19cde64b


📥 Commits

Reviewing files that changed from the base of the PR and between ee3aece and 0d06547.



📒 Files selected for processing (3)
  • src/main/runtime/host-descriptor.test.ts
  • src/main/runtime/host-descriptor.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-lifecycle.ts


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




📝 Walkthrough
📝 Walkthrough

Walkthrough

The runtime now stores a persistent installation ID and can derive a machine binding from the installation ID, machine identity, and resolved user-data path. Runtime startup loads and publishes the descriptor. Status responses and runtime-scoped pairing offers include it when available; mobile-scoped offers omit it. The pairing-offer schema accepts valid descriptors and discards invalid ones. Tests cover persistence, fallback behavior, binding changes, runtime lifecycle, and cross-version parsing.



Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 0d065

No identified descriptor issue blocks merging after normal checks.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description thoroughly explains the change, motivation, compatibility, testing, and operational considerations. However, the required Linked Issue section states “None” and only references #11574 … Add a valid linked issue in the Linked Issue section, such as the applicable issue URL or Fixes #11574 if that issue is the correct target. If the author is a maintainer, attach the relevant pre-existing issue instead of leaving the secti…
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check Passed The title clearly identifies the main change: servers publish a host descriptor.

Full details: Description check

Explanation

The description thoroughly explains the change, motivation, compatibility, testing, and operational considerations. However, the required Linked Issue section states “None” and only references #11574 without linking an actual issue.

Resolution

Add a valid linked issue in the Linked Issue section, such as the applicable issue URL or Fixes #11574 if that issue is the correct target. If the author is a maintainer, attach the relevant pre-existing issue instead of leaving the section as “None”.


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



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@OrcaWin
OrcaWin merged commit cbeb703 into main Oct 10, 2026
32 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