Documentation
¶
Overview ¶
Package audit reports workflow-conformance findings over a branch's git history. It is advisory (ADR-0017): standalone, never wired into the gate. Most rules are pure over the commit range; the uncommitted-changes rule (ADR-0025) additionally inspects the live working tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
Hash string
Subject string
Body string
IsMerge bool
Changes []FileChange
}
Commit is a neutral view of one range commit. The rule engine reads only this.
type FileChange ¶
type FileChange struct {
Path string // repo-relative path (the new path; old path for a delete)
OldPath string // repo-relative pre-image path (differs only on rename)
Action Action
Added, Deleted int
OldText, NewText string
}
FileChange is one file touched by a commit. OldText/NewText are populated only for ".md" files (cheap; the rules need ADR frontmatter), empty otherwise.
type Finding ¶
type Finding struct {
Severity Severity
Rule string
Commit string // short hash, "" for a branch-level finding
Subject string
Detail string
}
Finding is one reported conformance issue.
type Inputs ¶
type Inputs struct {
Settings
GeneratedPaths map[string]bool
ADRDir string // e.g. "docs/decisions"
ActiveMd string // e.g. "docs/decisions/ACTIVE.md"
PlansDir string // e.g. "docs/plans"
ConfiguredDomains []string // config.Domains; staleness limited to these, undocumented-domain fires outside them
DomainsPartsDir string // e.g. ".awf/domains/parts"
}
Inputs are the resolved audit settings plus the project-derived layout the rules need. The embedded Settings carries the resolved knobs (BaseBranch, AllowedTypes, AllowedScopes, SubjectMaxLength, DependencyManifests, DiffThreshold, DomainDocStaleness, UndocumentedDomain, UncommittedChanges), promoted so the rules read in.AllowedTypes etc. directly.
type Settings ¶
type Settings struct {
BaseBranch string
AllowedTypes []string
AllowedScopes []string
DependencyManifests []string
SubjectMaxLength int
DiffThreshold int
DomainDocStaleness bool
UndocumentedDomain bool
UncommittedChanges bool
}
Settings is the resolved, default-applied audit configuration the rules consume.
func Resolve ¶
func Resolve(a *config.AuditConfig) Settings
Resolve resolves the effective audit settings from the raw config, applying defaults. A nil AuditConfig yields the full default set.