Skip to content

t278: fleet-wide engine view — verified transports, engine picker, honest default identity - #41

Merged
MSD21091969 merged 2 commits into
mainfrom
feat/t278-fleet-engine-view
Aug 7, 2026
Merged

t278: fleet-wide engine view — verified transports, engine picker, honest default identity#41
MSD21091969 merged 2 commits into
mainfrom
feat/t278-fleet-engine-view

Conversation

@MSD21091969

Copy link
Copy Markdown
Contributor

What

Any seat can now read any fleet engine — the t278 goal ("see all workspaces on all engines, from any box"). WHAT a user sees on any engine stays the A3 access posture's decision; this PR only makes the transports resolvable and picks them honestly.

  • manifest: host_permissions widened to the three tailnet workstations (Z440 100.82.243.13 + twin ports, laptop 100.106.220.58, prodesk 100.87.28.95) alongside localhost.
  • surface-resolver: fleet transport tables; per-engine candidate pairs (localhost + tailnet) probed in preference order — the first engine that self-reports the expected kernel_urn wins (the same A6 authority the mismatch warning already reads). The same build therefore reads a Z440 twin over localhost on the Z440 seat and over the tailnet from hp-laptop / hpprodesk. Canonical Z440 directory fallback so ?surface= windows resolve fleet-wide.
  • adapter-factory: stored pilot.engine default-engine override, set from the new Settings engine picker (This box / Z440 primary / menno / lola / moos / Laptop / ProDesk). A ?surface= window's own verified resolution still wins.
  • worker: storage.onChanged drops the adapter memo when the override changes.
  • streamable-http-adapter: a defaulted engine urn no longer masquerades as hp-z440.primary in provenance — only an explicitly named engine carries an expectation. Kills the spurious ENGINE MISMATCH strip on non-Z440 seats; keeps the honest one for named engines.
  • smokes: worker-smoke mocks storage.onChanged, adds B3 (override acceptance end-to-end), and un-seat-locks B2/content assertions (gate on fold content / verified candidates, SKIP with a line otherwise); live-smoke assertions updated to the t278 transport semantics.

Safety invariants (unchanged)

  • READ-ONLY seat: zero new write paths. The override and the resolver change which engine is read, never what can be written (nothing can — apply_rewrite/apply_program remain unnamed and uncallable).
  • The access trust seam is untouched: identity still comes only from chrome.storage.local['pilot.access']; a page still cannot assert an identity or a workstation.
  • Transport authority is the engine's own /healthz kernel_urn — a stale hint or a down engine degrades to the visible mismatch/default path, never to silently-wrong data.

Gates (all run on hpprodesk — the seat that could previously read nothing but its own 9-node fold)

gate result
npm run typecheck 0
npm run build 0
smoke:live (vs Z440 over tailnet) 84 ok, exit 0
smoke:worker (shipped dist/worker.js) 53 ok, exit 0

Worker-smoke headline lines, from ProDesk:

surface=menno -> engine urn:moos:kernel:hp-z440.menno · reported urn:moos:kernel:hp-z440.menno · via http://100.82.243.13:8001 · seq 20
override -> engine urn:moos:kernel:hp-z440.primary · reported urn:moos:kernel:hp-z440.primary · 1 nodes · seq 705

Neither read was possible off the Z440 seat before this change.

Review focus

  1. The host_permissions widening — tailnet IPs are the tracked topology's own addresses, but this is a privilege-posture change on a minimal-privilege seat; that is why this is a PR and not a trunk commit.
  2. The defaulted-vs-explicit engine-urn semantics in streamable-http-adapter.ts — provenance honesty trade-off.
  3. Rollout: after merge, each seat reloads the unpacked extension (new permissions prompt) and picks its engine in Settings.

authored-by: agent:vscode.hpprodesk.primary / session:sam.hpprodesk-setup / t278-fleet-engine-view

🤖 Generated with Claude Code

…nest default identity

Any seat can now read any fleet engine (goal t278: all workspaces on all
engines, from any box; WHAT is visible stays the A3 access posture's call):

- manifest: host_permissions widened to the three tailnet workstations
  (Z440 + twins, laptop, prodesk) alongside localhost.
- surface-resolver: fleet transport tables; per-engine candidate pairs
  (localhost + tailnet) probed in preference order — the first engine that
  SELF-reports the expected kernel_urn wins, so the same build reads a Z440
  twin over localhost on the Z440 seat and over the tailnet from any other
  seat. Canonical Z440 directory fallback so ?surface= windows resolve
  fleet-wide (the t266 channel batch lives in the Z440 primary fold).
- adapter-factory: stored pilot.engine default-engine override (the new
  Settings "engine" picker; a read TARGET only — no write path exists or is
  added). A ?surface= window's own verified resolution still wins.
- worker: storage.onChanged drops the adapter memo on override change, so
  the next GET_FRAME rebuilds against the new default.
- streamable-http-adapter: a DEFAULTED engine urn no longer masquerades as
  hp-z440.primary in provenance — only an explicitly named engine carries
  an expectation, killing the spurious ENGINE MISMATCH strip on non-Z440
  seats while keeping the honest one for named engines.
- smokes: worker-smoke mocks storage.onChanged and adds B3 (pilot.engine
  override acceptance end-to-end); B2 + content assertions un-seat-locked
  (gate on fold content / verified candidates, SKIP with a line otherwise);
  live-smoke assertions updated to the t278 transport semantics.

Gates (all run on hpprodesk): typecheck 0 · build 0 · live-smoke 84 ok ·
worker-smoke 53 ok — including ?surface=menno read via 100.82.243.13:8001
and the pilot.engine override reading the Z440 primary (seq 705), both
from ProDesk, neither previously possible off the Z440 seat.

authored-by: agent:vscode.hpprodesk.primary / session:sam.hpprodesk-setup / t278-fleet-engine-view

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 6, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Enables fleet-wide engine reads from any seat by widening extension host permissions, introducing verified transport resolution (localhost vs tailnet) per surface/engine, and adding a stored default-engine override selectable from Settings while keeping provenance/mismatch behavior “honest” for defaulted engines.

Changes:

  • Expand engine transport resolution to probe ordered candidates (localhost/tailnet) and verify via /healthz kernel_urn, including canonical directory fallback for ?surface= resolution.
  • Add a Settings “engine” picker that persists pilot.engine and updates worker adapter memoization on override changes.
  • Adjust provenance stamping so defaulted engine URNs don’t appear as an explicit expectation (reducing spurious mismatch warnings on non-Z440 seats), and update smoke tests accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/worker.ts Clears memoized adapters when pilot.engine changes so new frames use the updated default engine.
src/mcp/surface-resolver.js Adds fleet transport tables, candidate probing/verification, and canonical directory fallback for fleet-wide ?surface= resolution.
src/mcp/streamable-http-adapter.ts Differentiates explicit vs defaulted engine URN for provenance/mismatch semantics.
src/mcp/adapter-factory.ts Introduces pilot.engine persistence helpers and applies stored override prior to surface resolution.
src/components/SettingsPanel.tsx Adds Settings UI section to select and persist the default engine override.
scripts/worker-smoke.mjs Mocks storage.onChanged, adds override acceptance test (B3), and makes assertions seat-aware.
scripts/live-smoke.mjs Updates resolution assertions to match new transport-candidate semantics.
public/manifest.json Widens host_permissions to include tailnet workstation IPs/ports in addition to localhost.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to +93
export async function savePilotEngine(cfg: PilotEngineConfig | null): Promise<void> {
try {
if (typeof chrome !== "undefined" && chrome.storage?.local) {
if (cfg && normalizeEngineConfig(cfg)) {
await chrome.storage.local.set({ [STORAGE_ENGINE_KEY]: cfg });
} else {
await chrome.storage.local.remove(STORAGE_ENGINE_KEY);
}
}
} catch {
// storage unavailable (served harness) -> no-op
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 816387e — savePilotEngine now persists the normalized object, so storage always matches what loadPilotEngine/resolveAdapterConfig consume. typecheck 0 / build 0 / worker-smoke 53 ok.

@MSD21091969

Copy link
Copy Markdown
Contributor Author

UX acceptance run — the shipped dist/ driven as a real loaded extension on hpprodesk (puppeteer + Chrome for Testing; branded Chrome 137+ removed --load-extension, CfT retains it). All legs green:

leg worker provenance readback
sidepanel.html?surface=tab {"engine":"urn:moos:kernel:hp-z440.primary","reported":"urn:moos:kernel:hp-z440.primary","url":"http://100.82.243.13:8000","seq":705}
panel default (no override) localhost honest self-report: hpprodesk.primary · seq 29 · LIVE · no spurious mismatch
Settings → engine → Z440 primary seq 705 · LIVE · no mismatch — picker lists all six fleet engines
sidepanel.html?surface=menno {"engine":"urn:moos:kernel:hp-z440.menno","reported":"urn:moos:kernel:hp-z440.menno","url":"http://100.82.243.13:8001","seq":20}

The ?surface=tab case is the exact window that rendered ENGINE MISMATCH + empty graph on this seat before the branch; it now reads the Z440 primary over the tailnet with matching self-report.

One observation for review: pip.html?surface=<key> standalone renders only the header — it is a MIRROR of panel-authored scratch by design, so surface windows should keep using sidepanel.html?surface=<key> (the launcher's existing pattern). Not a regression; noting it because I tripped over it in testing.

Suggested follow-up (separate PR): track the acceptance drive as scripts/ux-acceptance.mjs so this run is repeatable per-seat.

— agent:vscode.hpprodesk.primary · session:sam.hpprodesk-setup · convo: "Private repos access" · harness-session cc833891

Copilot inline catch on PR #41: the input was validated via
normalizeEngineConfig but the RAW caller object was persisted, so extra
fields or an invalid engineUrn could ride along in chrome.storage and
diverge from what loadPilotEngine/resolveAdapterConfig consume. Store the
normalized object. typecheck 0 / build 0 / worker-smoke 53 ok.

authored-by: agent:vscode.hpprodesk.primary / session:sam.hpprodesk-setup / t278-fleet-engine-view

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@MSD21091969
MSD21091969 merged commit 9795ffc into main Aug 7, 2026
1 of 2 checks passed
@MSD21091969
MSD21091969 deleted the feat/t278-fleet-engine-view branch August 7, 2026 06:26
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.

2 participants