From 7af388326d9fbd55348f55ea7f46a20e8ec25b82 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Thu, 19 Nov 2026 10:36:44 -0500 Subject: [PATCH] docs: the Postgres-to-LMDB record is ADR 0013, not a second 0012 Jobs 028 and 029 each took the next free number while running in parallel, so docs/rewrite/decisions/ carried two 0012s and every citation of "ADR 0012" was ambiguous. The later arrival (029, 11-12) moves to 0013, which keeps the numbering in the order the records were written; the NIP-50 record (028, 11-11) keeps 0012 and its six prose citations. Seven Rust doc comments in nostream-cli and nostream-storage name the file and follow the rename. No behaviour changes: comment text only. Closes #1185 --- .changeset/adr-0013-renumbering.md | 10 ++++++++++ crates/nostream-cli/src/commands/migrate.rs | 6 +++--- crates/nostream-storage/src/lib.rs | 2 +- crates/nostream-storage/src/migration.rs | 4 ++-- crates/nostream-storage/src/postgres/migration.rs | 2 +- ...-lmdb-migration.md => 0013-pg-to-lmdb-migration.md} | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 .changeset/adr-0013-renumbering.md rename docs/rewrite/decisions/{0012-pg-to-lmdb-migration.md => 0013-pg-to-lmdb-migration.md} (99%) diff --git a/.changeset/adr-0013-renumbering.md b/.changeset/adr-0013-renumbering.md new file mode 100644 index 000000000..2874d0992 --- /dev/null +++ b/.changeset/adr-0013-renumbering.md @@ -0,0 +1,10 @@ +--- +--- + +docs: renumber the Postgres-to-LMDB record as ADR 0013 + +`docs/rewrite/decisions/` held two 0012s: the NIP-50 index (job 028, added +2026-11-11) and the Postgres-to-LMDB migration (job 029, added 2026-11-12). +The later arrival takes 0013, so numbering follows the order the records were +written. Seven Rust doc comments follow the rename; the six prose `ADR 0012` +mentions cite the NIP-50 record and keep their number. diff --git a/crates/nostream-cli/src/commands/migrate.rs b/crates/nostream-cli/src/commands/migrate.rs index 3833e1298..0d04c1c2c 100644 --- a/crates/nostream-cli/src/commands/migrate.rs +++ b/crates/nostream-cli/src/commands/migrate.rs @@ -3,7 +3,7 @@ //! The seam is `nostream_storage::migration` — a paged read of each source table and an exact //! write of each row, neither of which the nine repository traits can express. This module owns //! what the seam's caller owns: the manifest, the checksum, resume, the verification pass and -//! the run's own measurement (`docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`). +//! the run's own measurement (`docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`). //! //! The batch commits to the store first and the manifest is replaced atomically second, so a //! crash between them replays one batch: every write is a put of the source's own key and @@ -452,7 +452,7 @@ impl Default for TableEntry { /// is order-independent, needs constant memory, and composes across a resume /// (`sum(A ∪ B) = sum(A) + sum(B)`); it detects an added, removed or altered row and is stated /// as a corruption and completeness check, not as a cryptographic commitment -/// (`docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`, D4). +/// (`docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`, D4). #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] struct RowSum([u64; 4]); @@ -506,7 +506,7 @@ impl RowSum { /// Adds four big-endian words into a 256-bit limb sum, modulo 2^256. /// /// The manifest documents the checksum as the sum of the row digests modulo 2^256 -/// (`docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`). Adding the four words +/// (`docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`). Adding the four words /// independently is a different number whenever a limb wraps, and an independent checker /// written from the documentation would compute a checksum this tool calls wrong, so the /// carry has to cross the word boundary. Limb 3 is the least significant — `to_hex` writes diff --git a/crates/nostream-storage/src/lib.rs b/crates/nostream-storage/src/lib.rs index d87c3ca8b..3ac2697e7 100644 --- a/crates/nostream-storage/src/lib.rs +++ b/crates/nostream-storage/src/lib.rs @@ -29,7 +29,7 @@ //! trigger-maintained index whose LMDB `tags` database the event write path keeps), and //! `events.first_seen` is stored but never indexed //! (`docs/rewrite/decisions/0011-lmdb-backend.md`, -//! `docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`). +//! `docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`). pub mod backend; pub mod error; diff --git a/crates/nostream-storage/src/migration.rs b/crates/nostream-storage/src/migration.rs index 483bd0e60..08e2e0843 100644 --- a/crates/nostream-storage/src/migration.rs +++ b/crates/nostream-storage/src/migration.rs @@ -3,7 +3,7 @@ //! This module exists for one caller — `nostream-cli migrate pg-to-lmdb` — and is **not** a //! general read or write surface. Nothing in the relay, the daemon or the repository traits may //! use it, and a second caller needs a decision record first -//! (`docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`, D1). +//! (`docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`, D1). //! //! It lives here rather than in the CLI because the pieces a copy needs are in this crate: the //! Postgres row decoders (`crate::postgres::rows`), the event column list, and the LMDB @@ -220,7 +220,7 @@ impl MigrationRow { /// Reads one table of the source, a keyset page at a time. /// /// The implementation issues no statement but these reads: the migration never writes to the -/// source (`docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`, D12). +/// source (`docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`, D12). pub trait MigrationSource: Send + Sync { /// The rows of `table` after `after`, in the table's key order, at most `limit` of them. /// diff --git a/crates/nostream-storage/src/postgres/migration.rs b/crates/nostream-storage/src/postgres/migration.rs index 0c46bd992..70a6e6243 100644 --- a/crates/nostream-storage/src/postgres/migration.rs +++ b/crates/nostream-storage/src/postgres/migration.rs @@ -8,7 +8,7 @@ //! //! Nothing here writes. The migration issues no `INSERT`, `UPDATE`, `DELETE` or DDL against the //! source, and never runs the embedded migrator: a source that has not been migrated fails with -//! the driver's own error (`docs/rewrite/decisions/0012-pg-to-lmdb-migration.md`, D12). +//! the driver's own error (`docs/rewrite/decisions/0013-pg-to-lmdb-migration.md`, D12). use sqlx::Row; use sqlx::postgres::PgRow; diff --git a/docs/rewrite/decisions/0012-pg-to-lmdb-migration.md b/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md similarity index 99% rename from docs/rewrite/decisions/0012-pg-to-lmdb-migration.md rename to docs/rewrite/decisions/0013-pg-to-lmdb-migration.md index f06738470..864238644 100644 --- a/docs/rewrite/decisions/0012-pg-to-lmdb-migration.md +++ b/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md @@ -1,4 +1,4 @@ -# ADR 0012: The Postgres-to-LMDB migration (job 029) +# ADR 0013: The Postgres-to-LMDB migration (job 029) - **Status:** accepted (job 029, Phase 2) - **Deciders:** the rewrite team, on the evidence in job 029's recon and spec