AUR-556: analysis findings count toward the policy gate
Design
internal/config.GateConfig.Sourcesis the closed list (skills,analysis,sast);ValidateSourcesruns inValidateat load time andSourceEnabledanswers which origins count (empty = all).- Precedence is the existing one for
gate: the central policy'sGatereplaces the repository's wholesale, so repositorysourcesnever apply under a policy. cmd/aurumcode/gate_sources.goholds the adapter:foldGateSources, called once byrunReviewandrunPRReviewright afterevaluateGate, folds the SAST decision (applySASTGate, unchanged, SAST issues withheld whensastis excluded) andapplyAnalysisGate.evaluateGateskips skill rules whenskillsis excluded; its signature is unchanged.- Analysis findings come from a fresh
analysis.Runner.Analyze(diff)plusconfig.ApplyRuleConfig, not fromresult.Issues, so a model reply can neither forge nor drop them. They honor AUR-520 exceptions. - Origin is named in the gate line (
origem analysis), therefore in the parecer, stderr and the audit record's reason. It is also a typed field: eachrender.AuditFindingcounted by the gate carriesOrigin(skills|analysis|sast, JSONorigin, omitted when empty), set where the finding is counted. The SARIF writer derives each result's origin fromBlockingFindingsand writes it asproperties.origin; the message has no origin suffix.gateDecision.FindingOriginsno longer exists.
Compatibility
No gate: no behavior change. Existing tests that declare a gate over a
fixture containing a hardcoded secret now pin sources: [skills] to keep
isolating the skill origin.
Corpus
tests/benchmark/out/multilang-report.* regenerated with -update-aur523:
approved-with-defect total 3 -> 1 (java 1 -> 0, python 1 -> 0); the remaining
one is the php case no rule detects; recall unchanged.
Limits
properties.origin and blocking_findings[].origin exist only for findings
the gate counted; non-blocking findings carry no origin.