Expand description
Append-only change log and generation counter, so a poller notices a write without re-parsing every issues.org.
Two files sit beside the project directories:
.vault-events.gen, a monotonic counter; comparing it against the last value seen is the cheap change check..vault-events.jsonl, one event per line, read with asincesequence.
The names are fixed rather than derived from the product name: existing readers watch these paths, and renaming them would silence every poller.
Emission is best-effort and never fails a write. Set VISSUE_EVENTS=0 to
turn it off, for a caller that needs the tracker to stay
untouched.
Structs§
- Event
- One entry in the change log.
Enums§
- Terminal
Wait - Outcome of
wait_until_terminal.
Functions§
- emit_in
- Append one event and return the new sequence.
- emit_
issues_ write - Record that a project’s issues.org was rewritten. Called by the store after a successful write; failure here never fails the write.
- emit_
state_ change - kind=state_change, id=Some(id), detail=Some(“FROM->TO”), project set. NOT debounced (unlike issues_write).
- enabled
- Whether emission is enabled.
VISSUE_EVENTS=0disables it. - ensure_
gitignore_ hint - Add the event files to a
.gitignorethat already exists beside them. Best effort: a tracker without one is left alone. - events_
dir - The directory holding the event files: the same one holding the projects.
- gen_
path - Path of the generation counter file under
dir. - generation
- The current generation for this layout’s event directory.
- generation_
in - The current generation. A poller compares this against the last value it saw; a difference means something changed.
- log_
path - Path of the JSONL change log under
dir. - ping_
report - Append a manual event, waking pollers without touching an issues.org.
- since
- Events with a sequence above
since_seqfor this layout. - since_
filtered_ in - As
since_in, narrowed to a project, a kind, or both. - since_
in - Events with a sequence above
since_seq, most recent last. - since_
report - Text plus a trailing JSON block, the shape existing readers parse.
- tail_in
- The last
nevents in the log. - tail_
report - The last
nevents, for a reader that only wants what is recent. - wait_
generation - Block until the generation passes
last, or the timeout expires. Returns the generation either way; the caller compares it againstlastto tell which happened. Atimeout_msof 0 is a peek: it never sleeps. - wait_
until_ terminal - Poll the issue state. Re-read on generation change or poll interval. Missing id is an error (IssueNotFound).