Skip to content

feat: import comfy-multi-player into the monorepo - #20510

Open
DrJKL wants to merge 238 commits into
mainfrom
jkl/cmp-workspace-import
Open

DrJKL wants to merge 238 commits into
mainfrom
jkl/cmp-workspace-import

Conversation

@DrJKL

@DrJKL DrJKL commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

comfy-multi-player → packages/comfy-multi-player
frontend          → npm, unchanged
Cloud doc host    → npm, unchanged

First PR in the migration stack. Imports upstream 0.3.12 with its Git ancestry, MIT license, fixtures, tests, and release recovery checks. Adapts CI and packaging to pnpm. Preserves the local clock fixes. Stacked draft #20513 switches frontend consumption after Cloud rollout alignment.

KA-1, KA-3, and FC-3 retain one portable op implementation with yjs-only runtime dependencies. Package ADR-006 requires coordinated browser/host versions. npm trusted-publisher configuration and tag protection need maintainer setup before the first monorepo release. This import does not publish.

Evidence

  • Before pnpm adaptation: nine package tests failed. After: 1,780 package tests, 18 statelessness checks, two exhaustive-tier tests, and 43 root-tooling tests pass. Existing tier-selection skips remain unchanged.
  • verify:package: a clean npm consumer imports all 57 exports and type-checks the packed declarations. Normal commit/push hooks pass. Fallow inherits only findings measured from the untouched upstream tree.
  • CI follow-through: the ADR-link regression reproduces before the checker fix, then all seven tests pass. A clean checkout reproduces five unresolved generated imports; building the package before Fallow reduces that count to zero.
  • A dependency-resolution regression test catches separate Vitest instances for website assertions and jest-dom. Sharing the Node-types catalog and regenerating the lockfile makes that check pass. The website typecheck goes from 474 errors to zero.

Merge Danger

Door: two-way. Blast Radius: tooling. Frontend still resolves npm. No publication, deployment, repository retirement, or shared settings change is included. Preserve the merge commits if upstream ancestry must remain in main.

skishore23 and others added 30 commits August 12, 2026 01:45
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ted connect (V1-029/030/031/032)

Initial release of the pure, portable op applier shared by the agent and the frontend.

Squashed: new repo, first landing, so the V1-030 -> V1-029 -> V1-031 -> V1-032 stack carries no standalone review value.

- V1-030 package skeleton, purity gate in CI, fixtures plumbing
- V1-029 multiplayer-schema.md (Y.Doc layout + op-semantics table) + graduated fixture corpus
- V1-031 real applyOps/project/mint/migrate, replay corpus green
- V1-032 concrete inputs are stamp-gated LWW registers (closes the connect convergence gap)

Widgets are name-keyed with catalog_version pinned in meta; node identity compares as a string; concurrent connect converges. Carve-outs (out-link ordering, autogrow racing a delete, add_node id collision for non-minted streams, same-batch same-target ordering) are pinned by tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…o docs/ (#6)

`reference/spike/` held a second, superseded applier. Nothing imported,
built, tested or published it (tsconfig compiles `src` only; package.json
ships `dist` only), so it was inert — but inert is not harmless in a
production repo:

- `applier.mjs` stores widgets POSITIONALLY, which is the exact layout
  schema §1.2 rejects after the spike measured same-index concurrent writes
  merging to a length-8 array and silently shifting every widget.
- It predates every fix the real applier carries: stamp-gated connects,
  string-normalized node identity, the catalog pin.

Its own README said "keep this copy frozen" until the real applier landed.
It landed (V1-031, `src/applier.ts`), so that premise expired and a second
divergent applier is now a hazard to read or copy from.

SPIKE-REPORT.md is kept — `multiplayer-schema.md` cites it as a normative
input and every schema DECISION names the finding that forced it — but moves
to `docs/spike-report-v1-007.md` where documentation lives, with an archival
note. Its body is deliberately unedited: it records what was measured.

Citations in README.md and docs/multiplayer-schema.md updated; no dangling
references remain.

Co-authored-by: kishore <kishore@comfy.org>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ote/MarkdownNote)

Frontend-only nodes (Note, MarkdownNote) never appear in ComfyUI's object_info, so they can never appear in a catalog derived from it. The applier threw on their positional widgets_values, so any workflow containing a sticky note failed to mint — the canvas stayed empty while the agent reported success.

When widget_order is entirely absent, widgets_values is now stored whole under a reserved __widgets_opaque key and re-emitted verbatim by project(). Narrow by construction: a present-but-shorter widget_order still throws, and a catalog-less host still rejects add_node.

set_widget against an opaque node is REJECTED (opaque_widgets), not a silent no-op: writing anyway creates a name-keyed map beside the opaque key, returns failed:null, and makes every subsequent project() throw.

Compatible with schema 1.2: that rule exists because element-wise merging of a positional array corrupts (same-index writes -> length-8 array). Opaque storage never merges element-wise; concurrent writes resolve whole-value LWW.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…osal (#8)

The README described the package to people who already knew it: ticket ids for
status, section numbers from the schema doc as the primary index, and no
worked example. Someone integrating multiplayer editing could not tell what to
call, in what order, or what the return value means.

Rewritten for that reader: the three-object model, a mint/applyOps/project
example, the catalog and why every call takes one, the op envelope and the six
kinds, and the five outcomes of applyOps — including the three that report as
`applied` without changing the document. The schema document stays the
normative reference; the README points at it instead of restating it.

docs/api-contract-proposal.md is the pre-meeting review artifact: seven
decisions to ratify with the measurement that forced each, and six open
questions with a recommendation and its trade-off. Notable open questions: the
writer topology (client-sole-writer vs a headless agent peer), id allocation
across peers, whether the opaque-widgets change needed a SCHEMA_VERSION bump,
and the catalog pin — which is recorded at mint and never enforced.

Findings while grounding it, all verified against the source:

- A `set_widget` against a live node whose class is absent from the pinned
  catalog is ACCEPTED and makes every later `project()` of the whole document
  throw. The opaque-widgets refusal keys on the opaque value being present, so
  a node minted without widget values slips past it. Repro in the proposal.
- The vocabulary un-deferred `reset_doc`; this package still rejects it as
  deferred and declares the wrong payload shape for it.
- `mint()`'s third parameter was undocumented.
- The purity gate is a denylist; nothing asserts yjs is the only runtime dep.

No source changes — the fixes are proposed, not applied.

Co-authored-by: kishore <kishore@comfy.org>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Revised meeting agenda and clarified decisions needed.
…#35)

* test: property-based convergence/idempotency + schema-version-on-read (#24)

* test: address CodeRabbit — real newer-schema fail-closed branch, delayed/cross-batch retries, deferred reset_doc rejection (#24)
…36)

* test: positive yjs-only purity gate + golden-vector parity contract (#22)

* test: address CodeRabbit — reject missing/invalid prod roots; honor manifest catalog+session paths (#22)
* test: SHA-pin conformance corpus + CI drift gate (#23)

* test: verify-corpus skips fixture subdirectories (golden-vectors is owned by the parity suite)
Adds targeted edge-case tests for public-surface branches the existing
suite left uncovered (measured via v8 coverage):

- writeTarget default arm returns [op.op] for clear/reset_doc
- mint throws on reserved/dunder meta-key collisions
- mint throws on non-object definitions; ignores null definitions
- mint + project subgraph definition round-trip (interior order preserved)
- project throws when a named-widget node's type is absent from the
  catalog, and when a stored widget name is not in widget_order (schema
  1.2 catalog-dependent projection)
- project sorts string node ids lexicographically (idCompare non-numeric)

Protects KA-2 (stamp targets), KA-4 (deterministic projection), and the
fail-closed catalog invariant. Test-only: no op semantics, exports,
dependencies, or catalog changed. Branch coverage 77.5% to 80.9%;
mint/project/stamps now 100% statements.
#42)

* test: cover applier rejection branches (add_node, set_widget, connect)

Adds test/applier-rejections.test.ts (10 tests) asserting applyOps
failed.code for the OpRejectedError arms v8 showed uncovered:

- add_node: malformed_op (missing payload), invalid_node_payload
  (reserved opaque-widgets key), plus the id-exists structural no-op
- set_widget: malformed_op (interior without inner_widget; top-level
  without widget name), not_a_subgraph (interior path through a plain node)
- connect: output_slot_missing, input_slot_missing, malformed_op
  (to_slot null without grow), plus the delete-wins no-op

Test-only; no src/ changes. applier.ts branch coverage 70.3% to 77.9%
(stmts to 91.7%); overall branch to 84.1%. Protects KA-4 (a rejected op
leaves the doc untouched / abort-remainder).

* test: assert doc-state invariants in applier rejection tests

Address CodeRabbit: rejection tests only checked failed.code, so a
regression that mutated the doc before rejecting, or applied a trailing
op after a rejected one, would still pass. Capture a project() snapshot
before/after applyOps and assert it is unchanged for every rejection,
add an abort-remainder case (rejected op + trailing valid op), and
assert nodes/links unchanged for connect (excluding op_id via project).

Cites KA-4 (rejected op leaves doc untouched).
…th instructions (OL-6) (#43)

* chore(harness): port FE review-check profiles + broaden CodeRabbit path instructions

OL-6 harness beef-up. Adds nine general engineering review profiles
adapted from ComfyUI_frontend/.agents/checks to this pure yjs-only
op-layer (architecture-reviewer, complexity, error-handling,
regression-risk, test-quality, import-graph, api-contract,
dep-secrets-scan, semgrep-sast, sonarjs-lint + eslint.strict.config.js),
plus a README cataloging every profile and its KA-*/FC-* mapping.

FE-only context (Vue/Pinia, window globals, LiteGraph, pnpm, colocated
tests, useErrorHandling) was replaced with this repo's reality: npm,
Vitest under test/, OpRejectedError/fail-closed semantics, and the
src/index.ts + wire-envelope contract. error-handling and test-quality
call out the issue #10 mutate-before-throw / weak-rejection-assert
class directly.

Broadens .coderabbit.yaml path_instructions beyond src/** to test/**,
scripts/**, and package/build/CI metadata (CodeRabbit's own #28
suggestion). Docs/config only; build+purity+corpus+test all green (159
tests). No src changes.

* chore(harness): address CodeRabbit on ported review profiles

All four were valid quick-wins on the new profile snippets:
- dep-secrets-scan/sonarjs-lint: stop suppressing stderr and discarding
  exit status; a failed scan must not be misreported as clean, and empty
  output is indeterminate, not a pass.
- import-graph: --no-config disables config loading, so it cannot be
  combined with 'prefer the repo config'; only pass --no-config when no
  .dependency-cruiser.{js,cjs} exists.
- sonarjs-lint/eslint.strict.config.js: src/** is TypeScript, so the
  config needs @typescript-eslint/parser; also switch to a --no-save
  transient install (npx --package can't resolve a config's bare imports)
  and base rules on sonarjs recommended (v4) instead of a hand-listed set
  that drifts across plugin majors. Verified it runs: 7 real findings on
  src/*.ts, exit 1, valid JSON.
- .coderabbit.yaml: add a path rule covering fixtures/** and
  catalog-pinning.md so pinned-catalog/corpus changes get the KA-12/FC-10
  instruction.

Docs/config only; build+purity+corpus+test green (159).
…44)

Records the FE package-consumption decision verified on frontend PR #15457: the
browser consumes @comfyorg/comfy-multi-player as a same-SHA git dep exactly like
the cloud doc-host (KA-1/FC-3: one applier, both hosts), no registry publish
needed for now. Documents the consumer-side gotchas (git-dep prepare build +
pnpm allowBuilds; a follower consumes layout helpers/types, never applyOps per
KA-6) and GitHub Packages as a future prebuilt option. Adds a README Install
note. Docs-only; no op semantics/exports/deps/catalog change.
* test: protect KA-2 KA-3 KA-4 KA-12 and FC-7 edge projections

* test: make mixed-id golden portable across Node sort implementations

* test: add W8 rejection convergence and retry assertions
…57)

The doc-host build (Comfy-Org/cloud) and the frontend both consume this
package; today that requires a build-time GitHub token whose expiry just
broke the cloud release build. Publishing the dist tarball to npm under the
existing @comfyorg scope removes the credential entirely. Only dist/ ships
(files allowlist); the repo stays private.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix(corpus): fail closed on an empty manifest; add verify-corpus guard tests

* test(corpus): add malformed-JSON and non-object files rejection cases

Addresses CodeRabbit path-rule nitpick: test/** must cover malformed and
boundary cases. Both diagnostics are asserted against the exact stderr from
scripts/verify-corpus.mjs.
* chore(checks): add staleness gate for prose review-profile claims

The .agents/checks/ profiles are prose that restates code facts (exported symbol
names, wire shape, invariant IDs). Those facts drift silently: api-contract.md
once asserted src/index.ts re-exported a symbol that had been removed, so a
reviewer agent citing the profile 'verified' a contract that no longer existed.

Add scripts/check-profile-claims.mjs: profiles annotate each checkable fact with
an inline marker <!-- claim: <exact substring> :: <path> --> and the gate asserts
each substring is still present verbatim in its target. Exit 1 on a stale/missing
claim, exit 2 (INCONCLUSIVE) when no markers exist so an unanchored profile is not
a clean pass. Seed api-contract.md's public export surface (7 claims), wire
npm run check:profile-claims into CI, document the convention in the README, and
add 5 process-level tests (pass / renamed / missing target / malformed / no-markers).

Addresses the api-contract instance of the vacuous-verification class.

* harden: reject traversal and directory claim targets before reading

Per CodeRabbit: a claim marker target is a repo-relative source path, so resolve
it and reject anything that escapes the repo root or is not a regular file before
readFileSync (prevents a marker pointing the gate at an out-of-root path or a
directory). Add tests for the out-of-root and directory cases. Fixes a variable
shadow where the local separator index masked path.sep.
#54)

test: kill mutation survivors on interior writes, autogrow, and stamps

Stryker survivors on origin/main, each hand-verified by applying the mutation
and re-running the full suite. Tests only; no src/ change.

Invariant paths that had no test holding them in place:

- KA-2 / FC-2: no test anywhere gives `op.stamp` a value that differs from
  `[base_version, actor]`, so the suite passes identically whether the applier
  honours the in-op ordering key or silently falls back to the envelope.
- KA-1 / schema 5.3: the shared-definition guard in `resolveInteriorNode` had
  zero coverage. Removing it lets one interior `set_widget` mutate every
  instance of the definition.
- KA-4: the applier's "a rejected op leaves the doc untouched" guarantee was
  pinned only for `set_widget` and non-grow `connect`. Dropping
  `requireOutputSlot` before `growInputSlot` leaves a phantom input slot,
  because Y transactions do not roll back on throw.
- KA-3: `nextAutogrowName`'s singularized stem was unpinned because the only
  fixture template (`prefix: "image"`) coincides with the stem of `"images"`.
  The new `SinkTpl` fixture uses `prefix: "pic"` so the two arms differ. The
  `grow.widget` shape, which forces `template = null`, had no test at all.
- Interior writes never pad (comfy-cli `_write_widget` extend=False): the
  `widget_out_of_range` and interior `unknown_widget` arms had no coverage,
  including the `idx === len` boundary. That rule is not in the schema doc -
  src/applier.ts is the only place it is written down.
- `outputs[].links: null` first-wire guard had no coverage, though schema 7
  rule 4 pins the shape and it is the common one in saved workflows.
- `codePointCompare` claims code-point exactness for arbitrary strings but was
  only exercised above the BMP, never at U+FFFF.

Seventeen mutants were applied by hand to the rebased tree; each survives the
suite with this file excluded and reddens a specific named `it` in it. The
table is in the PR description.

Measured with the configured stryker.config.mjs, base and head back-to-back on
one idle host: 74.59% -> 80.42% overall, applier.ts 70.32% -> 77.74%, stamps.ts
87.37% -> 92.63%, no-coverage mutants 52 -> 25. CI's nightly mutation.yml run
on 5129209 independently reports the same base row.

Refs AUD-MUT-1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UwKCRA5Sa7MDB7upecwq4p
…consumer (#19) (#63)

Issue #19 reads `docs/multiplayer-schema.md:574` ("clear ... standalone-only
(not batchable)") against `applyOps` dispatching every op, and concludes the
policy is unenforced. Re-derived against the normative source, the premise is
half wrong: the vocabulary defines batchable by naming its own enforcement
point, and that point is not this package's applier.

comfy-cli `docs/op-vocabulary-v1.md` §1: "Batchable = the kind is accepted by
`apply_specs` (the `workflow apply` / `workflow foreach` batch surface)".
`apply_specs` takes edit SPECS and mints ops; a spec batch carrying `clear` or
`reset_doc` is discarded whole before anything is minted
(`workflow_clear_not_batchable` / `workflow_reset_doc_not_batchable`, §1.5/§1.6).
The replay surface is `apply_op`, which accepts `clear` in any position, under
§4 abort-remainder with no kind restriction. `applyOps` ports `apply_op`
(src/applier.ts:2), so accepting a `clear` inside an op array is conformant,
not a defect.

Gating dispatch on `BATCHABLE_OPS` would therefore diverge from `apply_op`
(KA-3: one implementation, golden-vector parity) and reject
`fixtures/golden-vectors/conformance.json`'s `edit-heavy` case, whose 61-op
stream carries a `clear` at index 36 and which `docs/portability.md` requires
every language runner to replay "in file order with no failures or skips".
Verified: adding that gate turns 10 tests across 6 files red, including
`test/parity.test.ts > edit-heavy` and `test/replay.test.ts`. That makes it a
vocabulary change needing a comfy-cli counterpart, not a bug fix, so it is
written up as a proposal instead of shipped.

What this change does:

- `BATCHABLE_OPS` keeps its value and its export (a host's own submission
  surface is the `apply_specs` analogue and does need the list) but its doc
  comment now states the surface it governs and that `applyOps` deliberately
  does not gate on it, with the reason.
- README: the op table column is "Batchable (authoring)" and a paragraph under
  it separates the authoring rule from the replay behaviour.
- `docs/multiplayer-schema.md` §11: the `clear` cell now attributes the rule to
  vocabulary §1.5 and names the surface it binds, instead of asserting a
  package-level property.
- `fixtures/README.md`: the sessions table credited `session-large-build` with a
  `clear` it does not contain; the corpus's only `clear` is in
  `session-edit-heavy`.
- `test/batch-policy.test.ts` is the constant's consumer, mirroring comfy-cli's
  own `test_batchability_matches_apply_specs`: it pins the set against the
  frozen vocabulary, pins the README column against the constant, pins the
  deliberate non-enforcement with a message explaining why a red here is not a
  fix, and pins the corpus fact that makes the non-enforcement load-bearing.

No op semantics, exports, dependencies, or catalog behaviour change. Invariants
cited: KA-3 (one implementation; cross-language golden vectors), KA-4
(determinism/idempotency of replay), FC-10 (the branch-pinned vocabulary
citation is the root cause of this drift; unchanged here, tracked separately).


Claude-Session: https://claude.ai/code/session_01UwKCRA5Sa7MDB7upecwq4p

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
#21) (#64)

Closes #21.

Makes both closed vocabularies compiler-enforced: every site that switches on an op kind or a
widget-storage strategy ends in an exhaustiveness guard, and compile-time assertions pin
FROZEN_OPS/DEFERRED_OPS/BATCHABLE_OPS to the Op union.

Type-level only. No op semantics change and no currently-accepted payload becomes rejected:
writeTarget output and project() output are byte-identical to main across the whole conformance
corpus, and current main's 221 tests pass unmodified against this src/.

Reviewed under the full merge gauntlet G1-G8; evidence in
reports/pr-review/gauntlet-64.md (probe-plus-control for both enum families, 11 guard mutants,
runtime unknown-kind re-verification).
…ean graph (#52)

`.agents/checks/import-graph.md` documented an `npx --yes dependency-cruiser`
invocation that, on a pristine checkout, printed "no dependency violations
found (0 modules, 0 dependencies cruised)" and exited 0. A reviewer agent
following the profile reported a clean import graph having analyzed nothing.

Two independent causes, either sufficient alone: `npx --yes` installs the tool
outside the project, where `typescript` is not resolvable, so `.ts` is a
DISABLED extension and a directory scan of a 100%-TypeScript `src/` matches
zero files; and `--include-only "^src"` deletes every external module from the
graph, so a rule of the form "from src to a non-yjs package" can never fire.
`doNotFollow` is the correct tool.

Fix: `dependency-cruiser` becomes a devDependency (so it resolves this
project's typescript), rules move into `.dependency-cruiser.cjs`, and
`scripts/check-import-graph.mjs` backs `npm run check:imports` with a work-unit
floor — PASS 0 / FAIL 1 / INCONCLUSIVE 2. Wired into CI. Each of the four rules
was proved to fail on its own planted violation, and both exit-2 paths were
reproduced; `test/check-import-graph.test.ts` locks all of it down, one case
per rule, and goes red when the floor is neutered.

The other command-running profiles were audited against a new non-vacuousness
rule in `.agents/checks/README.md` and given explicit "analyzed nothing is
INCONCLUSIVE, not green" handling: dep-secrets-scan, semgrep-sast,
sonarjs-lint, regression-risk, purity. Two of those corrections were themselves
wrong when re-run against the real tools and are fixed here: sonarjs-lint's
file-count test does not work without `--no-warn-ignored` (ESLint emits an
entry for a file it did not lint), and dep-secrets-scan misdescribed npm audit's
vacuous case.

Also corrected: the claim that the purity gate lacks a positive yjs-only
assertion (`scripts/check-purity.mjs` has asserted it since issue #22 closed);
`docs/ROADMAP.md`'s frozen-CI-baseline line; KA-3/FC-3 "Enforced by" rosters;
and a cwd-relative `pathNot` anchor that broke yjs resolution under pnpm,
workspaces or any symlinked tree.

Known limit, documented rather than papered over: the module floor bounds
vacuity, not rule adequacy. A filtered graph can clear it and still be blind,
because it loses external modules rather than source modules. Only one mutant
per rule settles that.

Invariants: KA-3, FC-3. Docs, config, CI and one new test; no `src/` change.
…0, KA-12) (#66)

KA-12 requires the catalog to be pinned at mint and cited by SHA, not by branch.
This package enforced that for the widget catalog and violated it in its own
cross-implementation references: three citations of comfy-cli's
`docs/op-vocabulary-v1.md` named the branch `fix/validate-lowers-ui-to-api`
instead of a commit. That branch was deleted upstream on 2026-08-21 when
comfy-cli PR #511 merged, so the citations had already stopped resolving.

Pinned at comfy-cli `7e732242d971daf0d2d30f22f997abfacd78986e` — the revision
the citations were written against, established by blame rather than by taking
today's head, which would assert an accuracy nobody had checked. The derivation
is reproducible from PR #511's commit list, the authority that survives the
branch deletion: on that branch the vocabulary was touched at 08-12T09:01Z and
then not again until 08-13T21:15Z, after the citing commit. The pin sits ~40
commits behind the branch tip. `fixtures/MANIFEST.json` had independently pinned
the same commit, so the op corpus and the op vocabulary now resolve to one
upstream revision.

The drift this made visible is the most useful thing here. `reset_doc` was
un-deferred by vocabulary amendment v1.1 (§10), and §10 is already present at
`1201b676…` — the commit this package already cited by SHA for amendment v1.2 in
schema Amendment A1. So the package adopted v1.2 and skipped the older v1.1 out
of the same blob, and the two citations pointed at different revisions of one
file from the day they were written. Nobody could see it because one was a
branch and one was a SHA. That is the concrete answer to the Q5 open question:
deciding it means deciding which revision this package tracks, not just what
`DEFERRED_OPS` contains. The batch-policy error codes (#19) drifted the same way
— one code at the pin, two at the amendment.

Guarded by `scripts/check-pins.mjs` + `docs/upstream-pins.json` +
`test/upstream-pins.test.ts`, the FC-10 lint the roadmap tracked as unguarded.
PASS 0 / FAIL 1 / INCONCLUSIVE 2 with work-unit floors.

Review found the gate reproducing the same defect it guards against, one level
up — a claim asserted without the check that would establish it — and both are
fixed here rather than quietly repaired:

- `requireDefinitive` treated any HTTP status as definitive, so an expired token
  or a rate limit reported every pin as "commit no longer resolves": a
  confident, specific, wrong FAIL, and worse than an error. Only 404/422/451 are
  answers about the object; 401/403/429/5xx are answers about the request. The
  preflight now requires a clean 200 instead of being inert.
- The moving-reference lint matched single lines, but this repository wraps its
  citations, so it caught one of the three that motivated it — missing the
  `src/index.ts` one its own header cites as the example. It now scans
  continuation-joined windows and catches all three. That immediately surfaced a
  live violation the PR was shipping, in `docs/spike-report-v1-007.md`, now
  preserved behind an explicit `FC-10-historical` marker.

Also: prose is no longer an escape hatch for the branch-name allowance; Python
pins have their cited symbols verified, matching what three prose sites already
promised; the in-suite mirror flattens the same way the gate windows; and KA-12
keeps a scoped UNGUARDED marker because `meta.catalog_version` is still
unvalidated at both `mint()` and `initDoc()`.

Upstream is three amendments past the pin (v1.1 §10, v1.3 §12, v1.4 §13);
`docs/upstream-pins.json` records them so the choice of revision is enumerable
rather than a matter of recollection. Not adopted here.

No behavioural change: the entire dist delta is JSDoc comment text and the
sourcemap offsets it shifts. No op semantics, no public export, no dependency,
no fixture bytes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UwKCRA5Sa7MDB7upecwq4p
Follow-up to #64, found by the gauntlet's doc-derived reviewer pass after the
merge. All three are documentation defects; no runtime behaviour changes.

1. `BatchableOpKind`'s JSDoc said "A kind legal inside a multi-op batch",
   eleven lines below the BATCHABLE_OPS docblock that #63 landed specifically
   to say this list is NOT a gate on `applyOps`. `applyOps` is the replay
   surface and has no kind restriction — `test/batch-policy.test.ts` pins that
   it applies a non-batchable `clear` inside a multi-op batch. #64's paraphrase
   was written before #63 landed and became a contradiction on rebase.

2. README claimed an unknown op kind means `applyOps` "applies nothing" and
   leaves the doc "byte-identical". That holds only when the unknown op is at
   index 0. Vocabulary §4 is abort-remainder, not all-or-nothing, and the
   README says so itself 53 lines later ("ops 0..k-1 stay applied"). Both of
   #64's new tests put the unknown op first, so the suite never exercised the
   case that falsifies the sentence.

3. README claimed switching on `WidgetStorage` makes a third strategy "a
   compile error in your code too". A bare exhaustive `switch` does not error
   when a union widens — that needs a `never` assertion, and `src/exhaustive.ts`
   is internal and not exported. Reworded, with the one-liner consumers need.
   Also adds the `WidgetStorage` type to the exported-symbol list.

Adds a regression test for (2) — a batch whose valid prefix applies before the
unknown op — and pins `failed.code` in the existing abort-remainder test. Both
were vacuous against the mutant that deletes the `unknown_op` reject: it used
to fail 1 test, now it fails 3.


Claude-Session: https://claude.ai/code/session_01UwKCRA5Sa7MDB7upecwq4p

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 8, 2026
@DrJKL
DrJKL requested a review from jaeone94 October 18, 2026 19:53
* fix(widgets): compose node-local order with dynamic combos

* fix(widgets): preserve dynamic values across compaction
* feat: apply interior node deletes

* fix: converge interior delete order and scrub subgraph IO links

- hoist delete_node op-only validation into requireDeleteNodeValid so the
  sonarjs cognitive-complexity lint passes (CI build / purity / test)
- keep a deleted interior id in node_order; pruning it made a winning
  re-add sort as a new addition only where the delete arrived first,
  so definition node order diverged by arrival order (KA-4)
- scrub removed interior links from the definition's own subgraph
  input/output linkIds so no slot keeps a dangling reference
- regression tests for both, plus replay idempotency and
  shared-definition batch abort; schema doc and changelog
skishore23 and others added 4 commits October 20, 2026 19:53
Replace the GPL-3.0-only LICENSE with the MIT license and update the
license field in package.json and the root package-lock entry, the README
license section, and the changelog. Releases up to and including 0.3.10
remain available under GPL-3.0-only; the next release is MIT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore: relicense from GPL-3.0-only to MIT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

ryan-di commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@DrJKL could you refresh this migration PR against current main and resolve the conflicts? Please rerun the package tests and full CI on the updated head, then request my re-review.

@mrseek-reviews

Copy link
Copy Markdown
Contributor

Fixed in 3131eab: refreshed against current main and resolved all three conflicts. Kept main's ADR-index removal, retained the imported-package ADR exemption test, and regenerated the lockfile with pnpm to preserve both dependency sets. Multiplayer source is unchanged. Package tests passed (1,800 default-tier tests and both exhaustive tests), along with 50 affected tooling tests, package typechecks/lint, and package validation gates.

Left for DrJKL: the push starts normal PR CI, but this round requires stopping without polling and forbids review-request metadata changes. Full CI results and requesting @ryan-di's re-review remain outstanding.

Pushed merge commit: 3131eab776.

@mrseek-reviews

Copy link
Copy Markdown
Contributor

Synced upstream 0.3.12 through f63f689, preserving upstream ancestry and the local clock fixes. This includes dynamic-combo ordering/compaction fixes, interior-node deletion, and MIT relicensing. Import commit: 20e428f. Measured upstream-only baseline update: a9c0781. The affected applier and compaction files match upstream byte-for-byte.

Validation: 1,816 package tests passed with two tier-selection skips; both exhaustive-tier tests passed. Package typecheck, lint, purity, imports, pins, profile claims, generated review configuration, statelessness, corpus, and packed-consumer verification passed. Normal push checks passed. No publication or deployment performed. The stacked consumer remains draft pending host compatibility.

@mrseek-reviews

Copy link
Copy Markdown
Contributor

Merged main at 458b234 into this branch in 7bc98d0. The only conflict was the duplicate-code baseline: kept main’s billing path renames and the existing multiplayer entry. Frozen install succeeded; package tests report 1,816 passed and two skipped. Normal push gates passed. No PR merge or deployment performed.

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import fidelity checks out: all 227 unchanged package files are byte-identical to upstream 0.3.12, and the test edits only add or tighten cases.

  1. The publish workflow trusts any comfy-multi-player-v* tag from any commit. Add a main-ancestry or protected-environment gate before npm trusted publishing is configured.
  2. The new and edited docs give the wrong versions (0.3.6, "above 0.3.10"). #21535 moves the catalog to 0.3.12, so pointing at the catalog is safer than hardcoding a pin.


The frontend and Cloud doc host must execute the same multiplayer semantics.
Moving their shared package does not make their deployments atomic. At import,
the frontend pins npm 0.3.6, Cloud main pins 0.3.7, and the package is 0.3.10.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) The context records the wrong versions: the frontend catalog already pins 0.3.10 (since #20096), not 0.3.6, and the imported package is 0.3.12, not 0.3.10. Line 37 then says to publish "a version newer than 0.3.10", which would point a maintainer at 0.3.11/0.3.12, versions the standalone repo already released (CHANGELOG lists both). Update both lines to the real pins and require a version above 0.3.12.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: the ADR now points to the root catalog for the frontend pin, identifies the 0.3.12 import, and requires the first monorepo release to exceed 0.3.12.

Commit.

confirming the published version before any consumer pins it.

The package source lives in the frontend repository, but the frontend app is still a consumer:
it pins an exact published version (currently `0.3.6`) and moves to a new one only through its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) Says the frontend currently pins 0.3.6. The root catalog pins 0.3.10 at both base and head, so the handoff doc misstates the consumer starting point that the release coordinator is told to verify.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: the release handoff now refers to the exact published version in the root catalog instead of repeating a moving pin.

Commit.

Comment thread packages/comfy-multi-player/README.md Outdated
npm install --save-exact @comfyorg/comfy-multi-player@0.3.10
```

0.3.10 was published from the standalone repository before the source moved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) Install section and Develop section disagree with the imported tree: it pins installs at 0.3.10 and says the first monorepo release must be "a new version above 0.3.10", while the package and CHANGELOG are at 0.3.12 (0.3.11 and 0.3.12 already released from standalone, MIT). Line 760 also says the frontend consumes 0.3.6; it consumes 0.3.10.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: the install example and standalone release floor now use 0.3.12; development guidance points to the root catalog for frontend consumption.

Commit.

provenance for new versions names `Comfy-Org/ComfyUI_frontend`, that
workflow path, and the tag ref, and `scripts/release-retry.mjs` verifies
exactly that identity before treating an existing registry version as this
release. Versions up to `0.3.10` carry the standalone repository's

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) The amendment says only versions up to 0.3.10 carry standalone provenance, but the imported CHANGELOG records 0.3.11 and 0.3.12 as released from the standalone repo. Those versions will also fail release-retry identity verification here; CONTRIBUTING.md:146 repeats the same floor. State the floor as 0.3.12 (or "every version released before the import").

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: the amendment and contributing guide include standalone provenance through 0.3.12 and require a newer version for the first monorepo release.

Commit.

Comment thread .coderabbit.yaml Outdated
non-fatal) are correctness issues. Keep the purity gate a positive
yjs-only assertion, not merely a denylist (comfy-multi-player issue
#22).
- path: '{packages/comfy-multi-player/package.json,packages/comfy-multi-player/tsconfig.json,packages/comfy-multi-player/stryker.config.mjs,.github/workflows/*-comfy-multi-player.yaml}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) The narrowed glob .github/workflows/*-comfy-multi-player.yaml does not match publish-comfy-multi-player-on-merge.yaml, the workflow that creates release tags with contents:write and actions:write. Upstream covered it via .github/** (auto-tag-release.yml). Add publish-comfy-multi-player-on-merge.yaml (e.g. *-comfy-multi-player*.yaml) in the purity.md block and regenerate so the release-trigger contract stays under review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: widened the source profile to -comfy-multi-player.yaml and regenerated CodeRabbit configuration. The on-merge publisher now matches. The updated contract failed against the old generated glob and passes with the regenerated rule.

Commit.

run: |
# Holds for a tag push and for a dispatch at the tag alike; rejects a
# dispatch aimed at a branch before any gate or publish work happens.
test "$RELEASE_REF" = "refs/tags/$RELEASE_TAG"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The publish gate only checks that the tag name equals package.json at the tagged commit. Nothing requires that commit to be reviewed or on main, and there is no environment. In this repo anyone with write access can push comfy-multi-player-v at any branch commit (CONTRIBUTING even documents git tag ... <merge-sha> by hand), and a tag-push run executes the workflow file from that commit, so the gates can be edited away before OIDC publishes to npm. The other publish workflows here only publish from main (publish-package.yaml requires refs/heads/main on dispatch). Suggest a environment: with a deployment tag rule and required reviewers, bound in the npm trusted-publisher entry, plus a git merge-base --is-ancestor $GITHUB_SHA origin/main check before publishing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left for DrJKL: which protected release environment and required reviewers should we configure and bind in npm trusted publishing? Added a full-history main-ancestry check before package setup in 20fe683; a real Git probe accepts main and ancestors and rejects an off-main commit. This does not solve the malicious-workflow case: a tag author can remove a YAML check. Publication must remain blocked until the external reviewer/tag restrictions and npm binding are configured. This round changed no shared settings and ran no publication.

Commit.

const env = cleanEnv();
try {
writeFileSync(join(consumer, "package.json"), '{"name":"cmp-consumer","private":true,"type":"module"}\n');
run("npm", ["install", "--ignore-scripts", "--no-audit", "--no-fund", "--no-package-lock", tarball], { cwd: consumer, env });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) The new consumer smoke runs npm install <tarball> with --no-package-lock in a fresh dir, so yjs and its lib0 range resolve live from the registry instead of the pnpm lockfile, and the runtime probe then imports them. This step runs in the publish job, which holds id-token: write at workflow level, and cleanEnv() keeps ACTIONS_ID_TOKEN_REQUEST_* in the child env. A malicious yjs/lib0 release inside the caret range would execute with the ability to mint the npm trusted-publishing token. Suggest running the consumer smoke only in the CI workflow (no id-token), or pinning the consumer install to the lockfile versions, or splitting publish into a gates job without id-token and a minimal publish job.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: the OIDC publish job uses the existing verify:package --skip-consumer mode, which checks the packed artifact without installing or importing live-registry dependencies. Full consumer smoke remains in read-only CI. Both modes passed locally, and the workflow contract requires this split.

Commit.

// root; reject sequence content before getMap can hide it in a map view.
if (root._start !== null) throw new TypeError(`${name} root contains non-map content`);
const ledger = doc.getMap<unknown>(name); // throws for a different concrete Y type
const metadataPrefixes = name === ROOT_STAMPS ? ['["grow_request",', '["interior_route",'] : [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) This local clock fix (and the read.ts/schema-version.ts/global.d.ts edits) changes shipped behavior, but package.json still says 0.3.12, the exact version already published from the standalone repo at f63f689, and CHANGELOG ## Unreleased is empty. Anyone building or diffing this workspace at 0.3.12 gets an observedDocCounter that tolerates grow_request/interior_route rows, while npm 0.3.12 still throws 'malformed stamp tuple' on those docs. Please add an Unreleased CHANGELOG entry for the fix (and ideally a prerelease/next-version marker) so the source and the published artifact sharing one version number cannot be confused, and land the same fix upstream if the standalone repo is still live so a later sync does not revert it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: Unreleased now distinguishes the local source from published 0.3.12 and records the clock metadata fix, internal export/helper changes, and ambient type change. Source comparison confirmed those four changed files and an unchanged public entrypoint. No version bump or upstream write is included; those remain separate release/repository actions.

Commit.

1. **Source import (this step).** The package source, its gates
(`ci-comfy-multi-player.yaml`, `mutation-comfy-multi-player.yaml`), and its
CodeRabbit rules live in the frontend repository. The frontend app still
consumes the published 0.3.6 from npm through the pnpm catalog, so the import

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) Version facts in the imported docs are stale and contradict package.json and the root catalog. ROADMAP says the import is from upstream at 0.3.10, that the frontend consumes published 0.3.6, and that 'The package version stays 0.3.10'; README.md:760 and docs/release-handoff.md:27 also say 0.3.6. The source is 0.3.12 and pnpm-workspace.yaml pins 0.3.10. README.md:715-718, CONTRIBUTING.md:146 and ADR-006:108 say standalone provenance covers versions up to 0.3.10, so the first monorepo release only needs to be above 0.3.10, but 0.3.11 and 0.3.12 were also published from the standalone repo. A maintainer following that guidance could pick 0.3.11 or 0.3.12, which release-retry would then refuse on a provenance mismatch. test/ci-release-contract.test.ts:173 pins the stale '0.3.6' string. Please fix these to 0.3.10 (frontend pin) and 0.3.12 (last standalone release / first monorepo release must be >0.3.12), and update the test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: corrected the import and standalone release floor to 0.3.12, replaced current frontend version claims with catalog references, and updated the contract assertion so it no longer pins the stale 0.3.6 prose.

Commit.

const node = steps.find((step) => step.uses?.startsWith("actions/setup-node@"));
assert(node);
assert(unconditionalGate(node));
assert.equal(node.with?.["node-version-file"], ".nvmrc");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Upstream pinned the release job's Node to an exact version (24.21.0), and the 'moving Node' negative case rejected a floating version. The contract now accepts node-version-file .nvmrc, and the root .nvmrc is the bare major '26', so release Node floats to whatever 26.x setup-node resolves. Package CI also moved from Node 22 to 26, so nothing exercises the older Node floor anymore. npm is still pinned to 11.19.0, which limits the impact. If floating is intended, say so in the publish workflow. Otherwise pin an exact version for the release job.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20fe683: release Node is pinned to 26.10.0, within the monorepo engine requirement. The contract requires an exact version and rejects a floating 26. Package CI still uses the monorepo Node line; this does not claim validation of an older Node floor.

Commit.

@mrseek-reviews

Copy link
Copy Markdown
Contributor

Answer: the import-fidelity acknowledgment needs no change; this round leaves runtime package source untouched.

Fixed in 20fe683: corrected the migration docs to reference the frontend catalog and the 0.3.12 standalone release floor. Also corrected pnpm guidance and the generated workflow glob, recorded unpublished deltas, pinned release Node, and removed live-registry consumer execution from the OIDC job. Replied to every inline item.

Left for DrJKL: choose and configure the protected release environment, required reviewers/tag restrictions, and npm trusted-publisher binding before publication. The new ancestry check rejects off-main commits but cannot stop a tag author from removing the check itself. No shared settings were changed.

Answer: pushed 20fe683a17. Validation: 1,816 package tests passed with two skips; all 67 release-contract tests passed; package typecheck, lint, generated-profile checks, both artifact verification modes, formatting, and push gates passed. The ancestry command passed main/ancestor cases and rejected a side commit. No publish workflow was triggered, no threads resolved, and no approval posted.

This branch has not been deployed

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

Labels

risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants