fix(sdk): fail closed on hosted extension dispatch
Problem
Schema-2 extensions can install and contribute provider watch rules, but their entries are ordinary authored JavaScript. The runtime does not yet isolate f.run, helpers, MCP, harnesses, or direct Node access to FlowExtensionPermissions. The prior head selected a handler from user-controlled input.event and passed it the base flow context; independent review correctly rejected that design.
Babysitter remains an optional extension of Software Garden, not a second Recommended Flow. This PR now establishes the safe boundary only; it does not claim that Babysitter handlers can execute.
Change
- remove input-derived handler selection; direct-run JSON cannot opt into extension execution
- accept dispatch metadata only through a separate executor option branded with a non-serializable authority symbol after the host verifies an integration delivery
- validate provider, event type, and delivery identity and fail closed on forged, serialized, malformed, duplicate, or generic/action-overlapping dispatch
- refuse a matched handler with plugin_unsupported before either the base or extension body runs because manifest permission isolation is not implemented (gate 8 / #442)
- document the current refusal boundary instead of claiming permissions are enforced
- keep the exhaustive preflight refusal taxonomy guarded
Verification
$ npm run typecheck --prefix packages/sdk
> @relayflows/sdk@2.0.25 typecheck
> tsc --noEmit && tsc -p tsconfig.type-tests.json
$ npm run build --prefix packages/sdk
> @relayflows/sdk@2.0.25 build
> tsc && node scripts/make-cli-executable.mjs
$ npm run typecheck:tests --prefix packages/sdk
> @relayflows/sdk@2.0.25 typecheck:tests
> tsc -p tsconfig.tests.json
After the same built-local-Surface override used by the Cloud runtime artifact workflow:
$ cd packages/sdk && ./node_modules/.bin/vitest run tests/preflight.test.ts tests/authored-flow.test.ts tests/flow-extension-compose.test.ts
Test Files 3 passed (3)
Tests 115 passed (115)
Duration 11.68s
This PR does not publish packages, update a catalog, implement session lineage, or enable merge/write capabilities. Actual Babysitter execution remains blocked until an isolated/native existing-session path proves and enforces its authority boundary.