fix(desktop): correct the preview loopback boundary and pin its boot wiring #6037
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 324 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6037"
general
weight: 0.35
M4n5ter
Summary
Two small follow-ups from the #5254 review (preview capability preflight). Neither changes behaviour.
loopback_endpointboundary copy. It said averifiedanswer does not prove "that the embedded browser shares this loopback namespace". But the embedded browser runs in the Desktop process, so it does share Desktop's loopback. What averifiedanswer actually leaves unproven is the remote case: when the Runtime Host runs over SSH (runtime-host-managed-services.ts:54), the listener answering on the Desktop machine need not be the server the agent started. A local service on the same port would also answer. The boundary now says that, and the existing endpoint test asserts it. This matters for #5235, which builds on this classification.runtime-host-boot.tspublishes the preflight in thedesktop_artifact_previewoffer viabuildArtifactPreviewOfferTools({ preflight: createPreviewPreflightAuthority(), … }), and no test covered that call. Boot can't be constructed in a unit test, so the new test pins the call from source, the same waymain-startup-lifetime.test.tspins other boot contracts.Refs #5254
Verification
node --test dist/main/__tests__/preview-preflight.test.js: 28/28 pass (the existing 27 plus the new wiring test).- Replacing
createPreviewPreflightAuthority()in boot fails the new wiring test (27/1).- Restoring the old boundary copy in the built output fails the endpoint test (27/1).
biome linton both files: clean.apps/desktop/**is outside Biome's formatter scope.build:mainemits. The remainingtscerrors come only from@maka/uiand@maka/computer-use, which I couldn't build on this host, and none are in the changed files. CI's full typecheck is the authority here.AI use
Select exactly one:
Tool(s) and scope: Claude Code wrote both changes and ran the mutation checks; I reviewed them.
Checklist
Does this PR entail a change in behavior?
🤖 Generated with Claude Code