Skip to content

Define and test the §4 snapshot-compaction contract #130

Description

@christian-byrne

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: #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 fix: reject op id payload reuse #33: the merged payload-digest change, fix: reject op id payload reuse #33.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions