feat(sdk): compose hosted Garden Babysitter
The canonical Software Garden could load the reviewed native Babysitter artifact and the capability sandbox could execute it, but hosted callers had no single composition boundary. They had to pair base and installation authority themselves, while the ordinary authored loader correctly refused hosted handlers because it imports tenant JavaScript in the host.
This adds runHostedSoftwareGardenBabysitter, which atomically captures the exact reviewed Garden source and complete lock-backed extension installation as one opaque generation, then executes the matched handler through the existing Linux capability sandbox. The ordinary authored executor remains fail closed. A deterministic inventory test pins the published artifact coordinates; Linux cases cover missing artifacts, digest drift, wrong routes, queued/duplicate receipt replay, capability refusal, and the successful composed path.
The catalog handoff now reflects the product decision that Babysitter is a first-class Recommended Flow extension related to Software Garden. Discovery remains separate from activation. Cloud #4002 still names relay:hosted-flow-extension:v1 as the external owning-runtime dependency; activation must remain blocked until that runtime calls this entrypoint and a live original-session receipt is captured.
This deliberately avoids every path owned by open PR #584. Its later Software Factory digest repin is consumed dynamically through loadHostedExtensionRuntime.
Local verification
Command:
$ npm run typecheck --prefix packages/sdk
> @relayflows/sdk@2.0.33 typecheck
> tsc --noEmit && tsc -p tsconfig.type-tests.json
Command:
$ cd packages/sdk && npx vitest run tests/software-garden-babysitter-composition.test.ts tests/flow-extension-compose.test.ts
RUN v2.1.9 packages/sdk
✓ tests/software-garden-babysitter-composition.test.ts (6 tests | 5 skipped) 53ms
✓ tests/flow-extension-compose.test.ts (22 tests) 8969ms
Test Files 2 passed (2)
Tests 23 passed | 5 skipped (28)
The five new skipped cases require Linux and /usr/bin/bwrap; this macOS run is inventory/composition evidence, not sandbox execution evidence. The repository's linux-x64-artifact CI job is the runnable E2E gate.
Command:
$ git diff --check
# no output; exit 0
No merge, publish, release, catalog mutation, activation, or deployment is performed here.
[!NOTE]
Medium Risk
Adds the security-sensitive hosted composition path for native Babysitter execution; behavior is gated by existing sandbox checks and new fail-closed tests, but no production runtime wires the entrypoint yet.
Overview
Introduces runHostedSoftwareGardenBabysitter, the canonical hosted entrypoint for Software Garden + native Babysitter. Callers pass a flowPath only; the SDK loads base and lock-backed installation as one generation via loadHostedExtensionRuntime, then runs the matched handler through the existing Linux capability sandbox. The ordinary authored executor stays fail-closed (plugin_unsupported); comments and exports document that hosted delivery must use this boundary instead of pairing authorities manually.
docs/BABYSITTER-CATALOG-HANDOFF.md is updated to treat Babysitter as a first-class Recommended Flow extension, name this entrypoint as the activation prerequisite, and point Cloud #4002 at the external Relay/Flows runtime that must call it before lineage reaches relay:native-existing-session:v1.
New software-garden-babysitter-composition.test.ts pins reviewed artifact coordinates in the lockfile and adds Linux fail-closed cases (missing install, digest drift, unroutable events) plus optional bwrap cases for successful execution, receipt replay, and capability refusal.
Reviewed by Cursor Bugbot for commit c4a655d498ae59354918c1591a8e149cfc7bfafe. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Adds runHostedSoftwareGardenBabysitter, a single composition entrypoint that captures the reviewed Software Garden source and its lock-backed Babysitter installation as one opaque generation and executes the matched handler through the Linux capability sandbox. The ordinary authored executor stays fail closed because it imports extension JavaScript in the host, so hosted callers previously had to pair base and installation authorities by hand.
Rollout and catalog
- The catalog handoff now classes Babysitter as a first-class Recommended Flow extension related to Software Garden; discovery stays separate from activation.
- Activation remains blocked until Cloud #4002 calls this entrypoint and a live original-session receipt is captured.
Tests
- A deterministic inventory test pins the reviewed artifact's commit, digest, and manifest hash as the only composition member.
- Linux sandbox cases cover missing artifacts, store digest drift, unroutable deliveries, capability refusal, and queued/duplicate replay with a stable delivery identity and extension authority.