acted

package
v0.87.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package acted is the outcome ledger: which findings a human said they acted on, and when.

This is the missing half of the loop. The investigator produces findings; recovery detection notices when a metric comes back; and until this store there was no way to connect the two — "it recovered" and "you fixed it and THEN it recovered" are different sentences, and only the second one proves the tool changed what someone did with their week.

Deliberately tiny. One JSON file beside the event log, like the alert and webhook stores; an entry is a fingerprint, a timestamp, and an optional note. No states beyond "acted" — a workflow engine with open/in-progress/blocked is a project tracker, and the operator already has one of those. The single bit this records is the one bit nothing else can: a human read the finding and did something about it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Fingerprint string    `json:"fingerprint"`
	At          time.Time `json:"at"`
	Note        string    `json:"note,omitempty"`
}

Entry is one acted-on finding.

type Store

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

Store persists entries. Same shape and persistence discipline as the alert store.

func Open

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

Open loads or creates the ledger at path. An empty path is the demo convention shared by every sidecar store: fully in-memory, nothing written to disk — marks work for the session and vanish.

func (*Store) Get

func (s *Store) Get(fingerprint string) (Entry, bool)

Get returns the entry for a fingerprint, if a human acted on it.

func (*Store) Lookup

func (s *Store) Lookup() func(string) (time.Time, bool)

Lookup returns a snapshot function suitable for investigate.ApplyActed — a plain func so the investigate package needs no dependency on this one.

func (*Store) Mark

func (s *Store) Mark(fingerprint, note string) (Entry, error)

Mark records that the finding was acted on. Idempotent: marking twice keeps the FIRST timestamp, because "when did a human first act" is the number the verified-recovery line is computed from, and a re-click must not rewrite history.

Jump to

Keyboard shortcuts

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