Skip to content

runtime: POST /api/v1/automation/:name/clone is not mounted on the HTTP server — every flow clone, from the API and from the Setup packaged-automation page, answers 404 ENDPOINT_NOT_FOUND #20676

Description

@objectstack-fleet

QA-source: #20674 · automation.packaged-flow-clone-contract · c1, c4
QA-source: #20674 · automation.setup-packaged-automation-board · c7

What happens

The ADR-0126 §7.1 flow clone cannot be performed on a running server. POST /api/v1/automation/:name/clone answers 404 {"success":false,"error":{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}} for every body (legal, empty, missing name, missing label, same name, illegal name), for every source (existing or not) and for every caller (admin and anonymous alike). The Setup → Packaged Automation page's Clone dialog therefore shows "Not found" for every submission and never shows the post-clone notice.

Measured on main at 6bff748b (showcase, objectstack dev, stock composition), twice on two separate cold boots; objectui console built at the pinned dd3f7e1b.

Reproduction

  1. Boot the showcase (OS_PORT=PORT objectstack dev --ui --seed-admin -p PORT -d file:…) and sign in as the seeded admin.
  2. POST /api/v1/automation/showcase_urgent_task_alert/clone with body {"name":"qa_urgent_alert_clone","label":"QA urgent alert clone"}.
  3. Expected: a 2xx carrying the cloned flow and FLOW_CLONE_NOTICE. Actual: 404 ENDPOINT_NOT_FOUND; GET /api/v1/automation/qa_urgent_alert_clone → 404 RESOURCE_NOT_FOUND.
  4. Positive control on the same prefix, same session: POST /api/v1/automation/showcase_notify_owner/toggle {"enabled":true} → 200.
  5. UI: Setup → Packaged Automation → Clone on any flow row → legal name + label → Create clone → the dialog's alert reads "Not found"; the network trace shows POST /api/v1/automation/(flow)/clone → 404.

Mechanism (read from source at 6bff748b)

  • The domain arm exists: packages/runtime/src/domains/automation.ts, POST /:name/clone (body validation, 404 / 409 probes, cloneFlowDefinition, registerFlow).
  • The HTTP bridge never routes to it: registerAutomationRoutes in packages/runtime/src/dispatcher-plugin.ts mounts each /automation route explicitly (/:name, /:name/trigger, /:name/toggle, /:name/runs…), and has no /:name/clone mount — git log -S "/clone" -- packages/runtime/src/dispatcher-plugin.ts finds none ever. Hono's not-found answers before the dispatcher runs.
  • packages/runtime/src/domains/automation-flow-clone.test.ts stays green because it calls the domain handler directly; no dogfood test drives the clone over HTTP (the checklist's dispatcher-vs-hono-route trap).
  • The route is also absent from packages/runtime/src/route-ledger.ts (docs/qa/platform-checklist/FOLLOW-UPS.md §8a D22), so no ledger-vs-live parity check could flag the missing mount.

Consequences

  • Acceptance card 验收测试:包内元数据定制(ADR-0126)——流程/动作的停用+克隆 全链路人工确认 #12438 rows B1 and B2 cannot pass on any build that ships this bridge; the clone half of the §7.1 promise is unreachable.
  • Every refusal that prescribes the clone points at the dead door: the ledger FLOW_DISABLED message ("…or run a clone of it under a new name.") and the Setup page copy ("clone a flow under a new name to customize it").
  • content/docs/build-without-code.mdx and content/docs/capabilities/integrations.mdx promise "clone your own".
  • The clone's own persistence question (FOLLOW-UPS §8a D18 — engine-only registration, restart survival, Studio reachability) could not be measured at all; it stays open behind this card.

Expected

The live server serves POST /api/v1/automation/:name/clone (and its environment-scoped twin) through the dispatcher, with the arms the domain handler already implements, and a live HTTP pin covers it.

Full evidence chain: #20674 (F-1).


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

Labels

area:workflowApprovals and automation — the work that runs without a person driving itbugSomething isn't workingdomain:clipriority:p1High: required for production / M2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions