From 12645a8f602b2962391fed7582cdadecaa56e887 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Tue, 4 Aug 2026 18:52:18 -0600 Subject: [PATCH] fixture(segment): pin the stream-record read-compat shape from the Python writer The Rust segment crate has to read stream records the current implementation wrote. A fixture generated from the new reader proves nothing, so this is captured by running the real writers against a disposable journal before any Rust reader exists. Two properties it exists to pin: the repaired-tail path writes explicit JSON nulls for host and platform, so the field type is optional rather than required; and a record carries type, which the conversion retires into kind, so read-compat has a subject. This is read-compat, not round-tripping. The new writer is not required to re-emit type, host or platform. --- core/fixtures/stream-record-readcompat.json | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 core/fixtures/stream-record-readcompat.json diff --git a/core/fixtures/stream-record-readcompat.json b/core/fixtures/stream-record-readcompat.json new file mode 100644 index 000000000..7329c89d5 --- /dev/null +++ b/core/fixtures/stream-record-readcompat.json @@ -0,0 +1,42 @@ +{ + "records": { + "import.apple.json": { + "created_at": 1785891124, + "host": null, + "last_day": "20260801", + "last_segment": "120000_60", + "name": "import.apple", + "platform": null, + "seq": 1, + "type": "import" + }, + "recovered.json": { + "created_at": 1785891124, + "host": null, + "last_day": "20260803", + "last_segment": "141000_240", + "name": "recovered", + "platform": null, + "seq": 7, + "type": "unknown" + }, + "workstation.json": { + "created_at": 1785891124, + "host": "workstation.local", + "last_day": "20260802", + "last_segment": "081500_180", + "name": "workstation", + "platform": "linux", + "seq": 3, + "type": "observer" + } + }, + "x-journal-contract": { + "captured_from": "the Python reference writer, before any Rust reader existed", + "file_kind": "stream_record", + "format_id": "journal-stream-record", + "note": "Read-compat fixture. The Rust writer is NOT required to re-emit `type`, `host` or `platform` -- `type` retires into `kind`. What is required is that these records load without loss and that an update preserves `created_at` and a monotonic `seq`.", + "reference_writer": "solstone.think.streams.update_stream", + "schema_owner": "solstone.think.streams" + } +} -- 2.51.2