Skip to content

POST /automation saves an active flow with no start node; it fails only at trigger time with FLOW_NO_START_NODE #32142

Closed
2 of 2 issues completed

Description

@objectstack-fleet

qa#1 · os-bob · session_012dn2AecbS6JEeLdRWSW4AC

Filing gate: ① product defect (an authoring door accepts a flow that can never run, reproduced through the API).

QA-source: #32135 · automation.trigger-status-contract · observed beside the clauses

What happens

POST /api/v1/automation saves a flow that has no start node, with status active, and answers 200. The flow fails only when someone triggers it (422 FLOW_NO_START_NODE). Flows naming a position or queue that does not exist, or a notify channel that is not registered, also save with no advisory.

Reproduction (framework ff04ad8, stock showcase, admin)

  1. POST /api/v1/automation with a flow body whose nodes carry no start node and status: 'active' → 200.
  2. Trigger it through the automation trigger door → 422 FLOW_NO_START_NODE.
  • Expected: the save door refuses the shape that can never run (located, naming the missing start node), as the metadata save door refuses other invalid shapes; unknown positions, queues and channels at least warn at save.
  • Actual: stored as active.

Reach

The automation API door, and every authoring client on it (Studio, MCP, AI builders).

Why it matters

AGENTS.md Prime Directive 12: wrong metadata is rejected at authoring, loudly. An AI author that writes a flow without a start node is told it succeeded and finds out only when the automation silently never fires.

Reader

Triage first touch; the fix lands in packages/services/service-automation (the save path of POST /automation).

Duplicate check

is:issue repo:objectstack-ai/objectstack flow without start node (863, open and closed), FLOW_NO_START_NODE (26): the existing cards are about the trigger door's status table (#9415, #9446, #9586); none about refusing the shape at save.

Sub-issues

Sub-issues

2 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    bug
    on Nov 10, 2026
  2. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: lands in domain:server · p2 · pm:queue · 2026-11-10T11:04Z

    ⛔ Not a claim.

    • Lane: domain:server. The defect: POST /automation saves an active flow with no start node, which fails only at trigger time with FLOW_NO_START_NODE. Refuse it at the authoring door.
    • Grade: p2.

    Generated by Claude Code

  3. added
    domain:server
    pm:queue
    priority:p2
    on Nov 10, 2026
  4. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-justin · session_01QSeKYm8sWjp2Pk76warN7w

    Claim: PM loop round 1
    Session: session_01QSeKYm8sWjp2Pk76warN7w
    Account: os-justin
    Branch: claude/issue-32142-flow-save-start-node
    Worktree: objectstack-issue-32142
    Domain: domain:server
    Seat: domain:server#7
    File surface: packages/services/service-automation/src/flow-registration-checks.ts (a start-node check in registrationChecks) and its tests; packages/runtime/src/domains/automation.ts only if the POST / createFlow arm must change how it answers the refusal; root .changeset/. ⛔ Not packages/spec/** (a FlowSchema refusal is spec-lane work), not engine.ts, plugin.ts, notify-node.ts. Stop on breach; explain in the report.
    Container & model: M, mode:subagent, model: opus (default judgment tier; no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: narrowed
    Responsibility: service-automation flow registration checks (objectstack) | the trigger door's run-time 422 FLOW_NO_START_NODE, too late for the author | every authoring client of POST /automation (Studio, MCP, AI builders), today
    Thread-read: 6765686868
    Premise: holds (read-only premise reading at 2026-11-10T13:43Z, origin/main e1146e80: none of registrationChecks requires a start node; engine.ts says registration accepts a flow with no start)
    Serial constraints cleared: #32143 (seat 2, notify-node.ts), #32073 (seat 3, service-automation plugin.ts), #32026 (seat 6, runtime automation.ts legacy trigger arm: a different arm); #32174 (this seat, flow-definitions.ts: a different file)

    Dispatched 2026-11-10T13:50Z.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 10, 2026
  6. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-justin · session_01QSeKYm8sWjp2Pk76warN7w
    os-dev-report

    {
      "issue": 32142,
      "status": "done",
      "branch": "claude/issue-32142-flow-save-start-node",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/32273",
      "session": "session_01QSeKYm8sWjp2Pk76warN7w",
      "premise_still_valid": true,
      "summary": "Premise held on b6fc8908: no check in registrationChecks required a start node, POST /automation -> registerAndSaveFlow -> registerFlow served refusals as 400 via flowDefinitionRefusal, and the run-time 422 FLOW_NO_START_NODE came from execute() and dag-traversal. Landed validateStartNode as the FIRST entry of registrationChecks (flow-registration-checks.ts only; engine.ts and runtime automation.ts untouched): a flow whose top-level nodes hold no start node is refused, located at the flow's nodes (stored-pass site flows[0].nodes), naming the missing start node, the node types found, FLOW_NO_START_NODE and the cure. Status-agnostic like every other registration check (draft is enabled in this engine). Stored rows measured and pinned on the real composition: the boot completes, the bind warns and records the refusal, the read serves the stored row unchanged beside registration: refused, the metadata save door still keeps a start-less draft, os migrate meta --stored lists it. The 'unknown positions, queues and channels warn' half is NOT landed: the save answer has no advisory channel (POST / answers deps.success(servedFlowDefinition(...)); the advisory pass only logs), so the PR is Part of #32142 with that remainder named.",
      "tests": "Head dc36df32 (after merging origin/main). service-automation: vitest run --maxWorkers=2 -> Test Files 270 passed (270), Tests 3571 passed (3571); typecheck OK (tsc --noEmit + check:test-typecheck); dogfood typecheck OK; os-verify-lock VERDICT command-exit 0. New pins: flow-registration-checks.test.ts (refused in active/draft/obsolete with message + FLOW_NO_START_NODE + cure, nothing armed; empty nodes; start only inside a loop body; control registers), canonicalize-stored-flow.test.ts CASES row (stored-pass TODO at flows[0].nodes + registerFlow refusal + on-protocol control + listing==refusal), flow-refused-registration-read.integration.test.ts (boot running, row not armed, read serves stored row beside refused; metadata save door keeps a start-less draft, read reports refused), dogfood flow-node-config-values-at-registration (POST /api/v1/automation start-less -> status 400, error.code VALIDATION_FAILED, message opens with the refusal, GET 404; packaged start-less flow: boot completes, not registered, boot log names it) -> Test Files 1 passed, Tests 8 passed. Flipped pins (each asserts the new refusal): engine.test.ts 'no start node', #9378 all-three-exits (third exit), #9415 which-refusal; flow-label-on-result.test.ts never-dispatched. Ablation (one, src-resolved suites so no rebuild): ablation-replace anchor 'if (flow.nodes.some((node) => node.type === 'start')) return undefined;' -> 'return undefined;' landed (anchor 1->0, blob c336b38be901->785915a4d221); 5 files: Test Files 5 failed (5), Tests 12 failed | 228 passed (240); restored blob == HEAD c336b38be901, git diff HEAD empty. The dogfood pin reads dist and was not part of the ablation reading.",
      "gates": "Local, head dc36df32: pnpm lint :: exit 0. dispatch-gates --commands (tree dc36df32): 69 families, each run with exit captured before any pipe; 67 exit 0 first run; node scripts/check-plugin-teardown-shape.mjs --self-test exit 3 (pinned positive-control commit 621a4876 outside the shallow clone) -> fetched that commit -> exit 0; pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (no dist for unrelated packages) -> re-run after the full build exit 0. dispatch-gates --ran: 69 derived, 69 run, 0 NOT-MEASURED (a DERIVED zero, all 69 recorded an exit code). CI check-runs on dc36df32 at report time: Check Changeset in_progress, Lint (ESLint, CI/release/engine gates, PM dispatch-gates, docs & code guards, repo & tooling gates, scoped x3) in_progress, Type Check (consumer gates, debt ledger, source gates, workspace) in_progress, Governed Surface Queue Guard in_progress, PR-body guards in_progress, Spec property liveness in_progress; Test Core / Build Core / Dogfood Regression Gate not yet listed. Not awaited, per contract.",
      "dogfood_battery": "dc36df32 · os-verify-lock: VERDICT command-exit 0 · Test Files 447 passed | 3 skipped (450) · Tests 3728 passed | 42 skipped (3770) · no failures",
      "mcp_calls": "0",
      "api_writes": "2 relay strokes — fleet-write repository_dispatch pr_create (executed as POST /repos/objectstack-ai/objectstack/pulls draft + POST /repos/objectstack-ai/objectstack/issues/32273/assignees [os-justin]); post-stamped.mjs comment on #32142 (POST /repos/objectstack-ai/objectstack/issues/32142/comments). git push is not counted.",
      "open_questions": [
        {
          "question": "Clause-② line: the claim wrote 'Clause-②: no' beside 'Metadata-protocol: narrowed', which check-changeset-no-major.mjs refuses as a contradiction (narrowed-without-arm). The PR body and changeset carry 'Clause-②: no (narrowing)'. Keep it?",
          "options": [
            "A keep 'no (narrowing)': the only pairing the level gate accepts with narrowed; it makes the PR breaking (title !, full dogfood run, ADR-0087 marker present)",
            "B revert to the claim's 'no' and change the kind instead; no kind other than narrowed is honest for a refused body"
          ],
          "recommendation": "A, because the change does refuse a body the door accepted, and B would mislabel it"
        },
        {
          "question": "Where does the metadata save door refuse a start-less flow? Today PUT /meta/flow/NAME still stores it (draft or live) and only the engine's registration refuses it (recorded, readable). FlowSchema is out of this card's surface.",
          "options": [
            "A a packages/lint rule on the runtime authoring gate (live save and publish refuse, a draft keeps _diagnostics; os validate refuses too), small",
            "B a FlowSchema refinement in packages/spec: refuses at every parse, including a Studio draft mid-edit, which the FLOW_NODE_UNREACHABLE docblock argues against"
          ],
          "recommendation": "A, because drafts must stay saveable while edited and the lint gate is where the save door already judges flow structure"
        },
        {
          "question": "Should a semantic upgrade-guide entry (packages/spec migrations, like picklist-binding-unknown-refused) name this narrowing? The changeset now carries adr-0087 not-required (no-migration-prescription).",
          "options": [
            "A spec-lane follow-up registers a semantic entry and the disposition becomes registered",
            "B keep not-required: no mechanical rewrite exists and os migrate meta --stored already lists each row"
          ],
          "recommendation": "B for this PR, A as a cheap follow-up if the release notes compiler needs a ledger row to mention it"
        },
        {
          "question": "The card's second half (unknown positions, queues and notify channels warn at save) needs an advisory channel on the save answer, which does not exist.",
          "options": [
            "A add a warnings slot to the automation write answer (spec api contract, a needs_decision shape change) and judge positions/queues/channels at save",
            "B log-only advisories at registration, which the author through the API never sees"
          ],
          "recommendation": "A, decided by the spec lane; #32142 stays open for it"
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: the lane holding packages/services/service-automation/src/engine.ts · noted, not filed — execute()'s FLOW_NO_START_NODE exit and the dag-traversal retry copy are now defensive only (no door reaches them), and the comment above the execute() exit ('Registration accepts a flow with no start ... is not dead code') is now false",
        "carrier: platform-checklist owner (docs/qa/platform-checklist/areas/automation.json) · noted, not filed — the recipe that authors qa_no_start_node through publish to reach the trigger table's 422 row now meets the registration refusal; its own text predicted this",
        "carrier: #32142 · noted, not filed — the remainder: unknown positions, queues and channels warn at save (see open_questions)"
      ],
      "deviations": "1) Clause-② written 'no (narrowing)' instead of the claim's 'no' (level-gate contradiction, open_questions[0]). 2) A test outside the expected file surface: packages/qa/dogfood/test/flow-node-config-values-at-registration.dogfood.test.ts (the door-level pin; runtime tests use fakes and cannot exercise the real engine); no producer code outside flow-registration-checks.ts. 3) Fetched one pinned commit (621a4876) into the shared object store so check-plugin-teardown-shape --self-test could read its fixture.",
      "files_changed": ".changeset/32142-flow-start-node-required.md (+18); packages/qa/dogfood/test/flow-node-config-values-at-registration.dogfood.test.ts (+35 -1); packages/services/service-automation/src/canonicalize-stored-flow.test.ts (+3); src/engine.test.ts (+31 -23); src/flow-label-on-result.test.ts (+8 -4); src/flow-refused-registration-read.integration.test.ts (+68); src/flow-registration-checks.test.ts (+59); src/flow-registration-checks.ts (+49) — 8 files, 271 insertions, 28 deletions (git diff --stat merge-base..HEAD)"
    }
  7. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-justin · session_01QSeKYm8sWjp2Pk76warN7w

    Claim amendment to 6769084055 · 2026-11-10T16:06Z: the claim's Clause-②: no beside Metadata-protocol: narrowed was the seat's mis-spelling. A refused body the door accepted before is the (narrowing) arm, and check-changeset-no-major.mjs refuses narrowed without it. Corrected reading, as PR #32273 and its changeset carry it:

    Clause-②: no (narrowing)
    Metadata-protocol: narrowed

    The owed CONTRACT_REVIEW_TIER review of the narrowing runs on PR #32273 (claim line there).

  8. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-justin · session_01QSeKYm8sWjp2Pk76warN7w

    ACCEPT → PR #32273 comment 6773013677 · 2026-11-10T16:32Z. Contract review PASS 6772843445 (delta 6772979502). The PR is Part of; this card's remainder is routed when it lands.

  9. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-justin · session_01QSeKYm8sWjp2Pk76warN7w
    Release: session_01QSeKYm8sWjp2Pk76warN7w / the start-node refusal landed in PR #32273; the save-door lint half split to #32289, the docs to sub-issue #32288; the advisory half needs the maintainer's ruling / needs-user-decision

    交付与余项 · 2026-11-10T17:19Z

    决策分析 · 保存时如何对待未知的岗位、队列与通知渠道

    一句话问题: 作者保存一个流程,其中引用了不存在的岗位、队列或通知渠道,保存成功、没有任何提示,直到流程跑到那一步才失败。

    读数(origin/main 1ce6e0f0):

    • 自动化写门的保存应答没有警告通道:POST /automation 回 deps.success(servedFlowDefinition(...)),引擎的建议性检查只写日志(dev 报告 6772313568,契约复审 6772843445 ③ 已核)。
    • 加一个警告字段属于自动化 API 应答形状的改动,声明在 packages/spec(复审 ③ 定性为 spec 车道的应答形状变更)。
    • 岗位与队列是运行期数据(管理员随时增删),通知渠道由插件在代码里注册:两类东西的性质不同。未知渠道在运行期的具体失败形态:未验证。

    Governing text: AGENTS.md Prime Directive 12(错误元数据在编写时响亮拒收);本卡无既有裁决。
    协议声明: A 扩大公开面(Clause-②: yes,spec 车道);B 收窄编写面(Clause-②: no (narrowing));C、D 不改契约。

    选项 做什么 客户可感知后果 工作量
    A 保存应答加警告 spec 给自动化写应答加 warnings 字段;保存时检查岗位、队列、渠道,未知即警告 作者当场看到提示,保存仍成功 spec + server · 2 PR · 无先例(未实测)
    B 渠道拒收、岗位队列不查 未知通知渠道在保存时拒收(渠道由代码注册,未知必是写错);岗位、队列属运行期数据,保存时不判,运行时照旧报错 渠道写错当场 400;引用尚未建立的队列仍可保存 server · 1 PR · 收窄需契约复审档复核
    C 只写日志 保存时检查,未知项只记服务端日志 作者(尤其通过 API 的 AI 作者)看不到 小 · 1 PR
    D 不做 维持运行时报错 不变 无

    业务含义直译: A = 前台收件时贴一张「这个地址查不到」的便签,但照收;B = 寄往不存在的城市的件当场退回,寄给还没入职的人的件先收下;C = 只在后台记一笔;D = 寄出去才发现。

    四轴:

    • 项目长远合理性(主轴): 主流平台(Salesforce 流程激活时校验引用的队列与渠道)在激活/保存时就校验代码可判定的引用;运行期数据允许后建。B 按「可判定性」划线:代码注册的渠道当场判,运行期数据留到运行时;A 引入一个只提示不强制的新应答通道,长期要维护「警告」这一类半强制语义。
    • 实际业务拉动: 本卡来自 QA 实跑(QA run · all (64/355) · ff04ad81 · 2026-11-10 · 13 PASS / 49 PARTIAL / 1 FAIL / 1 BLOCKED / 291 NOT-RUN #32135);未知渠道与队列的真实撞见频率未实测。
    • 防 AI 犯错: B 对能判定的错误响亮拒收,最难被 AI 忽略;A 的警告通过 API 返回,AI 作者常会忽略非错误字段;C 对 API 作者完全不可见。
    • 创业阶段不扩散: B、C、D 不新增契约;A 新增 spec 应答字段,是永久义务。

    推荐:B。
    只看①选 B;②③④ 是否翻转:否。置信缺口:未知渠道在运行期的失败形态、以及「渠道全集在保存时是否可知」(插件晚注册时的时序)未实测,dev 第 0 步须先验;若保存时渠道全集不可知,回箱,⛔ 不退回 A 或 C。A 不取:新增半强制通道与 spec 字段;C 不取:API 作者看不见;D 不取:问题照旧。

    裁后执行: 裁 B ⇒ 席位派一张 Clause-②: no (narrowing) 卡:保存时对未知通知渠道响亮拒收(定位到节点与渠道名,给出已注册渠道清单作修法),第 0 步先验保存时渠道注册表是否完整;欠一次契约复审档复核;岗位与队列维持运行时报错,并在文档中写明。

    os-decision-facets
    ① 项目长远合理性:B 按可判定性划线(代码注册的渠道当场判,运行期数据运行时判),不新增应答通道;A 新增半强制的警告语义。
    ② 实际业务拉动:来自 QA 实跑 #32135;真实撞见频率未实测。
    ③ 防 AI 犯错:B 响亮拒收可判定的错误;A 的警告易被 AI 作者忽略;C 对 API 作者不可见。
    ④ 创业阶段不扩散:B、C、D 零新契约;A 新增永久 spec 字段。
    Prior rulings read: card thread and contract review 6772843445 → no ruling on the advisory half; thread: none
    Analysis-tier: the seat's default judgment tier, effort high; the ceiling tier was not used for this write-up.
    Governing text: AGENTS.md Prime Directive 12

  10. added
    needs-user-decision
    on Nov 10, 2026
  11. 18 remaining items

  12. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-sales · session_01L6bhgVaKJ9TPfXPRhdqx3e

    Duplicate of the claim 6823931802 (same session, same bytes; a retried write posted it twice). The claim of record is 6823931802.

  13. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-sales · session_01L6bhgVaKJ9TPfXPRhdqx3e
    Release: session_01L6bhgVaKJ9TPfXPRhdqx3e / the delta contract review PASSED and only ACCEPT and landing remain / maintainer 「目前你这里的 server 车道也只处理和专题卡相关的任务」 (project "Objectstack security ui", project timeline, 2026-11-12); this card is not part of epic #31527
    Resume-from: claude/issue-32142-notify-channel-refused-at-save@110fb294af2eaaa6ab0322bc140bfa86b2243151

    Hand-over · 2026-11-12T13:23Z

  14. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 12, 2026
  15. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-sales · session_01L6bhgVaKJ9TPfXPRhdqx3e

    Claim: PM loop round 2 · resume of this seat's own release (landing leg)
    Session: session_01L6bhgVaKJ9TPfXPRhdqx3e (seat)
    Account: os-sales
    Branch: claude/issue-32142-notify-channel-refused-at-save
    Worktree: objectstack-issue-32142
    Domain: domain:server
    Seat: domain:server#1
    File surface: packages/services/service-automation/src/flow-registration-checks.ts and/or packages/runtime/src/domains/automation.ts (the save arms), packages/services/service-automation/src/builtin/notify-node.ts read-only unless a channel getter is needed, a read getter in packages/services/service-messaging/src/messaging-service.ts only if none exists, their tests, packages/qa/dogfood/test/**, root .changeset/, and the automation docs page that says positions and queues fail at run time. ⛔ Not packages/spec/**, not service-automation/src/engine.ts beyond the existing registrationChecks wrapper. Stop on breach; explain in the report.
    Container & model: M, mode:subagent (review leg: the owed CONTRACT_REVIEW_TIER delta contract review of 0b2672f0..50716bc7, including the new packages/spec semantic entry, runs in an isolated subagent), model: CONTRACT_REVIEW_TIER (reason: the review face, per contract-review.md: a Clause-②: no (narrowing)declaration plus apackages/spec/src/**file in the diff;dispatch-gates --tier: no path-derived mandate), effort: xhigh
    Clause-②: no (narrowing)
    Metadata-protocol: narrowed
    Responsibility: service-automation's save path (objectstack), which stores a notify node naming a channel no plugin registers | none at save; the notify node's delivery outcome reports "channel not registered" only at run time | every authoring client of POST /automation (Studio, MCP, AI builders), today
    Thread-read: 6823270802
    Premise: holds (read-only premise reading 2026-11-12T06:37Z on origin/main 0f9b5653: no registration check reads a notify node's channel; MessagingService has getRegisteredChannels() and getKnownChannels(); a channel mount can arrive after kernel:ready, so the ruling's step 0 is live)
    Serial constraints cleared: PR #32497 (#32365 / #32352) touches service-automation/src/engine.ts and plugin.ts, not this surface; #32515 landed in flow-registration-checks.ts today (merge-based, re-read). No live claim holds these files.

    Ruling-ref: 6810493176 (letter B, maintainer 「同意」). A contract-review-tier review is owed for the narrowing before the queue.
    Resume-from: claude/issue-32142-notify-channel-refused-at-save@110fb294af

    Resumes this seat's release 6824813844. The maintainer, verbatim: 「已经做完的当然可以落地」「我说的 是后续只做专题卡」 (project "Objectstack security ui", project timeline, 2026-11-12T15:30:13Z): finished non-epic work still lands; only new work is epic-only. No other seat claimed the card since the release. Owed on this claim: PR #32665 (draft, head 110fb294): the full dogfood battery pinned to this head, a record of the merge-only delta 50716bc7..110fb294, ACCEPT, landing.

  16. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 12, 2026
  17. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-sales · session_01L6bhgVaKJ9TPfXPRhdqx3e

    Landed: PR #32665 merged as 88282a788 (ACCEPT 6830061151; contract delta PASS 6829012350 at the landing head; dogfood battery on the landing head 455 files / 3816 tests passed). The card closed with the merge (Fixes #32142). Follow-up #32733 stays open under this card.

    State: pm:dispatched removed; card closed.

  18. removed
    pm:dispatched
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdomain:serverpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions