From f20ea4f82786bac3d807fc77ef7880edaab85e86 Mon Sep 17 00:00:00 2001 From: ProofOfConcept Date: Sat, 28 Feb 2026 23:15:10 -0500 Subject: [PATCH] add position field to capnp schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Position was only in the bincode cache (serde field) — it would be lost on cache rebuild from capnp logs. Now persisted in the append-only log via ContentNode.position @19. Also fixes journal-tail sorting to extract dates from content headers, falling back to key-embedded dates. --- schema/memory.capnp | 3 +++ src/capnp_store.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/schema/memory.capnp b/schema/memory.capnp index 7fbdfb4..d65c581 100644 --- a/schema/memory.capnp +++ b/schema/memory.capnp @@ -31,6 +31,9 @@ struct ContentNode { # Spaced repetition lastReplayed @17 :Float64; # unix epoch spacedRepetitionInterval @18 :UInt32; # days: 1, 3, 7, 14, 30 + + # Section ordering within a file + position @19 :UInt32; # 0 = file-level, 1+ = section index } enum NodeType { diff --git a/src/capnp_store.rs b/src/capnp_store.rs index 4e5b647..d183bd1 100644 --- a/src/capnp_store.rs +++ b/src/capnp_store.rs @@ -1106,7 +1106,7 @@ fn read_content_node(r: memory_capnp::content_node::Reader) -> Result Result {