Skip to content

spec: add FLOW_DISABLED / FLOW_NO_START_NODE to AutomationResult.code and deliver the trigger ruling's remaining two rows (409/422) #9415

Description

@os-zhuang

Completes the maintainer's #9378 ruling (2026-08-17 「同意」 batch). PR #9413 delivered two of its four rows (404, 400 FLOW_FAILED) and stopped on the other two exactly as dispatched: the ruled 409 (flow disabled) and 422 (no start node) are both never-dispatched exits, and the closed AutomationResult.code union has no honest member for either — RUN_NOT_FOUND is documented as a resume fact, nothing maps to 422 at all. Both workarounds were measured and rejected (message-text regex = PD #12; route-side enable-state probe = duplicated execution policy + a TOCTOU window that answers "disabled mid-flight" as "malformed definition").

This is the spec-seat fragment the #9384 ruling routes here: a deliberate union widening with measured need, not a mid-PR mint.

The work

  1. packages/spec/src/contracts/automation-service.ts — add 'FLOW_DISABLED' and 'FLOW_NO_START_NODE' to the AutomationResult.code union, with TSDoc stating each is a trigger-time refusal the engine classifies before dispatch (distinct from the resume-refusal members). Per fix(automation): answer real HTTP status codes on both trigger routes #9413's measurement: union members + TSDoc only, no generated-artifact churn (the api-surface snapshot records the interface without member detail — re-verify, don't trust).
  2. Engine (packages/services/service-automation/src/engine.ts) — the disabled-flow and no-start-node exits stamp their codes (they continue to carry no status, preserving fix(automation): answer real HTTP status codes on both trigger routes #9413's provable separation of never-dispatched from ran-and-failed).
  3. Route (respondToFlowTrigger, packages/runtime/src/domains/automation.ts) — two new arms reading the producer codes: FLOW_DISABLED409, FLOW_NO_START_NODE422. ADR-0112 ledger registration for both codes per standing process.
  4. Flip the pins: the two "stay unchanged at 200" assertions in automation-trigger-route-status.test.ts were written to flip when this lands — their comments say so; flip them to 409/422 citing this card, plus client-side pins mirroring the FLOW_FAILED ones.
  5. Docs re-verification (from fix(automation): answer real HTTP status codes on both trigger routes #9413's drift advisory): content/docs/api/client-sdk.mdx, api/plugin-endpoints.mdx, automation/flows.mdx, protocol/kernel/http-protocol.mdx, ui/actions.mdx — re-verify the trigger-route/SDK failure semantics against the post-fix(automation): answer real HTTP status codes on both trigger routes #9413+this state; correct what drifted (⛔ not content/docs/releases/).

Tier

⚠️ Fable-mandatory by clause ② (content judgment, not path): this changes contract accept/reject vocabulary on a closed public union. The dispatch claim records the tier with this reasoning.

Landing

The PR carries Fixes #9378 — merging it completes all four ruled rows and closes that card. Ships as minor per the fixed-group convention (see #9413's changeset note); its changeset extends the same migration story (the "pending a ruling" paragraph in #9413's changeset becomes resolved behavior).

Refs: #9378 (the ruling and the tracker) · PR #9413 (rows 1–2 + the measured exclusion) · #9384 (the union-stays-closed ruling and its spec-seat routing) · ADR-0112.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions