Documentation
¶
Overview ¶
Package dbg provides formatted debug output for the audit and review pipelines. When disabled, all methods are no-ops so debug-instrumented code paths stay zero-cost in production.
Index ¶
- type Writer
- func (d *Writer) Enabled() bool
- func (d *Writer) Phase(name string)
- func (d *Writer) Prompt(systemPrompt string, userMessage string)
- func (d *Writer) Response(raw string)
- func (d *Writer) Section(name string)
- func (d *Writer) Separator()
- func (d *Writer) SetOutput(w io.Writer)
- func (d *Writer) SetVerbose(verbose bool)
- func (d *Writer) Text(format string, args ...any)
- func (d *Writer) Verbose() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer handles formatted debug output. Zero value is invalid; use New.
func New ¶
New creates a debug writer. If enabled is false, all output is suppressed. Output goes to stderr by default; use SetOutput to redirect to a file.
Compact mode is on by default. Setting the PRR_DEBUG_VERBOSE environment variable (to any non-empty value) makes the writer verbose at construction — useful for one-shot debug runs without touching code.
func (*Writer) Enabled ¶
Enabled reports whether debug output is active. Useful for callers that want to skip expensive formatting work entirely.
func (*Writer) Prompt ¶
Prompt prints an LLM prompt. In compact mode (default) the system prompt is skipped entirely — it's static .md content reprinted on every LLM call and adds 100+ lines of noise per call. Only the User Message is printed, with embedded `=== <path> ===` file-content blocks collapsed to header-only.
In verbose mode (SetVerbose(true) or PRR_DEBUG_VERBOSE env var) the full system prompt is included and file blocks pass through verbatim — useful when debugging prompt content specifically.
func (*Writer) SetVerbose ¶
SetVerbose toggles compact (false, default) vs verbose (true) mode. See the Writer doc comment for what each mode includes.