Expand description
log — the append-only, month-rotating chronological log.
One logical timeline: the active log.md at the store root plus
log/<YYYY-MM>.md archives. Log::append rolls older months into
archives on write so the active file stays current-month. Log::tail and
Log::since reverse-read from EOF. Both read each file they touch in
full — the on-disk order is not guaranteed monotonic, so neither can
early-stop within a file — and select by timestamp: tail keeps the n
newest, since keeps everything newer than the cutoff. Both cross into
month archives only as far back as the requested window reaches (by the
cutoff’s month for since, by the current nth-newest’s month for tail)
— never the whole history.
Append-only contract: there is no rewrite API. Corrective entries go on the
end; out-of-order timestamps are a validate warning (LOG_OUT_OF_ORDER),
signalling a probable rewrite.
Structs§
- Log
- The store’s chronological log: a thin handle for the append-only timeline.
All methods take the
Storeso they resolve the activelog.mdand thelog/archives under the store root. - LogEntry
- One parsed
log.mdentry: a header (## [YYYY-MM-DD HH:MM] <kind> | <object>) plus its body.
Enums§
- LogKind
- A recognized
log.mdentry kind. Custom kinds are valid in the format (dbmd validatewarns on unrecognized viaLOG_UNKNOWN_KIND); this enum carries the recognized vocabulary plus aLogKind::Customcatch-all so an unknown kind round-trips without loss.