For the detailed code-path explanation, read Loop Engineering.
High-level flow:
CLI
-> buildContextPackage()
-> scanRepository()
-> indexRepository()
-> buildDependencyGraph()
-> rankFiles()
-> assessReadiness()
-> writeContextPackage()Harness-led flow:
orchestrate()
-> task run
-> executor adapter
-> trace normalizer
-> guard reports
-> guard gates
-> decision reportKey source areas:
src/core/: scan, index, graph, rank, token, freshness.src/harness/: control plane, verification plane, observability.src/outputs/: artifact rendering and compatibility wrappers.src/mcp/: stdio MCP server.src/retrievers/: static, ripgrep, hybrid, CodeGraph, external provider protocols.