Skip to content

Relay rebuild changes permanent fact IDs, breaking supersedes and retained references #30

Open

Description

@McHersheys

Summary

A fact ID returned by an ordinary successful local operation can change during relay outbox reconstruction. A later, also successful correction still names the original ID in supersedes, so reconstruction refuses it with NO_FACT and loses it from the rebuilt projection. Recreating item rows is therefore not sufficient evidence of faithful board recovery.

This is a distinct defect from the request-size problem in #14. It was first reported in this PR #29 comment, but needs its own issue.

Reproduction and observed result

A small executable regression uses real native SQLite, native changesets and a sealed v3 outbox, with an in-process ordering fixture:

  1. Queue an ordinary appendFact A and retain its returned/local fact ID.
  2. Queue a correction B with supersedes set to that original ID. Assert both operations actually succeeded locally and save their (id, supersedes) pairs.
  3. Exercise interrupted outbox reconstruction: an ordered prefix has committed, while the persisted queue still describes the earlier provisional rows.
  4. Stop at the transport boundary, before sending pending moves, and compare the reconstructed facts with the two original facts.

Actual: the two successful original facts reconstruct as one fact with a changed ID; the correction is refused with NO_FACT. The identity-preservation assertion fails. The focused run had 10 other reconstruction/lease controls pass and this reference regression fail. This is an observed failing regression, not a proposed or passing test.

Source-bound scope: the reproduction was run against draft PR #29 at be4ed014e1b3f1d37be3f5024bbf1891ab7a7a68, which already includes interrupted-rebuild and original-clock corrections. This is not a claim that the whole scenario was reproduced on an unmodified released deployment. The existing source relationship is local appendFact generating a random fact ID, while reconstruction's executableArgs substitutes the sealed move ID; dependent queued arguments still contain the original fact ID.

Related fidelity risks

A preserved-original-state rehearsal also found activity observedThrough references beyond the rebuilt event prefix and answerDecision targets resolving to different, non-decision shouts. Those are additional observed reference-fidelity failures, not a claim that the small two-fact regression alone proves every cause. The repair needs to account for their relationship rather than treating recovered item counts as success.

Expected behavior / regression coverage

  • IDs already returned to callers must remain usable for the same logical objects after reconstruction and ordering. Reconstruction must not silently replace an identity while leaving later references bound to the old one.
  • Fact corrections/supersession, decision answers and event-prefix references must retain their original meaning; references must never silently resolve to another object.
  • Cover already-created retained queues, not only a prospective new-ID generation rule. If a supported mapping is needed at the ordering boundary, it must preserve existing references and be checked explicitly.
  • Preserve original move identities, order, sealed pending payloads and already-recorded outcomes. No resend of accepted moves, manual queue editing or reset of live state should be required.
  • Retain a small discriminating regression, then verify faithful reconstruction of known history/outcomes. Item-count parity alone is insufficient.

Fix status

Unresolved at filing. Related draft #29 contains earlier recovery corrections, not yet a qualified fix for this identity defect. The same repair author is continuing the work; the permanent-ID fix and regression should be submitted in the linked PR once implemented and qualified. Independent review, full applicable checks and live adoption remain separate from publishing source.

No private board identifiers, contents, state captures, credentials or deployment details are attached.

Activity

  1. McHersheys commented on Nov 13, 2026

    @McHersheys
    Author

    PR #29 now contains 7014434, with 22 focused native SQLite/sealed-queue regressions passing. The completed independent review of the earlier head rejected drain-safe recovery; that finding has been consumed, not relabeled accepted. New code preserves original local IDs, validates captures before mutation, retains delayed claim deadlines, protects an already-advanced prefix from stale undo, and refuses demonstrated shout/event positional shifts before state replacement. Useful representable fact and unshifted-reference chains still deliver.

    The remaining authoritative compatibility problem is exact: legacy appendFact executed locally with random ID R, but its original sealed move M contains no R; executableArgs assigns M.id on every replica. A later unchanged supersedes=R is therefore lost/refused. This also affects implied fact seeds. We now stop this legacy chain before its first POST rather than partially draining it. That is containment, NOT the permanent-ID recovery requested here.

    Please identify/select the supported authenticated input for original legacy identity/reference bindings across replicas. If no such input exists, a versioned replay/recovery contract is required that binds genuine captured identities to the exact original moves while preserving their payloads and already-settled receipts. We have not invented aliases, rewritten/reminted old moves, promoted provisional state into an ordered checkpoint, or sent the accepted prefix again. A future-only ID fix or a larger relay limit cannot supply the missing legacy input.

    There is a second retained obligation: enqueue time is not the full original application-clock trace. The delayed-deadline case is fixed; full original timestamp/reference fidelity and changed/refused-producer mapping remain unaccepted. Exact new-head independent review and owner-bound live restoration are still owed. The PR stays draft; no restart or live queue mutation has been performed.

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