Skip to content

polylogue.rows: Polylogue's archive units in primary mode - #2779

Merged
Sinity merged 3 commits into
masterfrom
boundary/polylogue-rows
Oct 19, 2026
Merged

Sinity merged 3 commits into
masterfrom
boundary/polylogue-rows

Conversation

@Sinity

@Sinity Sinity commented Oct 19, 2026

Copy link
Copy Markdown
Owner

The Sinex side of Polylogue's primary mode (architecture §9; sxnext-8er).

  • New event kind polylogue.rows: one unit of a Polylogue archive's archive.db rows (a revision with its input, extents, observations and blob rows; a note with its targets and relations; an excision; a setting; a delivery). The rows travel as a record-batch material; the event is anchored at its start and names the input blobs the rows cite, each a material placed before it. Keyed by archive and position (the unit's place in the archive's write order, which only appends), so a resend is a repeat and Sinex holds an archive whole up to its first missing position. Sinex never parses either.
  • Contract test in ingress/tests.rs: units are admitted once by archive and position, a resend in a new frame is a repeat, have answers per frame.

Polylogue's rebuild proof (Sinity/polylogue, crates/sinex/tests/proof.rs) drives these frames through a real sinexd over PostgreSQL and NATS: an archive published, restored into an empty archive and rebuilt with no provider files gives identical answers.

Verification: xtask check (fmt, boundaries, clippy) passed; xtask test ingress 5/5; sinex-model kind test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AcQETkbTfFMr1hgNJ8A3em

@Sinity
Sinity merged commit 5def701 into master Oct 19, 2026
@Sinity
Sinity deleted the boundary/polylogue-rows branch October 19, 2026 02:56
Sinity added a commit to Sinity/polylogue that referenced this pull request Oct 19, 2026
…from stored bytes (#6304)

Polylogue's `primary` mode on Sinex (architecture 7.1; epic plnext-3sx),
and the rebuild proof (joint #7).

**The loop builds the index from stored bytes.** A deleted or outdated
`index.db` is built again by the same loop from what `archive.db`
stored, read by range through `hashed-blobs`, even when the provider
file moved or went. This is also what lets a standalone archive rebuild
without its files. Two engine tests cover it.

**`crates/sinex` (`polylogue-sinex`, behind the `sinex` feature; the
default build has no NATS dependency):**
- Publish: every input blob is placed into Sinex's content store (same
host) and registered as a material; every unit of `archive.db` rows (a
revision with its input, extents, observations and blob rows; a note
with targets and relations; an excision; a setting; a delivery) travels
as a record-batch material plus one `polylogue.rows` event
(Sinity/sinex#2779). Frames are named by what they carry, units by their
position in write order, so the publish step asks Sinex (`have`, by
bisection) and sends only the rest; nothing local records what was sent.
- Restore: an empty archive reads its units from the confirmed stream in
order, checks each batch whole and contiguous positions, inserts the
rows, and takes over the archive's identity and write counter. The loop
then builds `index.db` with Sinex's store as an extra blob root.
- Daemon: `$XDG_CONFIG_HOME/polylogue/sinex.toml` with `mode =
"primary"` adds Sinex's store as a blob root, restores an empty archive
named by `archive = "<id>"`, and publishes once a minute. A file that
does not parse pauses publishing and never switches mode.
- The row codec lives in `polylogue-store::rows` (only the store opens
SQLite); `archive.db` now carries an `archive_id`.

**Proof** (`crates/sinex/tests/proof.rs`, ignored by default; how to run
it is in `docs/development.md`): the Claude Code examples converge
standalone, publish to a real `sinexd` over a throwaway PostgreSQL and
NATS (a second publish sends nothing), restore into an empty archive,
converge with no provider files present, and every session and message
comes back identical. Passed (18 s).

Verification: `xtask fast`; nextest on store, engine and sinex (56
passed); the proof run against `sinexd` built from Sinex #2779.

Not done (follow-ups filed): normalized segments and object-level
equivalence keys (joint #3–#5); excision orders across the boundary
(joint #6, #19); the pending area that drops local copies once Sinex
confirms; tables without `local_seq` (`kept_result`, `variant`,
`variant_alignment`, `notice_delivery`) and `delivery_event`s added
after their delivery's publish; publishing from another host (bytes over
NATS); the real-corpus rebuild before any cutover.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01AcQETkbTfFMr1hgNJ8A3em

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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