Files
turso/.aristo/canon-matches.toml
Sushant Dinesh e0d40b9d70 core/mvcc: annotate and instrument logical-log durability invariants
Capture the logical-log and MVCC crash-recovery durability invariants as
opt-in aristo-instr accessors a fault-injection conformance harness needs
to observe private LogicalLog state:

  logical_log_header_publish_after_fsync            write_header
  logical_log_inmemory_offset_advances_after_durable_write
                                                    advance_offset_after_success
  logical_log_pending_crc_cleared_on_abort          discard_pending_log_write
  logical_log_shadow_offset_matches_durable         Storage::truncate
  logical_log_truncate_crc_reseed_after_completion  LogicalLog::truncate
  mvcc_recovered_schema_record_wellformed           sqlite_schema_btree_identity
  mvcc_recovery_total_on_committed_log              recover_process_frame

The annotations are natural-language behavioral specs (five bind to the
aretta canon). The instrumentation — Inspect projections for
LogicalLog.header / pending_running_crc, a read_logicallog_offset_crc
accessor, and expose_pub(new_for_test) on LogRecord::new — lives behind a
new aristo-instr cargo feature, off by default, so production builds carry
zero instrumentation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 09:20:00 +00:00

436 lines
19 KiB
TOML

[__meta__]
schema_version = 1
canon_version = "v0.1.0"
last_fetched = "2026-07-10T07:09:09.697220051Z"
[aret_4mbjdhds]
last_match_text_hash = "sha256:9d400437abc7d933b5a5f93bdc8bef54c9f0dbc03d029683fd41dbfe40b5bc16"
canon_fetched_at = "2026-05-26T06:22:36.7271Z"
["aristos:wal_checkpoint_backfill_crash_atomic"]
last_match_text_hash = "sha256:964113cb0dc5eb70d66767acf6391b0a93398867ba7eabf81a7364058b6b8747"
canon_fetched_at = "2026-07-07T07:54:27Z"
[["aristos:wal_checkpoint_backfill_crash_atomic".accepted_matches]]
canon_id = "wal_checkpoint_backfill_crash_atomic"
version = "v0.1.0"
canonical_text = "Checkpoint backfill copies a log frame into the main database file only after that frame is durable in the log, so a crash can never recover a database torn between persisted backfill pages and dropped log frames"
canon_version = "v0.1.0"
confidence = 0.9763275354539468
prefix_tier = "aristos:"
backed_by = "model-derived crash-consistency differential test"
linked = "arta_e93bbba0b482550ba1a513e42a0c7c42"
accepted_at = "2026-07-07T07:54:27Z"
bound_at = "2026-07-07T07:54:27Z"
["aristos:wal_checkpoint_backfill_crash_atomic".accepted_matches.verification]
coverage_level = "partial"
test_binaries = []
["aristos:logical_log_header_publish_after_fsync"]
last_match_text_hash = "sha256:3f6afab40638b16a555ecf9684e49947a002d985a3885cd83421977479ccea61"
canon_fetched_at = "2026-07-10T07:09:58Z"
[["aristos:logical_log_header_publish_after_fsync".accepted_matches]]
canon_id = "logical_log_header_publish_after_fsync"
version = "v0.1.1"
canonical_text = "the in-memory log header is published only after the on-disk header pwrite has completed durably"
canon_version = "v0.1.0"
confidence = 0.9999995524555196
prefix_tier = "aristos:"
backed_by = "differentially tested against another implementation"
linked = "arta_cd4620222780dc449d3fa11b12ac9eea"
accepted_at = "2026-07-10T07:09:58Z"
bound_at = "2026-07-10T07:09:58Z"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification]
coverage_level = "informal"
test_binaries = ["c1_header_upgrade_failure"]
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation]
bundle_id = "turso:c193ae1:dc5694ef4986"
companions = []
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.provenance]
base_ref = "ad351877c5cf38c1fafc7f08703bfe521b8f4437"
payload_ref = "c193ae1768a0e7f3bb3d938dba60280d6b5bcd09"
macro_grammar_rev = "aristo-macros 0.3.0 (two-mode Inspect grammar)"
authored_at = "c193ae1768a0e7f3bb3d938dba60280d6b5bcd09"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.provenance.sut_binding]
turso_core = "core"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.compile_check]
package = "turso_core"
features = "aristo-instr,turso_core/aristo-instr"
[["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records]]
accessor_id = "inspect_header_version"
kind = "inspect_projection"
class = "A"
semantic_tier = "none"
intent = "Expose the in-memory logical-log header version so a verifier can observe header.version advancing (None -> Some(2)) across a failed header write."
catch = "Logical-log durability-or-intact under LogicalLogWriteHeader"
upstream_status = "local-only"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records.landing]
annotation = '#[cfg_attr(feature = "aristo-instr", inspect(ret = Option<u8>, with = |h| h.as_ref().map(|x| x.version), name = "header_version"))]'
ensure_derive = '#[cfg_attr(feature = "aristo-instr", derive(Inspect))]'
required_use = []
companions_ref = []
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records.landing.target]
container = "LogicalLog"
crate = "turso_core"
field = "header"
field_type = "Option<LogHeader>"
file = "core/mvcc/persistent_storage/logical_log.rs"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records.presence]
expected_symbol = "LogicalLog::inspect_header_version"
expected_signature = "fn inspect_header_version(&self) -> Option<u8>"
harness_probe = "let impl_header = log.inspect_header_version().map(|version| HeaderView {"
[["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records]]
accessor_id = "read_logicallog_offset_crc"
kind = "field_read"
class = "A"
semantic_tier = "none"
intent = "Read the logical-log write cursor and running CRC directly off the pub fields so a verifier can bound a torn write. These are ALWAYS-pub fields (present in clean upstream); they place nothing and are not the instrumentation gate — this row documents a coupling the routed tests read."
catch = "Logical-log durability-or-intact under LogicalLogWriteHeader"
upstream_status = "upstream"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records.landing]
required_use = []
companions_ref = []
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records.landing.target]
container = "LogicalLog"
crate = "turso_core"
field = [
"offset",
"running_crc",
]
field_type = "u64 / u32"
file = "core/mvcc/persistent_storage/logical_log.rs"
["aristos:logical_log_header_publish_after_fsync".accepted_matches.verification.instrumentation.records.presence]
expected_symbol = "LogicalLog::read_logicallog_offset_crc"
expected_signature = "fn read_logicallog_offset_crc(&self) -> u64 / u32"
["aristos:logical_log_inmemory_offset_advances_after_durable_write"]
last_match_text_hash = "sha256:69987375b5915574c5fada86beca138d461c413bba84b8c1e326418c6407a955"
canon_fetched_at = "2026-07-10T07:09:58Z"
[["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches]]
canon_id = "logical_log_inmemory_offset_advances_after_durable_write"
version = "v0.1.1"
canonical_text = "the in-memory log offset advances only after the corresponding frame pwrite has completed durably"
canon_version = "v0.1.0"
confidence = 1.0000000029926728
prefix_tier = "aristos:"
backed_by = "differentially tested against another implementation"
linked = "arta_51abd96d0aa4aed2b32b8292c2c453df"
accepted_at = "2026-07-10T07:09:58Z"
bound_at = "2026-07-10T07:09:58Z"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification]
coverage_level = "informal"
test_binaries = ["lwf_write_frame_failure"]
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation]
bundle_id = "turso:c193ae1:8568341f097a"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.provenance]
base_ref = "ad351877c5cf38c1fafc7f08703bfe521b8f4437"
payload_ref = "c193ae1768a0e7f3bb3d938dba60280d6b5bcd09"
macro_grammar_rev = "aristo-macros 0.3.0 (two-mode Inspect grammar)"
authored_at = "c193ae1768a0e7f3bb3d938dba60280d6b5bcd09"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.provenance.sut_binding]
turso_core = "core"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.compile_check]
package = "turso_core"
features = "aristo-instr,turso_core/aristo-instr"
[["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.companions]]
symbol = "LogRecord::new"
role = "delegate_method"
file = "core/mvcc/database/mod.rs"
visibility = "pub(crate)"
payload_ref = "c193ae17"
[["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records]]
accessor_id = "inspect_pending_running_crc"
kind = "inspect_clone"
class = "A"
semantic_tier = "none"
intent = "Clone the pending-running-CRC (deferred-offset write state) so a verifier can distinguish a torn write from a discarded one after a failed frame write."
catch = "Logical-log durability-or-intact under LogicalLogWriteFrame"
upstream_status = "local-only"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.landing]
annotation = '#[cfg_attr(feature = "aristo-instr", inspect(name = "pending_running_crc"))]'
ensure_derive = '#[cfg_attr(feature = "aristo-instr", derive(Inspect))]'
required_use = []
companions_ref = []
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.landing.target]
container = "LogicalLog"
crate = "turso_core"
field = "pending_running_crc"
field_type = "Option<u32>"
file = "core/mvcc/persistent_storage/logical_log.rs"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.presence]
expected_symbol = "LogicalLog::inspect_pending_running_crc"
expected_signature = "fn inspect_pending_running_crc(&self) -> Option<u32>"
harness_probe = "let observed_pending_running_crc = log.inspect_pending_running_crc();"
[["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records]]
accessor_id = "new_for_test"
kind = "hand_written_fn"
class = "A"
semantic_tier = "none"
intent = "Deterministic LogRecord constructor for MVCC recovery tests (pre-reserves LOG_HDR_SIZE + TX_HEADER_SIZE, op_count=0, has_header=false), delegating to LogRecord::new."
catch = "Logical-log durability-or-intact under LogicalLogWriteFrame"
upstream_status = "local-only"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.landing]
required_use = []
companions_ref = ["LogRecord::new"]
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.landing.target]
container = "LogRecord"
crate = "turso_core"
file = "core/mvcc/database/mod.rs"
method = "new_for_test"
signature = "fn new_for_test(tx_timestamp: TxID) -> Self"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.presence]
expected_symbol = "LogRecord::new_for_test"
expected_signature = "fn new_for_test(tx_timestamp: TxID) -> Self"
harness_probe = "let tx = LogRecord::new_for_test(0);"
[["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records]]
accessor_id = "read_logicallog_offset_crc"
kind = "field_read"
class = "A"
semantic_tier = "none"
intent = "Read the logical-log write cursor and running CRC directly off the pub fields so a verifier can bound a torn write. These are ALWAYS-pub fields (present in clean upstream); they place nothing and are not the instrumentation gate — this row documents a coupling the routed tests read."
catch = "Logical-log durability-or-intact under LogicalLogWriteFrame"
upstream_status = "upstream"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.landing]
required_use = []
companions_ref = []
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.landing.target]
container = "LogicalLog"
crate = "turso_core"
field = [
"offset",
"running_crc",
]
field_type = "u64 / u32"
file = "core/mvcc/persistent_storage/logical_log.rs"
["aristos:logical_log_inmemory_offset_advances_after_durable_write".accepted_matches.verification.instrumentation.records.presence]
expected_symbol = "LogicalLog::read_logicallog_offset_crc"
expected_signature = "fn read_logicallog_offset_crc(&self) -> u64 / u32"
["aristos:logical_log_shadow_offset_matches_durable"]
last_match_text_hash = "sha256:5a74c1a5142874836d6dfcf8557b1af99381f07c946d0caa45a4a05a6756a824"
canon_fetched_at = "2026-07-10T07:09:59Z"
[["aristos:logical_log_shadow_offset_matches_durable".accepted_matches]]
canon_id = "logical_log_shadow_offset_matches_durable"
version = "v0.1.0"
canonical_text = "the shadow offset tracking the log's durable boundary equals the durable offset at every quiescent boundary after a truncate"
canon_version = "v0.1.0"
confidence = 1.0000000030914833
prefix_tier = "aristos:"
backed_by = "differentially tested against another implementation"
linked = "arta_b45fe637d1b7c73d115ac9a0833dff83"
accepted_at = "2026-07-10T07:09:59Z"
bound_at = "2026-07-10T07:09:59Z"
["aristos:logical_log_shadow_offset_matches_durable".accepted_matches.verification]
coverage_level = "none"
test_binaries = []
["aristos:logical_log_truncate_crc_reseed_after_completion"]
last_match_text_hash = "sha256:207d5abc31d86f4e78320981e396e0a50fd6df12b9a9fb51a71c8d3b79e0bfd3"
canon_fetched_at = "2026-07-10T07:09:59Z"
[["aristos:logical_log_truncate_crc_reseed_after_completion".accepted_matches]]
canon_id = "logical_log_truncate_crc_reseed_after_completion"
version = "v0.1.0"
canonical_text = "the running CRC of the log is reseeded only after the truncate operation has completed durably"
canon_version = "v0.1.0"
confidence = 0.9999995376893536
prefix_tier = "aristos:"
backed_by = "differentially tested against another implementation"
linked = "arta_ca1e4e378b30acb57cc56d73fd0bcf86"
accepted_at = "2026-07-10T07:09:59Z"
bound_at = "2026-07-10T07:09:59Z"
["aristos:logical_log_truncate_crc_reseed_after_completion".accepted_matches.verification]
coverage_level = "none"
test_binaries = []
["aristos:wal_checkpoint_error_no_db_leak"]
last_match_text_hash = "sha256:99cf0a4664b81492fcaf3eaace7c7ab17a51261a6c340c7cad8faae4be7d45cc"
canon_fetched_at = "2026-05-30T06:00:12Z"
[["aristos:wal_checkpoint_error_no_db_leak".accepted_matches]]
canon_id = "wal_checkpoint_error_no_db_leak"
version = "v0.1.0"
canonical_text = """
A checkpoint failure must not leak frames into the main database file
"""
canon_version = "v0.1.0"
confidence = 0.982379848137498
prefix_tier = "aristos:"
backed_by = "golden model + proofs + differential testing"
linked = "arta_5cc2507abbafa1dcca819c702e32c824"
accepted_at = "2026-05-30T06:00:12Z"
bound_at = "2026-05-30T06:00:12Z"
["aristos:wal_commit_requires_fsync"]
last_match_text_hash = "sha256:eabb4e41b7add936f2f8679a208a15b4c545042d2644a7d920de7c6f767ff7c6"
canon_fetched_at = "2026-05-30T06:00:12Z"
[["aristos:wal_commit_requires_fsync".accepted_matches]]
canon_id = "wal_commit_requires_fsync"
version = "v0.1.0"
canonical_text = """
A commit frame must reach stable storage via fsync before the transaction is reported as durable
"""
canon_version = "v0.1.0"
confidence = 0.9738098997622728
prefix_tier = "aristos:"
backed_by = "golden model + proofs + differential testing"
linked = "arta_e376126754850310276ec5c621c3c717"
accepted_at = "2026-05-30T06:00:12Z"
bound_at = "2026-05-30T06:00:12Z"
["aristos:wal_find_frame_range_invariant"]
last_match_text_hash = "sha256:a6a6aabf707adfe418c11bc5ea417c1364c926f72ee5f05bd27b8b6aac7b34f5"
canon_fetched_at = "2026-05-30T05:43:56Z"
[["aristos:wal_find_frame_range_invariant".accepted_matches]]
canon_id = "wal_find_frame_range_invariant"
version = "v0.1.0"
canonical_text = """
find_frame never reads outside the live frame range [nbackfills, max_frame]
"""
canon_version = "v0.1.0"
confidence = 0.9851749204099178
prefix_tier = "aristos:"
backed_by = "golden model + proofs + differential testing"
linked = "arta_961fe492d27d1abdb6f6af1e6a38ac79"
accepted_at = "2026-05-30T05:43:56Z"
bound_at = "2026-05-30T05:43:56Z"
["aristos:wal_initialized_reflects_sync_outcome"]
last_match_text_hash = "sha256:9d400437abc7d933b5a5f93bdc8bef54c9f0dbc03d029683fd41dbfe40b5bc16"
canon_fetched_at = "2026-05-26T06:23:53Z"
[["aristos:wal_initialized_reflects_sync_outcome".accepted_matches]]
canon_id = "wal_initialized_reflects_sync_outcome"
version = "v0.1.0"
canonical_text = """
The WAL initialized flag is set true only after a successful sync of the wal-header
"""
canon_version = "v0.1.0"
confidence = 1.0000000000000002
prefix_tier = "aristos:"
backed_by = "golden model + proofs + differential testing"
accepted_at = "2026-05-26T06:23:53Z"
bound_at = "2026-05-26T06:23:53Z"
["aristos:wal_nbackfills_orders_with_recovery"]
last_match_text_hash = "sha256:7e7d1fd2ae298d6be58888acc49a0b7464f686bb0aa5725cf62e7459d3c59f42"
canon_fetched_at = "2026-05-30T06:00:12Z"
[["aristos:wal_nbackfills_orders_with_recovery".accepted_matches]]
canon_id = "wal_nbackfills_orders_with_recovery"
version = "v0.1.0"
canonical_text = """
The nbackfills counter advances after frames are durable, so recovery never replays already-checkpointed frames
"""
canon_version = "v0.1.0"
confidence = 0.9736252743750812
prefix_tier = "aristos:"
backed_by = "golden model + proofs + differential testing"
linked = "arta_40ceca467c64335d30ced059369d412f"
accepted_at = "2026-05-30T06:00:12Z"
bound_at = "2026-05-30T06:00:12Z"
["aristos:wal_truncate_atomic_under_concurrent_writers"]
last_match_text_hash = "sha256:3d260cf86a59e54d02ee3224cc3951b4c17aa0488e8be1109cf70e0912eef1ae"
canon_fetched_at = "2026-05-30T05:43:56Z"
[["aristos:wal_truncate_atomic_under_concurrent_writers".accepted_matches]]
canon_id = "wal_truncate_atomic_under_concurrent_writers"
version = "v0.1.0"
canonical_text = """
WAL truncate is atomic: no committed frame can be observed lost across the truncate operation
"""
canon_version = "v0.1.0"
confidence = 0.9876048462465404
prefix_tier = "aristos:"
backed_by = "golden model + proofs + differential testing"
linked = "arta_013316bc46e9af51cf52612fe2533e90"
accepted_at = "2026-05-30T05:43:56Z"
bound_at = "2026-05-30T05:43:56Z"
[savepoint_rollback_shape_and_bytes_consistent]
last_match_text_hash = "sha256:9eb52c41e3fcf89d2515efa52befc82509297ce3c657585352714afe61147e87"
canon_fetched_at = "2026-07-10T07:09:09.698962846Z"
[wal_checkpoint_backfill_crash_atomic]
last_match_text_hash = "sha256:964113cb0dc5eb70d66767acf6391b0a93398867ba7eabf81a7364058b6b8747"
canon_fetched_at = "2026-07-07T07:53:35.241472796Z"
[wal_checkpoint_error_no_db_leak]
last_match_text_hash = "sha256:99cf0a4664b81492fcaf3eaace7c7ab17a51261a6c340c7cad8faae4be7d45cc"
canon_fetched_at = "2026-05-30T06:00:12.360964Z"
[wal_commit_requires_fsync]
last_match_text_hash = "sha256:eabb4e41b7add936f2f8679a208a15b4c545042d2644a7d920de7c6f767ff7c6"
canon_fetched_at = "2026-05-30T06:00:12.360964Z"
[wal_find_frame_range_invariant]
last_match_text_hash = "sha256:a6a6aabf707adfe418c11bc5ea417c1364c926f72ee5f05bd27b8b6aac7b34f5"
canon_fetched_at = "2026-05-30T05:43:33.980749Z"
[wal_nbackfills_orders_with_recovery]
last_match_text_hash = "sha256:7e7d1fd2ae298d6be58888acc49a0b7464f686bb0aa5725cf62e7459d3c59f42"
canon_fetched_at = "2026-05-30T06:00:12.360964Z"
[wal_protocol_correctness]
last_match_text_hash = "sha256:9e70f3e012c13ec400044e473cb06d4935d943af34d40aa0e04d7acb7e3ada86"
canon_fetched_at = "2026-07-10T07:09:09.698962846Z"
[[wal_protocol_correctness.pending_matches]]
canon_id = "wal_protocol_correctness"
version = "v0.1.0"
canonical_text = "the WAL subsystem maintains LSN monotonicity, frame commitment ordering, recovery idempotency, checkpoint safety, and group-commit atomicity"
canon_version = "v0.1.0"
confidence = 0.9521647919254752
prefix_tier = "kanon:"
disposition = "open"
found_at = "2026-07-10T07:09:09.698962846Z"
found_by = "aristo canon refresh"
[wal_protocol_correctness.pending_matches.verification]
coverage_level = "none"
test_binaries = []
[wal_truncate_atomic_under_concurrent_writers]
last_match_text_hash = "sha256:3d260cf86a59e54d02ee3224cc3951b4c17aa0488e8be1109cf70e0912eef1ae"
canon_fetched_at = "2026-05-30T05:43:33.980749Z"