Commit c68c670
feat(runtime): flow clone action — whole-definition copy under a new name (#12190)
`POST /api/v1/automation/:name/clone` (ADR-0126 §7.1): copy a flow's parsed
definition to an ordinary org-authored sibling an admin can edit, for the case
where the packaged original cannot be edited in place.
The copy is whole-definition and never an enumerated facet list — #11703
measured an enumerated clone dropping three of six facets in silence, and a
flow has far more facets than a permission set. Exactly `name`, `label` and
`status` are mutated; the acceptance test asserts deep equality of the clone
against its source minus those three fields, so a dropped facet fails a test
rather than shipping.
The new machine name is mandatory and a same-name clone is refused 409
`RESOURCE_CONFLICT`, naming the reason and the remedy: the engine keys flows by
bare name, so a second definition under one name silently shadows the other and
the survivor depends on registration order.
No ancestry is recorded (amendment ruling 2, §9) — no provenance field on the
definition, none on the response — and the source's ADR-0010 protection
envelope is dropped rather than carried across, so the clone is org-owned and
editable instead of a second copy of the package's locked artifact.
References are not re-pointed; the response says so, along with the fact that
`status: 'draft'` is a lifecycle label and not an off-switch.
The route joins the `manage_metadata` authoring-write set — it registers flow
metadata at environment scope, exactly as `POST /automation` does.
Co-authored-by: Claude Code <support@objectstack.ai>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 428f9b2 commit c68c670
4 files changed
Lines changed: 924 additions & 0 deletions
File tree
- .changeset
- packages/runtime/src
- domains
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments