{"modulePath":"github.com/codefit-cli/codefit","version":"v0.2.6","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pipeline\n\nPackage pipeline defines the filtering pyramid (PRD section 15): cheap layers run first and only what they cannot conclude is escalated to the next, more expensive layer. Layer 0 (change filter), 1 (regex) and 2 (AST) are all that codefit runs — MCP-first, codefit never reaches a layer-3 LLM; the agent reasons over the mapped surface with its own model.\n\n[Pipeline](#Pipeline) runs its [LayerProcessor](#LayerProcessor) tiers in [FilterLayer](#FilterLayer) order, threading each layer's escalated files into the next. The concrete layer implementations arrive with the sensors.\n\nStatus: INERT. Built and tested, but not yet wired to any consumer. The MCP orchestrator will use it in Fase 1; kept in the core per PRD section 15.\n\n## Types\n\n```go\ntype FilterLayer int\n```\nFilterLayer identifies a tier of the filtering pyramid, ordered from cheapest (0) to most expensive (2). Cheaper layers run first and only what they cannot conclude is escalated to the next (PRD section 15). codefit never goes past layer 2: it produces deterministic findings and maps surface; the agent does the layer-3 reasoning over the surface with its own LLM.\n\n```go\nconst (\n\tLayerChanges  FilterLayer = 0 // unchanged files (via --since or cache hash)\n\tLayerPatterns FilterLayer = 1 // regex / obvious patterns\n\tLayerAST      FilterLayer = 2 // AST: deterministic findings + surface mapping\n)\n```\n\n```go\ntype LayerProcessor interface {\n\tLayer() FilterLayer\n\tProcess(files []string, ctx auditctx.AuditContext) (PipelineResult, error)\n}\n```\nLayerProcessor is one tier of the pyramid.\n\n```go\ntype Pipeline struct {\n\tLayers []LayerProcessor\n}\n```\nPipeline orchestrates the layers in order, threading each layer's escalated files into the next.\n\n```go\nfunc (p *Pipeline) Run(files []string, ctx auditctx.AuditContext) ([]findings.Finding, error)\n```\nRun executes the pipeline and returns the aggregated findings.\n\n```go\ntype PipelineResult struct {\n\tPassedToNextLayer []string\n\tFindings          []findings.Finding\n}\n```\nPipelineResult is what a layer returns: the findings it concluded and the files/fragments it escalates to the next layer.\n\n","path":"github.com/codefit-cli/codefit/internal/core/pipeline","name":"pipeline","synopsis":"Package pipeline defines the filtering pyramid (PRD section 15): cheap layers run first and only what they cannot conclude is escalated to the next, more expensive layer.","isRedistributable":true}
