Prepare Factory Droid native transport with startup isolation hold

KH
1d ago
+4070-42

Factory native worker startup is held until inherited MCP server startup can be safely isolated. The adapter now reports unavailable and both normal launch and the direct host command refuse before helper/provider execution or runtime writes. Pre-existing managed workers are withheld from discovery, outbound caller/reply authority and incoming prompt delivery; their ownership records remain available for cleanup. Adding a private MCP alias and restricting tools does not exclude existing user/project/organization MCP startup, which can register or rotate an identity before a tool is requested.

The proposed native transport keeps a persistent JSON-RPC conversation, native session ID, serialized input, indexed delivery receipts, ambiguous-send fencing, and process-bound private Relay send capability. Those protocol/identity/delivery paths remain covered by tests, but production managed messaging is deliberately unavailable. Factory history collection is independent and remains RelayHistory's responsibility.

No global settings, HOME, model preference, credential, daemon, or existing session is changed. There is no bypass flag. A future isolated-profile design must verify all configuration sources and enroll its exact transcript root through RelayHistory before enabling startup.

Validation at b725a3304 (main 25974652f integrated; CHANGELOG was the only hand conflict):

  • 27 focused Droid tests pass, including adapter/direct-host refusal before side effects and a positively verified pre-existing worker denied all communication without a control-socket connection; input pump, permissions, ambiguity, deduplication and identity regressions remain.
  • Formatting, public-source and diff checks pass. Rust-oleum 0.1.3: same 100 violations as exact main 25974652f, none added/regressed. Main already exceeds daemon/store ceilings; this PR does not raise or suppress them. Veto host-performed reviewer/security/secrets loop passes; not an independent review.
  • Exact-head production proof passes (including exactly one SafeError guidance line, no generic connection fallback): a disposable compiled sentinel is positively controlled, then the production host emits the specific isolation refusal without invoking the provider or opening its logs/readiness. The refusal test recovered into a locked worktree after unrelated external cleanup removed build objects. No actual Factory, MCP, model or auth startup occurs.
  • The prior f4a64ba9c full Relay Node CI (Linux/macOS/Windows) passed in run 42408209893. Current-head normal Actions are running in Relay Node CI 42416573409; earlier head 93fdfb1f9 had no normal pull_request workflows while its merge conflict was present, so a green broker-only rollup was not full CI. no broad local suite rerun during disk constraints.

The branch includes main 72d98585 through merge b921bebf9; the obsolete PR-proof jobs are removed. Normal CI remains the release gate.

Droid 1.6.0 native compatibility and an owned read-only turn were separately verified; Droid 0.148.1 rejected inference with the same valid key. This is not live Relay MCP or hosted-history E2E proof. Live managed startup and outbound MCP verification remain blocked pending a proven isolation contract.

RelayFlow Proof

  • Change type: feature
  • RelayFlow case: factory-droid-persistent-native-worker

Test Plan

  • Protocol and hold regressions: 27 focused Droid tests.
  • Exact production-entry negative proof using a disposable sentinel; no real Factory provider, MCP, key or model startup.
  • Formatting, public source, quality delta and host-performed Veto checks.
  • Full current-head GitHub Actions: running normally after main integration.
  • Live Factory messaging E2E: intentionally not run while startup isolation is unverified.
  • Screenshots: not applicable to this core transport change.

The follow-up component batch at 78daf7f68 adds an app-owned inert Factory MCP helper and a pure config migration planner. While startup is held, initialize/ping/list cause no enrollment or Relay IPC and effectful calls are denied locally. Migration requires a trusted app-saved source/name/value-digest record plus a recognized contract; it preserves unrelated and unproven entries and disabled state. Organization configuration and reload remain explicit blockers. No live config writer or startup enablement is added.

Validation of that batch: 40 focused Droid tests pass; the compiled real CLI passes the isolated normal/dev component test with unchanged config snapshots and no Unix socket connection; formatting and source checks pass. Independent adversarial/contextual review found no material defect. These checks establish component behavior only. Desktop ownership-record persistence, atomic config installation, effective organization/alias/reload proof, native enrollment and actual model/Relay/hosted-history E2E remain required.

CI repair at 39410bc07: the compiled droid_mcp integration target now explicitly requires production-binaries, matching the executable it invokes and the existing relay_core_binary target. Normal default builds still run every unchanged helper assertion; library-only builds intentionally have no production executable. The library-only full test-target compilation passes, and the real normal/dev compiled helper test passes. No production guard or test-body assertion is weakened. Fresh exact-head CI must complete before readiness is claimed.