refactor(runtime): share host command runner construction

Merged
TH
3d ago
+258-43

Summary

Build inventory and operation hosts' command ports through one host-owned factory. The two copies previously owned the same environment-overlay, device-shell guard, cancellation and result-projection rules independently. Requests still use only their own cwd; absent request.env still delegates inheritance to the enclosing command host.

Seven files change, including one required root-module zone declaration. Shipped production source shrinks by 7 raw lines and 119 bytes including helper/import/comment overhead. The benefit is one owner for these rules; CI measures installed/unpacked size −236 B and compressed download −83 B. No linked issue or runtime scope expansion.

Validation

  • Head a4a111056585644d6792cf5efaa20ed262bef739; base eedc0df3d2168275dcd89ed21613c3362d595731.
  • AGENT_DEVICE_VITEST_MAX_WORKERS=1 pnpm check:affected --run --head a4a111056585644d6792cf5efaa20ed262bef739: passed, exactCommit: true; receipt run-xGMxfR, 39 passed / 25 skipped / 2 deduplicated checks, 1,756 related tests passed.
  • Independent Apex review at e72d95f confirmed the port bodies are equivalent and the owner is appropriate. Addressed its deadline-test timing margin, inventory host-PATH coverage and cwd-documentation findings. Follow-up reviewed locally; 18 focused tests passed.
  • GitHub owns full coverage, integration, package-size and platform smoke evidence. Parked replay/device lanes were skipped locally. No dispatch, capture, interaction, lifecycle or native execution behavior changes; manual device verification is unnecessary.