Comfy-Org / Comfy-Org/comfy-multi-player
Define and test the §4 snapshot-compaction contract
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 1
- Avg merge
- 12h 22m
- Merged PRs (30d)
- 121
Description
# XREF-1 current-state verification
Verified 2026-08-30 against `comfy-multi-player` `origin/main` at `5f880f6c0e534d94dd3d381c4f1cee69fbbd0dad` and GitHub PR state.
PR #33 merged on 2026-08-21, so the original instruction to resolve this risk before merge is stale. The residual gap remains:
- `docs/multiplayer-schema.md` §4 requires host snapshot compaction when bookkeeping exceeds 25% of document bytes or 10,000 `__applied` entries.
- The same section records the digest representation at about 32% bookkeeping in the measured session, so the percentage trigger is crossed during ordinary operation.
- `src/doc.ts` explicitly says per-actor watermark compaction is not implemented and delegates snapshot compaction to the host. The package exposes no tested host-facing compaction contract.
The bounded SHA-256 digest from PR #33 fixed unbounded payload-sized entries, but it did not bring bookkeeping below the schema trigger or implement that trigger. `__applied` therefore remains O(ops). This is no longer a merge blocker for an already-merged PR; it is current implementation debt requiring a shared-package contract plus consumer-host work.
Upstream tracking: https://github.com/Comfy-Org/comfy-multi-player/issues/130
## Glossary
- `__applied`: replicated map used to recognize an already-consumed operation ID.
- Compaction: minting a fresh document epoch that preserves semantic state while discarding bounded historical bookkeeping.
- Host: the merge-authority process that owns the canonical shared Yjs document.
- PR #33: the merged payload-digest change, https://github.com/Comfy-Org/comfy-multi-player/pull/33.
Contributor guide
Research direction
Start with §4 of docs/multiplayer-schema.md and the compaction notes in src/doc.ts, then inspect the current host-facing package surface and its tests. Done means a defined and tested snapshot-compaction contract that addresses the documented bookkeeping triggers and covers the consumer-host work described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100