Skip to content

ORSet.compact() returns CompactionReceipt #474

Description

@flyingrobots

1. Background Context

Source: git-warp #474. Audited against main 94b40dac64034cd8caab9bb05efe14a0c22bd735. Template: feature; work type: type:feature.

Current scope and disposition: A supported compaction receipt must wait for safe membership-retirement semantics. Diagnostic counting that retains evidence can be a narrower independent card, but is not the current compact-and-remove proposal.

Discussion evidence, including corrections:

2. Problem Description

A supported compaction receipt must wait for safe membership-retirement semantics. Diagnostic counting that retains evidence can be a narrower independent card, but is not the current compact-and-remove proposal.

Historical source report; the current disposition above supersedes obsolete claims:
ORSet.compact(includedVV) currently mutates the set in place and
returns nothing. The caller has to diff before/after metrics manually
(GCPolicy does this with collectGCMetrics).

Instead: compact() returns a CompactionReceipt — a frozen value
object with { dotsRemoved: number, elementsRemoved: number }. The
caller gets structured feedback without manual diffing.

const receipt = state.nodeAlive.compact(appliedVV);
logger.info(`GC: removed ${receipt.dotsRemoved} dots`);

This aligns with the Systems-Style manifesto: structured data stays
structured (no "count before, count after, subtract" pattern).

2b. Proposed Solution

A supported compaction receipt must wait for safe membership-retirement semantics. Diagnostic counting that retains evidence can be a narrower independent card, but is not the current compact-and-remove proposal.

Historical approach to reconcile:
Current architecture rules take precedence: parsing/encoding stays at adapters, domain concepts are runtime-backed, no trust casts are introduced, and tests run in Docker.
ORSet.compact(includedVV) currently mutates the set in place and
returns nothing. The caller has to diff before/after metrics manually
(GCPolicy does this with collectGCMetrics).

Instead: compact() returns a CompactionReceipt — a frozen value
object with { dotsRemoved: number, elementsRemoved: number }. The
caller gets structured feedback without manual diffing.

const receipt = state.nodeAlive.compact(appliedVV);
logger.info(`GC: removed ${receipt.dotsRemoved} dots`);

This aligns with the Systems-Style manifesto: structured data stays
structured (no "count before, count after, subtract" pattern).

2c. Alternatives considered and rejected

No additional alternatives are recorded as decided. Reject duplicate ownership, private-import escape hatches and a broken intermediate mainline; retain original alternatives below when present.

2d. Acceptance Criteria

2e. Test Plan

Golden: Compare the declared CRDT result with an independent expected-state witness.

Edges: Empty operations, concurrent additions/removes, replay permutations and checkpoint round trips.

Known failure modes: Malformed inputs or stale evidence cannot silently change membership/causality.

Fuzz and stress: Deterministic writer schedules and join permutations; include a calibrated broken control.

All tests and benchmarks execute in COPY-based Docker containers without host repository or Git-directory mounts. This planning audit does not claim those checks were run.

3. Prerequisites

Completion prerequisites; preparatory work may start earlier.

  • #911: Use this receipt feature only for a safe compaction contract: it must not turn the known unsafe membership retirement into a supported GC operation. Safety/admissible-merge semantics precede the advertised dotsRemoved receipt.

4. Scope

In: A supported compaction receipt must wait for safe membership-retirement semantics. Diagnostic counting that retains evidence can be a narrower independent card, but is not the current compact-and-remove proposal.

Out: unrelated domain work and any expansion beyond the issue’s stated observable outcome.

Safe intermediate state: the PR builds and passes relevant checks after its listed prerequisites; existing supported behavior remains usable. Any preparatory step must be independently mergeable.

5. Why now

Maintainer ordering: memory correctness first, supported attachments next, then land eligible PRs. Preserve this card’s existing priority unless a separately recorded scope decision changes it.

6. Risks

Main risk: implementing the historical description instead of the current runtime contract. Preserve compatibility, causal/ownership invariants and bounded behavior relevant to crdt.

7. Definition of Done

The issue-specific acceptance checks pass, relevant validation evidence is attached, and the issue links the coherent PR and resulting mainline integration commit. No open item is hidden in a later repair PR.

8. Stakeholders

James Ross: maintainer, assignee and acceptance owner. git-warp contributors and consumers rely on this domain’s supported contract and reproducible evidence.

9. Related Issues

No additional downstream blocker is established. Shared domain membership alone is not a prerequisite.

Historical paths, counts, release names and shell examples in source material are evidence to reconcile, not authority to restore retired documentation or run host tests.

Activity

  1. added
    area:runtimePrimary work area: runtime.
    priority:laterDeferred or speculative work.
    status:availableOpen and available for prioritization; not blocked or actively in progress.
    on Jun 11, 2026
  2. self-assigned this
    on Oct 1, 2026
  3. flyingrobots commented on Oct 1, 2026

    @flyingrobots
    MemberAuthor

    Dependency re-audit (2026-10-01)

    A supported compaction receipt must wait for safe membership-retirement semantics. Diagnostic counting that retains evidence can be a narrower independent card, but is not the current compact-and-remove proposal.

    Completion prerequisites:

    Early investigation or an independently green preparatory slice may start sooner; closing this card requires the complete outcome. No broken intermediate mainline or host test execution is acceptable.

    Full 232-card review: https://linear.app/flyingrobots/document/dependency-decisions-all-232-open-git-warp-issues-2026-10-01-abfe8f9fec63

  4. added
    status:blockedBlocked by an explicit dependency or external condition.
    and removed
    status:availableOpen and available for prioritization; not blocked or actively in progress.
    on Oct 1, 2026
  5. added this to the v21.1.0 milestone on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:runtimePrimary work area: runtime.domain:crdtpriority:laterDeferred or speculative work.status:blockedBlocked by an explicit dependency or external condition.template:featureCard template: featuretype:featureNew capability or product behavior.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions