Files
Willie adae3ee0de feat(audit): add Analyzer interface, registry, and pipeline refactoring
Introduce pluggable analyzer architecture for audit scanning:

- Analyzer interface with ID/Scope/Analyze contract
- AnalyzeContext union struct carrying inputs for file/skill/bundle scopes
- 7 analyzer wrappers: static, dataflow, tier, integrity, structure,
  markdownLink, cross-skill
- Registry with DefaultRegistry(), ForPolicy() filtering, and
  scope-based accessors (FileAnalyzers/SkillAnalyzers/BundleAnalyzers)
- Policy.EnabledAnalyzers allowlist (nil = all enabled, backward compat)
- scanSkillImpl refactored to use registry gates for file-scope and
  iterator loop for skill-scope analyzers
- ScanSkillFiltered / ScanSkillFilteredForProject public APIs

All existing tests, integration tests, and 60/60 red team assertions pass.
2026-03-03 16:08:11 +08:00

21 lines
607 B
Go

package audit
// dataflowAnalyzer wraps taint tracking for shell scripts and markdown code blocks.
type dataflowAnalyzer struct{}
func (a *dataflowAnalyzer) ID() string { return AnalyzerDataflow }
func (a *dataflowAnalyzer) Scope() AnalyzerScope { return ScopeFile }
func (a *dataflowAnalyzer) Analyze(ctx *AnalyzeContext) ([]Finding, error) {
if ctx.DisabledIDs[patternDataflowTaint] {
return nil, nil
}
if ctx.IsShell {
return ScanShellDataflow(ctx.Content, ctx.FileName), nil
}
if ctx.IsMarkdown {
return ScanMarkdownDataflow(ctx.Content, ctx.FileName), nil
}
return nil, nil
}