Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f88c190
fix(workflow): reject reused op ids with changed payloads
christian-byrne Sep 21, 2026
7682389
style: apply remote ruff formatting
christian-byrne Sep 21, 2026
2d22c0e
fix: preserve replay metadata boundaries
christian-byrne Sep 21, 2026
e056a7a
fix: bind enriched widget ops to final payload
christian-byrne Sep 21, 2026
4c537fd
fix(workflow): carry the op-id/payload binding onto current main
christian-byrne Oct 23, 2026
b313d3d
fix(workflow): canonicalize op payloads the way ECMAScript does
christian-byrne Oct 24, 2026
d551190
fix(workflow): gate op-id reuse on the deferred queue, and validate t…
christian-byrne Oct 24, 2026
bd356f8
fix(workflow): bind the enriched envelope without failing an op that …
christian-byrne Oct 24, 2026
4bdcc29
docs(op-vocabulary): renumber the canonical-identity amendment to v1.…
christian-byrne Oct 24, 2026
2886974
fix(workflow): clear the public-repo hygiene check, and pin the key s…
christian-byrne Oct 24, 2026
5626140
Merge branch 'main' into christian-byrne/op-vocabulary-a8-cli-parity
christian-byrne Oct 30, 2026
e86f750
fix(workflow): mirror comfy-multi-player's op payload bounds instead …
christian-byrne Oct 31, 2026
ab5c33f
fix(workflow): bound a batch at 1,024 ops, the limit the shared appli…
christian-byrne Oct 31, 2026
712cc9c
Merge remote-tracking branch 'origin/main' into lv139/pr1091-reviewfix
christian-byrne Oct 31, 2026
1ff58bc
fix(workflow): count the ops a batch mints, not only its specs
christian-byrne Oct 31, 2026
5329275
fix(workflow): spell an integer past 2^53 the way ECMAScript spells it
christian-byrne Oct 31, 2026
166ff00
fix(workflow): refuse an oversized payload at the charge, not after r…
christian-byrne Oct 31, 2026
268e94a
fix(workflow): refuse object keys that collide after coercion
christian-byrne Oct 31, 2026
9c57953
fix(workflow): tell a missing digest apart from a null one in the ledger
christian-byrne Oct 31, 2026
ad68d44
fix(workflow): digest a queued deferred op defensively, not strictly
christian-byrne Oct 31, 2026
4023991
fix(workflow): validate an op's kind before seeding the applied ledger
christian-byrne Oct 31, 2026
8d3f190
fix(workflow): bound each op replace_ops mints, not only the batch le…
christian-byrne Oct 31, 2026
2b3e756
fix(generate): skip the op batch instead of discarding a good workflow
christian-byrne Oct 31, 2026
3e065b0
docs(changelog): say what the 50-op gallery measurement does not cover
christian-byrne Oct 31, 2026
82f2405
docs(op-vocabulary): count the six corrections §22 carries, not five
christian-byrne Oct 31, 2026
4196a32
docs(op-vocabulary): say which refusal the charge-site check can change
christian-byrne Oct 31, 2026
90f0a27
ci(hygiene): allowlist IEEE-754, the floating-point standard
christian-byrne Oct 31, 2026
ce6ecc8
test(workflow): stop asserting a seeded empty ledger on a rejected op
christian-byrne Oct 31, 2026
cca91ef
docs(op-vocabulary): say generate degrades too, not that it raises
christian-byrne Oct 31, 2026
dcb9bff
test(workflow): drop the stale EmitError claim from a batch-bound doc…
christian-byrne Oct 31, 2026
360f35a
fix(generate): say in pretty mode that --emit-ops minted no batch
christian-byrne Oct 31, 2026
936d949
test(generate): pin the skipped-batch envelope, not only the pretty w…
christian-byrne Oct 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/public-repo-hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,19 @@ jobs:
# set_title prototype that ADR-032 originally recorded, since
# generalized and merged there as PR #235). It fits the ticket-ID shape
# but is a public doc filename, not an internal ticket.
ticket_allowlist: HAILUO-03,HALO-03,ADR-032
# `IEEE-754` is the IEEE floating-point standard, named in
# comfy_cli/workflow_ops.py, docs/op-vocabulary-v1.md and
# tests/comfy_cli/test_op_id_reuse_contract.py while documenting why an
# integer past 2^53 is spelled the way ECMAScript spells it. The checker
# already carries `UTF-8`, `ISO-8601`, `SHA-256` and three `RFC-####`s as
# exact tokens and `CVE`/`CWE`/`PEP`/`RFC`/`ISO`/`UTF` as prefixes, so a
# public standards identifier is a known class of false positive there;
# `IEEE` is simply not on either list yet. Only the exact-token list is
# reachable from a caller, so this is the token, not the namespace — a
# prefix carve-out for `IEEE` belongs upstream in
# TICKET_ALLOWED_PREFIXES, where the same comment already argues the
# namespace is the right granularity for this class.
ticket_allowlist: HAILUO-03,HALO-03,ADR-032,IEEE-754
# One `exclude_paths:` entry, and the bar it had to clear is recorded here
# because the entry is permanent. Every entry this caller used to carry
# was a false positive in the checker itself — Hugging Face model URLs and
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,32 @@ history.

### Changed

- A structured-edit batch is bounded at 1,024 ops, the limit the shared
`comfy-multi-player` applier already enforces, and each op in it is bounded by
the per-op payload limits that applier applies. `comfy workflow apply` refuses
a longer batch and writes nothing — counting the ops the specs actually mint,
since one `set_dynamic_group_rows` spec expands into a write per row field.
`templates fetch --emit-ops` and `generate --emit-workflow --emit-ops` report
`ops_skipped` beside the workflow file they still write, rather than emitting
a batch that would be rejected whole on arrival.

Where the bound can be reached: the measurement behind it covered the
workflows being written — over the whole template gallery the longest batch
that path produces is 50 ops — and a replacement also emits a `delete_node`
per node already in the file being replaced, which is not bounded by anything
this measurement saw. So a fetch or an emit into a path that already holds a
workflow of about a thousand nodes can exceed the bound while the incoming
template is small. That case now skips the batch and keeps the file, where an
emit previously failed and wrote nothing.

- An integer past 2^53 in an op payload is digested as the double it becomes,
the way ECMAScript spells it, rather than as its exact Python digits. JSON
carries no integer type, so a relay through the shared applier rounds such a
value — a seed at `0xffffffffffffffff` comes back as `18446744073709552000` —
and digesting the exact digits made an identical op echoed back look like a
changed payload reusing its `op_id`. Integers inside that range, which is
every id, stamp and ordinary widget value, are unaffected.

- Once every model byte is in, the progress line of `comfy deploy up`,
`comfy deploy status` (with or without `--watch`) and a watching
`comfy deploy promote` or `rollback` adds "finishing: putting the models in
Expand Down
20 changes: 19 additions & 1 deletion comfy_cli/command/generate/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ def _track_error(error_kind: str, exc: BaseException) -> None:
prefix = meta.get("output-prefix") if isinstance(meta.get("output-prefix"), str) else "generate"
renderer = get_renderer()
ops: list | None = None
ops_skipped: str | None = None
from comfy_cli import workflow_ops

try:
Expand Down Expand Up @@ -625,7 +626,7 @@ def _track_error(error_kind: str, exc: BaseException) -> None:
# is left without its terminal event.
_track_error("emit", e)
raise
workflow, ops = emit.write_frontend_workflow(
workflow, ops, ops_skipped = emit.write_frontend_workflow(
name,
values,
Path(emit_path).expanduser(),
Expand Down Expand Up @@ -683,6 +684,17 @@ def _track_error(error_kind: str, exc: BaseException) -> None:
if renderer.is_pretty():
rprint(f"[bold green]Wrote workflow:[/bold green] {emit_path}")
rprint(f" run it: comfy run --workflow {emit_path}")
if ops_skipped:
# `--emit-ops` is a request, and this is the one path where
# it silently went unanswered: the batch is reported as
# `ops_skipped` in the envelope below, which `emit()` does
# not print in pretty mode. Without this the user asked for
# ops, saw only "Wrote workflow", and had no way to tell the
# batch apart from one that was minted.
renderer.warn(
f"--emit-ops: no batch was minted — {ops_skipped}",
hint="the workflow file above is complete; apply it as a whole document",
)
payload = {
"out": str(Path(emit_path).expanduser()),
"model": name,
Expand All @@ -691,6 +703,12 @@ def _track_error(error_kind: str, exc: BaseException) -> None:
}
if ops is not None:
payload["ops"] = ops
elif ops_skipped:
# Same envelope key `templates fetch --emit-ops` uses: the file
# was written, the batch was not minted, and this says why so a
# consumer can fall back to the whole-document path instead of
# guessing from a missing key.
payload["ops_skipped"] = ops_skipped
Comment thread
christian-byrne marked this conversation as resolved.
Resolved
renderer.emit(payload, command="generate emit-workflow")
return

Expand Down
36 changes: 28 additions & 8 deletions comfy_cli/command/generate/emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,22 @@ def write_frontend_workflow(
actor: str = "cli",
base_version: int = 0,
output_prefix: str = "generate",
) -> tuple[dict[str, Any], list[dict[str, Any]]]:
) -> tuple[dict[str, Any], list[dict[str, Any]] | None, str | None]:
"""Build the workflow for ``model`` as a FRONTEND-format graph and write it
to ``path``; return ``(workflow, ops)`` where ``ops`` is the stamped
``replace_ops`` batch that turns whatever ``path`` previously held into the
new graph (empty previous ⇒ no delete half), ready for the envelope exactly
like ``templates fetch --emit-ops``.
to ``path``; return ``(workflow, ops, ops_skipped)`` where ``ops`` is the
stamped ``replace_ops`` batch that turns whatever ``path`` previously held
into the new graph (empty previous ⇒ no delete half), ready for the envelope
exactly like ``templates fetch --emit-ops``.

``ops`` is ``None`` with ``ops_skipped`` set when the batch cannot be minted.
That is NOT a failure of the request — the file is written either way, and a
consumer falls back to the whole-document path it had before ops existed,
exactly as ``templates fetch --emit-ops`` does. The reason it can happen at
all is the PREVIOUS document: ``replace_ops`` emits a ``delete_node`` per
node already at ``path``, so a target that holds a large workflow can push
the batch past the 1,024-op bound even though the graph being written is
tiny. That is ordinary user data, not a bug in the built graph, so failing
the whole command over it would discard a workflow that is perfectly good.

Raises ``EmitError``/``UnsupportedModelError`` like :func:`write_workflow`;
an applier failure surfaces as ``EmitError`` (the request itself was
Expand Down Expand Up @@ -665,10 +675,20 @@ def write_frontend_workflow(
# `replace_ops` so the returned workflow, the file and the batch describe
# one document.
workflow_ops.strip_internal(workflow)
ops: list[dict[str, Any]] | None = None
ops_skipped: str | None = None
try:
ops = workflow_ops.replace_ops(previous, workflow, actor=actor, base_version=base_version)
except workflow_ops.NotExpressibleError as e: # can't-happen for our own built graph; fail loudly if it does
raise EmitError(f"the {model!r} workflow cannot be expressed as ops: {e}") from e
except workflow_ops.NotExpressibleError as e:
# Non-fatal, like `templates fetch --emit-ops`: the workflow itself is
# fine and still gets written. This used to be commented as can't-happen
# for our own built graph, and for the STRUCTURAL reason it is — but the
# batch also counts a `delete_node` per node already at `path`, which is
# user data, so a large existing file could fail the whole command and
# write nothing. The umbrella `emit_workflow_failed` hint then told the
# caller to check the model name and its required inputs, for a failure
# neither of them caused.
ops_skipped = str(e)
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(workflow, indent=2) + "\n", encoding="utf-8")
return workflow, ops
return workflow, ops, ops_skipped
Loading
Loading