(opts BuildOptions, fileCount int)
| 33 | } |
| 34 | |
| 35 | func normalizeOptions(opts BuildOptions, fileCount int) BuildOptions { |
| 36 | if opts.BaseRef == "" { |
| 37 | opts.BaseRef = DefaultBaseRef |
| 38 | } |
| 39 | if opts.Since <= 0 { |
| 40 | opts.Since = DefaultSince |
| 41 | } |
| 42 | |
| 43 | budget := limits.HandoffBudgetForRepo(fileCount) |
| 44 | if opts.MaxChanged <= 0 { |
| 45 | opts.MaxChanged = budget.MaxChanged |
| 46 | } |
| 47 | if opts.MaxRisk <= 0 { |
| 48 | opts.MaxRisk = budget.MaxRisk |
| 49 | } |
| 50 | if opts.MaxEvents <= 0 { |
| 51 | opts.MaxEvents = budget.MaxEvents |
| 52 | } |
| 53 | if opts.MaxHubs <= 0 { |
| 54 | opts.MaxHubs = max(budget.MaxRisk, 8) |
| 55 | } |
| 56 | return opts |
| 57 | } |
| 58 | |
| 59 | // Build creates a multi-agent handoff artifact from git + daemon state. |
| 60 | func Build(root string, opts BuildOptions) (*Artifact, error) { |
no test coverage detected