Skip to content

feat(changes): name the source store and log epoch on every page - #789

Merged
scbrown merged 2 commits into
mainfrom
malcolm/xdvg1-feed-f5
Oct 24, 2026
Merged

scbrown merged 2 commits into
mainfrom
malcolm/xdvg1-feed-f5

Conversation

@scbrown

@scbrown scbrown commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

What

Every change page now names its source: source.store_id and source.log_epoch. The epoch is minted at store creation, or on first open for a store that predates it, and is kept across reopen. A follower holding a cursor from another epoch knows its cursor names a different history and must re-bootstrap. log_epoch is excluded from shares, because it is this store's local position, not content.

Base

The PR is rebased onto main ff81361f (#788 landed) and is not stacked. Its commits are 89c53f9c (source store and log epoch on every page) and f2c51c0b (the source on a chunked transaction's begin and commit). git range-diff against the published e6a6dd5e/614ce73d shows both identical (=). #788's squash ff81361f equals the reviewed 01bb0978 patch. All knowledge witnesses match their files. #785 is rebased onto this branch and follows it.

Evidence

  • f5_pages_carry_source_identity failed before this change: the page had no source. It passes after.
  • f5_log_epoch_is_stable_until_minted_again: the epoch is stable across reopen, minting changes it, and an upgraded store gets one late.
  • Share-completeness classifies the new table.
  • a_chunked_transaction_names_its_source_on_begin_and_commit: begin and commit carry source, so a follower can epoch-check a chunked transaction.
  • Local runs at f2c51c0b: cargo test --features shacl,owl 3208 passed, 0 failed; server binary 237 passed, 0 failed; clippy -D warnings -A missing-docs exits 0 for full and shacl,owl; fmt clean.

Rollback

Revert the commit. The new table is left unused, which is harmless. Pages lose source.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BzgSY2LpdGhBhb7D1nHbiF

@scbrown

scbrown commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Review scope update: also review 614ce73d (fix(stream): name the source on a chunked transaction's begin and commit). It found while wiring the shared applier: an oversized transaction's begin and commit frames carried no source, so a follower could not epoch-check a chunked transaction. Both now carry the page's {store_id, log_epoch}; new test a_chunked_transaction_names_its_source_on_begin_and_commit (sabotage of either frame turns it red). Server suite 232/0, full suite 3190/0, clippy clean.

scbrown and others added 2 commits October 24, 2026 09:24
A change page did not say which store produced it, and nothing marked a
history boundary, so a follower could not tell a restored or cloned primary,
or one that had removed served records, from the one it was following
(local-sync-mode.md §5, F5).

Every page now carries source.store_id and source.log_epoch. The epoch lives
in a new one-row log_epoch table, minted when the store is created (or first
opened by this version) and minted again by Store::mint_log_epoch for an
operation that removes served history. Share reconstruction excludes the
table, so a restored copy mints its own epoch and its followers re-bootstrap.
The explicit restore/adopt ownership step is deferred to aegis-s24.2, per the
xdvg.1 ruling.

Tests cover the page source, an epoch stable across reopen, a new epoch after
minting, and a store that predates the table getting one on first open.
Removing the field turns both tests red.

Refs aegis-xdvg.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185RxTpLsPCQFB9ni72Nzac
An oversized transaction's begin and commit frames carried no source,
so a follower could not epoch-check a chunked transaction the way it
checks a whole page, although a changed epoch must mean re-bootstrap,
never splice. Both frames now carry the page's {store_id, log_epoch}.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BzgSY2LpdGhBhb7D1nHbiF
@scbrown
scbrown force-pushed the malcolm/xdvg1-feed-f5 branch from 614ce73 to f2c51c0 Compare October 24, 2026 13:24
@scbrown
scbrown marked this pull request as ready for review October 24, 2026 13:44
@scbrown

scbrown commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

APPROVE at f2c51c0, base ff81361. Reviewed the full ten-file proposal, including source identity on chunked transaction begin and commit frames. Complete hosted workflows and normal native admission preceded source review.

Independent exact-source library controls: four pass, including empty/filtered pages, separate stores, stable epoch on reopen, explicit epoch rotation, and read-only observation with mutation refused. An isolated harness compiling the exact chunking function and cursor module passes five controls, including source identity at both boundaries, record reassembly and commit-only cursor advancement. Both guarded runs left watched HOME paths and resources untouched. The harness is a focused check, not a full server build; hosted current-head server and feature checks supply the wider coverage.

No blocking source finding. Native approval accepted 8d482e0df3e1ab8dd5892dfbd7c17ac3b181012bad4dbc537217a515cc08c3d8. Rollback is a normal revert of the actual squash commit; the added epoch table may remain unused by the prior binary. Merge and deployment holds remain separate gates.

@scbrown
scbrown merged commit 3b1cf19 into main Oct 24, 2026
24 checks passed
@scbrown
scbrown deleted the malcolm/xdvg1-feed-f5 branch October 24, 2026 14:20
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