journal

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package journal implements the SpecScore activity journal: an append-only, date-sharded event store plus on-demand day/week/month summary rollups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveStream

func ResolveStream(repoRoot string) string

ResolveStream resolves the journal `stream` for a source repo at write time (Phase 1): the git origin org, lowercased, when the origin is parseable; otherwise the lowercased basename of the repo directory. Every event gets a populated stream even with no user configuration. Phase 2 (an explicit journal.stream config value, or an explicit null opt-out) layers on top of this and is gated on the layered-config Feature.

Types

type Event

type Event struct {
	Type         string
	Timestamp    time.Time
	MachineID    string
	SourceRepo   string
	SourceOrigin string // omitted from the record when empty
	Stream       string
	Data         map[string]any // omitted from the record when nil
}

Event is one journal record. The flat fields are ingitdb `--where`-friendly; Data carries the type-specific payload verbatim.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the inGitDB-backed journal event store. The SpecScore CLI is the only writer of journal records (per the journal-and-summary Feature).

func Open

func Open(journalPath string) (*Store, error)

Open opens (creating if absent) the inGitDB journal at journalPath and ensures the events collection exists. Idempotent across runs.

func (*Store) Write

func (s *Store) Write(ctx context.Context, e Event, shortUUID string) error

Write persists one event as a single date-sharded record. shortUUID disambiguates same-instant writes from the same machine.

Jump to

Keyboard shortcuts

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