audit

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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