Documentation
¶
Overview ¶
Package projectbugaudit owns the area-bug-audit finding registry and the per-project bug-lane configuration. It is introduced in Phase 0 of the area-bug-detection-to-remediation pipeline; this file defines only the configuration surface and constants, with no runtime behavior, so it can ship behind feature flags before the registry (Phase 1) is wired.
Index ¶
Constants ¶
const ( DefaultMaxFindingsPerAudit = 10 MaxFindingsPerAuditCeiling = 50 )
Cap defaults and the hard ceiling for per-call MCP overrides. The default bounds confirmed high-confidence findings remediated per audit run; the ceiling is the maximum a caller may request via the MCP max_findings param. Anything above the ceiling is clamped, not rejected, so a fat-finger does not block the run. These are also re-exported indirectly through projectautomation (see MaxFindingsPerAudit handling in that package).
const ( ConfidenceFloorHigh = "high" ConfidenceFloorMedium = "medium" )
ConfidenceFloor values supported by BugAuditConfig.ConfidenceFloor. The floor gates which confirmed findings get auto-remediated: only findings whose projectconfidence band meets the floor are remediated. "high" is the safe default and matches the "100% confirmed, very high confidence" bar; "medium" loosens it per project. A per-call MCP override may only RAISE the floor, never lower it below the configured value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BugAuditConfig ¶
type BugAuditConfig struct {
// Enabled gates the area-bug-audit MCP entrypoint for this project. When
// false, run_area_bug_audit rejects early. Defaults false.
Enabled bool
// MaxFindingsPerAudit bounds confirmed high-confidence findings remediated
// per audit run. <=0 falls back to DefaultMaxFindingsPerAudit at use.
// Ignored if greater than MaxFindingsPerAuditCeiling (clamped at use).
MaxFindingsPerAudit int
// ConfidenceFloor is the minimum projectconfidence band required to
// auto-remediate a confirmed finding. Empty defaults to "high". A per-call
// override may only raise, never lower.
ConfidenceFloor string
// BranchPrefix is an optional bug-lane-specific branch prefix (e.g.
// "fix/bugs/"). Empty means use the project's general GitOps BranchPrefix.
// The resolved prefix flows into CreateRemediationFromFinding.GitBranchRef.
BranchPrefix string
// PRTitleTemplate optionally overrides the GitOps Conventions PR title
// template for bug-lane PRs. Empty means use the project Conventions.
PRTitleTemplate string
// TicketRef is an optional fake/real ticket ref attached to bug-lane PRs.
// Empty means no ticket ref. Must be a safe ref (validated in Validate).
TicketRef string
// TreatDraftPROpenAsResolved controls whether a finding flips to
// remediation_merged when its draft PR is merely open (true) vs only when
// the PR is actually merged on GitHub (false, the default). Keeping false
// means a re-run can warn "fix still in draft".
TreatDraftPROpenAsResolved bool
}
BugAuditConfig is the per-project bug-lane policy. It is additive: an empty config (the default) preserves existing branch/PR behavior, so no project is forced to opt in. Resolution of the effective branch prefix is resolveBugLaneBranchPrefix (Phase 1); this struct only carries the data.
func DefaultBugAuditConfig ¶
func DefaultBugAuditConfig() BugAuditConfig
DefaultBugAuditConfig returns the safe default policy: disabled, default cap, high confidence floor, no branch/PR overrides, draft-PR-open is NOT terminal.
func (BugAuditConfig) ResolveConfidenceFloor ¶
func (c BugAuditConfig) ResolveConfidenceFloor() string
ResolveConfidenceFloor returns the effective floor, defaulting to "high". Pure function.
func (BugAuditConfig) ResolveMaxFindings ¶
func (c BugAuditConfig) ResolveMaxFindings() int
ResolveMaxFindings returns the effective per-audit cap, applying the default when unset and clamping to the ceiling. Pure function; safe to call per run.
func (BugAuditConfig) Validate ¶
func (c BugAuditConfig) Validate() error
Validate returns an error if the config violates a hard rule. It does NOT mutate the receiver; clamp/normalize happens at use time via Resolve*.