Skip to content

Infrastructure: Add owned-process lifelines and typed desktop service readiness #4444

Open

Description

@JasonVMo

Current status - 2026-11-07

Blocked for landing by F2 #4442; both tracks are implemented together in #4463 and can co-land. F1's shared factory/durable-recovery contract is already merged in #4455.

The Windows/Win32 follow-up injected startup failure after a real typed-ready receipt and shutdown failure before the exact owned channel stop. Recorded channel/helper survivors were reconciled using their original stop callbacks; failed claims remained fenced until exact cleanup. This is bounded operator reconciliation, not automatic recovery or a fixed-time crash-containment guarantee.

Remaining acceptance: qualify macOS supervisor/Metro/channel/helper survivor behavior separately for Fabric/Paper (#4441), and Windows descendant/Job Object ownership and containment in #4447. Windows hard-terminates non-detached children with a crashed owner in the observed setup; the three cooperative crash-disposal contracts are skipped there, not passing native coverage. Preserve borrowed/attached applications, failed-withdrawal fences, and unresolved effects throughout.

Goal

Cooperative owned children (Metro, the Storybook channel/driver child, and helpers) have no parent lifeline, and the parent learns about readiness by polling an agent-ready file the child writes. Add lifelines and correlated, typed readiness so that a crashed parent or stalled child produces verified cleanup or an explicit fenced result.

Part of #4435 (plan item F3).

Scope

  • Owner: process lifecycle.
  • Paths (under packages/agentic/): desktop-test/src/{commands,ownedService}.ts, storybook-desktop/config/{server,server-runner}.cjs, reporting transport integration, and process contract fixtures.
  • Give cooperative owned children a parent lifeline and explicit disposal.
  • Replace authoritative ready-file polling with correlated typed readiness that keeps the tiers distinct: service ready, target acquirable, application ready, and context ready.
  • Keep the channel/driver child in place unless measurements justify relocation.
  • Durable settlement from F1 Infrastructure: Unify desktop driver-service composition and wire durable recovery #4436 must be wired before a lifeline may terminate a service in the middle of a mutation.

Dependencies

Acceptance

  • Parent or wrapper crash, late spawn, failed withdrawal, and stalled-child cases produce verified cleanup or fenced incomplete results.
  • Surviving cooperative owners withdraw their descriptors.
  • Borrowed resources remain running.
  • Windows descendant containment and macOS survivor behavior are qualified explicitly; no fixed-time cleanup guarantee is assumed.

Validation

  • Iterate with focused yarn test <name> in each changed package, then run its yarn format, yarn lint, yarn build, and yarn test. Finish with yarn clean-lage-cache then yarn lage buildci; run yarn lage test-links --verbose --grouped after markdown changes.
  • Add a patch changeset for each changed published package. Update the owning references/current-status.md rows (done, work in progress, unsupported) and affected README/AGENTS guidance in the same change.
  • Native, provider, or process-topology changes need matching-OS native contracts and the affected consumer lane. JavaScript tests and bundles do not qualify native behavior; hosted capability skips are not passes. Report each check as passed, failed, skipped, not run, or unsupported.

Evidence

  • Current state: "Supervisor crash containment" in packages/agentic/desktop-test/references/current-status.md; process topology in packages/agentic/storybook-desktop/references/integration.md.
  • Retired plan: driver-next.md at 0569e1b86, sections 6 (readiness tiers) and 8 (F3).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions