types: unify all epoch timestamps to i64

All epoch timestamp fields (timestamp, last_replayed, created_at on
nodes; timestamp on relations) are now i64. Previously a mix of f64
and i64 which caused type seams and required unnecessary casts.

- Kill now_epoch() -> f64 and now_epoch_i64(), replace with single
  now_epoch() -> i64
- All formatting functions take i64
- new_node() sets created_at automatically
- journal-ts-migrate handles all nodes, with valid_range check to
  detect garbage from f64->i64 bit reinterpretation
- capnp schema: Float64 -> Int64 for all timestamp fields
This commit is contained in:
ProofOfConcept 2026-03-05 10:23:57 -05:00
parent b4bbafdf1c
commit 4747004b36
4 changed files with 232 additions and 56 deletions

View file

@ -10,7 +10,7 @@
struct ContentNode {
uuid @0 :Data; # 16 bytes, random
version @1 :UInt32; # monotonic per UUID, latest wins
timestamp @2 :Float64; # unix epoch
timestamp @2 :Int64; # unix epoch seconds
nodeType @3 :NodeType;
provenance @4 :Provenance;
key @5 :Text; # "identity.md#boundaries" human-readable
@ -29,11 +29,15 @@ struct ContentNode {
stateTag @16 :Text; # cognitive state (warm/open, bright/alert, etc.)
# Spaced repetition
lastReplayed @17 :Float64; # unix epoch
lastReplayed @17 :Int64; # unix epoch seconds
spacedRepetitionInterval @18 :UInt32; # days: 1, 3, 7, 14, 30
# Section ordering within a file
position @19 :UInt32; # 0 = file-level, 1+ = section index
# Stable creation timestamp (unix epoch seconds). Set once when the
# node is first created; never changes on rename or content update.
createdAt @20 :Int64;
}
enum NodeType {
@ -62,7 +66,7 @@ enum Category {
struct Relation {
uuid @0 :Data; # 16 bytes, random
version @1 :UInt32;
timestamp @2 :Float64; # unix epoch
timestamp @2 :Int64; # unix epoch seconds
source @3 :Data; # content node UUID
target @4 :Data; # content node UUID
relType @5 :RelationType;