journal

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package journal is the append-only, observability-only record of every event applied to a run: events.jsonl. It is never the source of truth for a run's current state (internal/sdlc/ledger's run.json is authoritative, per the plan's ledger-authoritative/journal-observability-only split) — engine.Apply's own determinism is what makes replaying this log a valid way to double-check or rebuild state, not something normal resume needs to do. journal deliberately knows nothing about internal/sdlc/engine's Effect or Event types: a caller encodes whatever it resolved into an Entry, so this package stays a plain, decoupled JSONL log.

Index

Constants

View Source
const FileName = "events.jsonl"

FileName is the journal's file name within a run's directory.

Variables

This section is empty.

Functions

func Append

func Append(dir string, entry Entry) error

Append writes entry as one line of <dir>/events.jsonl under an exclusive lock, so lines from concurrent goroutines and processes never interleave. A missing Timestamp is filled in as now (UTC, RFC3339).

func Path

func Path(dir string) string

Path is <dir>/events.jsonl.

Types

type Entry

type Entry struct {
	Timestamp string `json:"timestamp"`
	RunID     string `json:"runId"`
	NodeID    string `json:"nodeId"`
	// Kind names the event's shape (e.g. "WorkCompleted", "JevDecided"); the
	// caller's own vocabulary, not one journal defines or validates.
	Kind string `json:"kind"`
	// Detail is the event, encoded as JSON however the caller chooses.
	Detail json.RawMessage `json:"detail,omitempty"`
}

Entry is one events.jsonl line.

func ReadAll

func ReadAll(dir string) ([]Entry, error)

ReadAll returns every parseable entry in dir's events.jsonl, in file order. A missing file yields none; a blank or malformed line is skipped rather than failing the read, mirroring usage.ReadRecords — the journal is observability, so a single corrupt line must never make the rest of the history unreadable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL