Repository navigation
cmux-next: read-only Huge Blue app-server inspection route - #21365
Merged
Merged
Conversation
GET /api/vm/:id/huge-blue-inspection reports disabled, unavailable, unenrolled or admitted for one of the caller's machines without minting a token, writing a lease or returning a route, credential or command. Ownership is checked in every mode, only running machines are probed, and the probe reuses the read-only cmux-tui attach bundle. Malformed or missing evidence fails closed. Refs #21332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Collaborator
|
Bead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
cmux-next has no read-only way to ask whether a registered Cloud machine can be inspected by the Huge Blue app server. The only Huge Blue surface today is the Run create refusal, and attach mints terminal credentials. Closes #21332. This implements slices 1 and 2 of the design in #21335, plus the Cloud probe from slice 3.
Change
GET /api/vm/:id/huge-blue-inspection[?deviceFingerprint=…]sits behindwithAuthedVmApiRoute, and the account and team scope come fromresolveVmRouteAccountScope.CMUX_HUGE_BLUE_INSPECTIONsets the mode.enabledprobes.disabledreturnsdisabled/inspection_disabled. When unset, it returnsunavailable/adapter_not_configuredwithretryable: false, which matches the Run route's Huge Blue refusal.runningget probed, so inspection never wakes a paused machine. The probe is the existing read-only cmux-tui attach bundle (remote-probe, enrolled devices, trusted-carrier listener). It never runsenroll createorapprove, records no lease or usage event, and does not callopenCmuxRemote.hugeBlueInspection.tsis a pure mapper and the only place a probe becomes a state. It fails closed:unavailable/daemon_probe_unreadableand drops all carrier and enrollment evidence.requireUserVmis now exported (no behavior change), so the read path skips the side effects ofrequireAccessibleUserVm.web/services/vms/README.md.Out of scope, as the issue asks:
SSHHosttargets. Those live in the macOS client registry, not the web API. This route accepts only registered Cloud machine ids and never a raw route.Validation
bun test tests/huge-blue-inspection.test.ts: 19 pass. Covers:bun test tests/vm-cmux-tui.test.ts tests/vm-snapshots-route.test.ts tests/vm-snapshots-workflow.test.ts tests/vm-route-auth.test.ts: 141 pass.bun run typecheck, eslint on the changed files andbun run lint:complexityare clean.Changelog
none
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds a read-only route that reports whether one of the caller's registered Cloud machines can be observed by the Huge Blue app server, closing #21332.
Changes
GET /api/vm/:id/huge-blue-inspection[?deviceFingerprint=…]sits behind the existing authenticated VM route helper, and ownership is checked from the owner or billing team in every mode, so foreign or unknown ids answer 404.CMUX_HUGE_BLUE_INSPECTIONselects the mode:enabledprobes,disabledrefuses, and unset or any other value isunconfigured.disabled,unavailable,unenrolled,admitted) and never contains tokens, routes, commands, or provider metadata.unavailable/daemon_probe_unreadable, and enrollment counts only when the caller named the device fingerprint.requireUserVmwith no behavior change so the read path skips access-verb side effects.web/services/vms/README.md.Validation
Written for commit 521f1f9. Summary will update on new commits.