Documentation
¶
Overview ¶
Package audit — completion auditor that verifies agent output.
After the agent claims "done," the auditor compares pre-task and post-task state to detect lazy/incomplete work:
- Were files actually modified that were supposed to change?
- Do plan items marked "complete" have corresponding file changes?
- Do build + tests still pass?
- Did the diff show the claimed behavior change?
The auditor can optionally spawn a read-only sub-agent with read-only file/search/git tools to cross-check claims against reality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auditor ¶
type Auditor struct {
WorkDir string // repo root
SubAgent SubAgentRunner // optional — spawns read-only verification sub-agent
// contains filtered or unexported fields
}
Auditor runs completion verification.
func (*Auditor) Audit ¶
Audit runs the full verification pass, comparing pre to post state against what the agent claimed.
func (*Auditor) AuditCaptured ¶
type CheckResult ¶
type CheckResult struct {
Language string `json:"language"`
Kind string `json:"kind"`
Directory string `json:"directory"`
Command []string `json:"command,omitempty"`
Status string `json:"status"`
Output string `json:"output,omitempty"`
}
CheckResult records the actual command and scope behind a verification. An absent runner/script is unavailable, never evidence of a passing build.
type Claim ¶
type Claim struct {
Description string `json:"description"` // e.g. "Added error handling to auth.go"
Files []string `json:"files"` // files that should have changed
TestsPass bool `json:"tests_pass"` // agent claims tests pass
BuildPass bool `json:"build_pass"` // agent claims build passes
}
Claim is something the agent asserts it accomplished.
type Finding ¶
type Finding struct {
Severity string `json:"severity"` // "ok", "warn", "fail"
Claim string `json:"claim"`
Expected string `json:"expected"`
Actual string `json:"actual"`
Evidence string `json:"evidence"` // grep output, diff snippet, etc.
}
Finding is a single discrepancy the auditor discovered.
type Report ¶
type Report struct {
Passed bool `json:"passed"`
Findings []Finding `json:"findings"`
PreSHA string `json:"pre_sha"`
PostSHA string `json:"post_sha"`
DiffStat string `json:"diff_stat"`
BuildOK bool `json:"build_ok"`
TestsOK bool `json:"tests_ok"`
Duration string `json:"duration"`
Checks []CheckResult `json:"checks"`
}
Report is the full audit result.
func (*Report) ToRevisionPrompt ¶
ToRevisionPrompt converts audit findings into a prompt the agent can use to fix its lazy/incomplete work. Returns empty string if all pass.
type Snapshot ¶
type Snapshot struct {
Time time.Time `json:"time"`
GitSHA string `json:"git_sha"`
GitDiff string `json:"git_diff"` // "git diff --stat" output
Files map[string]string `json:"files"` // path → sha256 (only tracked files in scope)
Dirty bool `json:"dirty"` // working tree had uncommitted changes
}
Snapshot captures repo state before/after a task.
type SubAgentRunner ¶
SubAgentRunner is the minimal interface for spawning a verification sub-agent. The wiring layer provides this (e.g., delegate to Hermes sub-agent or OpenAI).