Expand description
Ticket discussion notes — .kranz/tickets/<slug>.notes.jsonl (D-BW-3,
adopted from beads’ flat {author, text, created_at} comment model).
One JSON object per line — {ts, author, text} — appended only: there is
no edit or delete, mirroring the event log’s honesty posture. Notes are
the ticket-scoped “why” channel the frontmatter (structured) and body
(authored once) cannot carry; they are COMMITTED artifacts (same class as
the ticket .md itself — see AGENTS.md’s tracked-vs-runtime list), not
gitignored runtime state.
Durability follows the crate::event_log idiom: open O_APPEND (creating
on first append), one write_all of the full line, flush, fsync. Appends
are clock-stamped at write time; file order IS chronological order, so
reads never re-sort.
Structs§
- Ticket
Note - One note on a ticket. Field order is the on-disk key order (
ts,author,text); additive-only like every persisted shape here.
Constants§
- MAX_
DRAFT_ NOTES - How many notes
draft_contextfolds into the drafter’s seed — the most recent N, so a long discussion cannot blow up the prompt.
Functions§
- append_
note - Append one note to a ticket’s discussion, creating the sidecar on first
append.
authoris supplied by the caller (the CLI resolvesKRANZ_NOTE_AUTHOR→operator);textis trimmed, scrubbed (the file is committed — the same posture as text the engine writes into ticket bodies), and must not be empty. Returns the stored note. - draft_
context - The markdown section
crate::draft::drive_draftappends to the drafter’s seed: the most recentMAX_DRAFT_NOTESnotes as bullets, with an omission marker when older ones were capped.Nonewhen the ticket has no notes (the seed is then exactly the folded ticket, as before). - read_
notes - Read every note in file order (== chronological order, oldest first). A
missing sidecar is the normal “no notes yet” case and reads as empty. A
malformed line is an
EngineError::Confignaming the file and line — notes are a committed, tool-maintained record, so corruption is surfaced for repair rather than silently skipped.