Documentation
¶
Overview ¶
Package audit writes the append-only, hash-chained audit log.
Every action writes an intent line before it runs and a result line after, sharing one id. Lines go to <state>/audit/YYYY-MM.jsonl. Each line carries "prev", the sha256 of the previous line's bytes (across month files), so an edited or deleted line breaks the chain and ReadAll reports where.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
TS string `json:"ts"`
ID string `json:"id"`
Phase string `json:"phase"` // intent | result | event
Action string `json:"action"`
Project string `json:"project,omitempty"`
Remote string `json:"remote,omitempty"`
Cwd string `json:"cwd,omitempty"`
Argv []string `json:"argv,omitempty"`
Trigger string `json:"trigger,omitempty"`
Outcome string `json:"outcome,omitempty"` // ok | failed | cancelled
ExitCode *int `json:"exit_code,omitempty"`
DurationMS *int64 `json:"duration_ms,omitempty"`
Details map[string]any `json:"details,omitempty"`
Error string `json:"error,omitempty"`
AppVersion string `json:"app_version"`
Prev string `json:"prev"`
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.