audit

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package audit writes a structured, append-only JSONL trail of what the server asked the worker agents to do: which tasks started, the exact command lines executed, the tools the worker invoked, and how each turn ended.

It exists because a headless worker can touch real infrastructure with no human watching each step; the audit log is the after-the-fact record of what actually ran.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger appends JSONL audit records to a file. The zero value and a nil *Logger are both valid and disabled, so callers never need nil checks.

func New

func New(path string) (*Logger, error)

New opens (creating/appending) the audit log at path, creating the parent directory if needed. An empty path returns a disabled logger that discards everything.

func (*Logger) Close

func (l *Logger) Close() error

Close closes the underlying file.

func (*Logger) Enabled

func (l *Logger) Enabled() bool

Enabled reports whether records are actually written.

func (*Logger) Log

func (l *Logger) Log(event string, fields map[string]any)

Log writes one record: {"ts","event", ...fields}. It is safe for concurrent use and never panics on a disabled logger.

Jump to

Keyboard shortcuts

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