Repository navigation
FE-2033: feat(cmp): insert_workflow op (agent subgraph TDD V1.5) #17501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
christian-byrne
merged 11 commits into
christian-byrne/define-subgraph-op
from
christian-byrne/cmp-insert-workflow-op
Sep 18, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6c3614d
feat(cmp): add insert_workflow op (V1.5 agent subgraph TDD)
christian-byrne 98636fc
refactor(cmp): insert_workflow reuses define_subgraph definition helpers
christian-byrne a924cb7
test(cmp): type remapped definition fixture
christian-byrne 85d1748
fix(cmp): validate raw insert_workflow ids before remapping
christian-byrne 21c4459
test(comfy-multi-player): type indexed rejection value in ka4 byte-id…
christian-byrne c925c44
fix(cmp): validate raw node/link IDs inside carried definitions befor…
christian-byrne bd69b41
fix(cmp): drop dangling links inside nested insert_workflow definitions
christian-byrne 35af4f7
fix: scope inserted workflow id remapping
christian-byrne ba68902
fix(cmp): scrub dropped dangling links from slot refs at every depth;…
christian-byrne 318fadd
fix(cmp): keep workflow id remapping internal
christian-byrne 8491ba3
fix(cmp): retain nested widget edits across define_subgraph digest re…
christian-byrne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/comfy-multi-player/docs/decisions/ADR-022-insert-workflow-op.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # ADR-022: Atomic workflow-template insertion | ||
|
|
||
| - **Status:** Accepted | ||
| - **Date:** 2026-09-11 | ||
| - **Decider:** Christian | ||
| - **Source:** ADR-T8, in-app-agent program TDD (Notion) | ||
|
|
||
| ## Context | ||
|
|
||
| Agents and users need to insert a complete workflow template, including subgraph definitions, | ||
| without decomposing it into independently observable graph edits. Existing op shapes deliberately | ||
| reject definition-bearing payloads and cannot express that transaction safely. | ||
|
|
||
| ## Decision | ||
|
|
||
| Add the non-batchable `insert_workflow` op. Its frozen envelope carries one authoritative `workflow` | ||
| with required top-level nodes and optional links, groups, and definitions. The applier remaps every | ||
| carried node, link, group, and nested-definition id to a deterministic string derived from the op | ||
| envelope id, graph scope, id kind, and original id. Producers emit the raw workflow unchanged. | ||
|
|
||
| Internal node/link references and definition-instance types are rewritten to those derived ids. | ||
| Distinct insert ops therefore cannot collide, even when they carry the same raw ids; exact replay | ||
| derives the same ids and is a byte-identical no-op through the existing `op_id` gate. The operation | ||
| is one Yjs transaction and is stamped as its own register. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Template insertion is atomic at the semantic-op boundary and deterministic on replay. | ||
| - Producers do not inspect document state or remap ids. | ||
| - Definition interiors retain scoped graph namespaces, all derived from the op id. | ||
| - Existing op schemas remain closed to definitions. | ||
|
|
||
| ## Invariants | ||
|
|
||
| This decision touches KA-1, KA-2, KA-3, KA-4, KA-5, FC-1, FC-3, and FC-4. | ||
|
|
||
| ## Glossary | ||
|
|
||
| - **ADR-T8:** the accepted in-app-agent program technical design for workflow insertion. | ||
| - **Canonical projection:** stable, key-sorted JSON used as the definition-content identity. | ||
| - **Envelope id:** the immutable `op_id` carried by the semantic operation. | ||
| - **Producer:** the cloud or CLI caller that emits the raw workflow payload. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (P3):
FROZEN_OPS, the README, and the package entrypoint count eight implemented kinds. This should say “eighth”;docs/multiplayer-schema.md:48has the same stale “seventh” wording. Tracked with the stale PR-body claims in FE-2282.