Skip to content

Normalize equivalent protected sync retractions - #147

Merged
RCmerci merged 1 commit into
mainfrom
fix/protected-retract-canonicalization-20261031
Oct 31, 2026
Merged

RCmerci merged 1 commit into
mainfrom
fix/protected-retract-canonicalization-20261031

Conversation

@RCmerci

@RCmerci RCmerci commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

An authoritative echo can contain different encrypted envelopes that decrypt to the same title or name. Replaying the resulting retract/add pair produces extra datoms and can reject a locally accepted journal creation even when the final plaintext facts agree.

Match Logseq's drop-conflicted-encrypted-retracts rule from logseq/logseq at e7e9c97c: within one decrypted transaction, remove a block/title or block/name retract only when the exact entity-reference/attribute/value key also has an add. Keep adds, ordering, duplicate adds and all other differences. Normalize at the shared decode boundary so authoritative preview and durable replay use the same operations; preserve exact integrity, origin-interval, checkpoint and outbox/receipt checks.

Validation:

  • TDD: five equivalence cases failed before the fix and passed after it; two negative controls retained rejection. Covers title/name, both operation orders, four/five-field wire forms, duplicates, different values and non-protected attributes.
  • Locked-environment preflight, full dune build @all app/native_embed.exe.o, and dune runtest --force passed locally: 1,124 Alcotest cases plus existing plain test executables.
  • Journal CI run 342 completed successfully on this PR head.
  • Six isolated Web/Journal creation-order controls passed against the final libraries; a contradictory accepted-origin control still fails integrity.
  • Independent read-only final-diff review found no evidenced correctness or performance issue.

spec-dev-tool is unavailable in the local environment, so its document check was not run; this PR changes no documentation, protected spec, Dune, dependency or release files. Validation uses synthetic local data. The reported phone incident remains unconfirmed without its field diagnostics; this PR does not claim that incident has been proven resolved.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T08:31:21.294983Z bea32aa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@RCmerci
RCmerci merged commit d18432a into main Oct 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant