Routing and limits

Updated Jul 27, 2026

The workflow groups changed files into bounded finder evidence packs (buildFlexFinderPlan) of at most transactionMaxFiles files each, up to maxLunaFlexCalls packs. Each admitted pack is reviewed by the Luna Flex lane (gpt-5.6-luna, low reasoning by default, escalating to the pre-registered pi-luna-flex-medium medium-reasoning adapter when lunaReasoning is set to medium). Files beyond the maxLunaFlexCalls x transactionMaxFiles coverage window are not packed and are listed in metrics.truncatedFiles. Deterministic host code then deduplicates and severity-orders the resulting candidates and caps them at maxAuditCandidates; the surviving set goes to a single Terra Flex audit call (gpt-5.6-terra, medium reasoning) that returns one verdict per candidate. Findings that survive the audit are accepted; the rest are discarded with a reason.

The following optional limits are supported:

  • maxTasks: maximum planned finder tasks, default 8.
  • maxCandidates: maximum candidates kept after normalization, default 30.
  • maxFindings: maximum accepted findings in the final result, default 20.
  • maxAuditCandidates: maximum candidates sent to the single audit call, default 30; candidates beyond the cap are discarded with reason over_audit_cap.
  • maxLunaFlexCalls: maximum finder evidence packs, default 4.
  • transactionMaxFiles: maximum files per finder pack, default 5.
  • budgetGbp: hard per-review budget in GBP, default 0.10, converted to USD through the pricing table's usdPerGbp snapshot.
  • routingPolicy: recorded in metrics and the dry run; the only supported value is deterministic-flex-v1.
  • lunaReasoning: low (default) or medium, selecting the Luna escalation adapter.
  • flexAttempts, flexInitialBackoffSeconds, flexMaxBackoffSeconds, flexJitterSeconds, and perCallTimeoutSeconds: the Flex retry schedule (see "Retries, downgrades, and deferral" below).
  • transactionMaxInputTokens, transactionMaxOutputTokens, terraMaxInputTokens, terraMaxOutputTokens, and adapterOverheadTokens: token bounds feeding the cost estimator.

Example:

odw run workflows/dakar-review.js --source . --wait --timeout 3600 \
  --args '{"config":"examples/df12-code-review.yaml","base":"origin/main",
           "repoRoot":"/path/to/dakar","prepared":{"...":"see prepare output"},
           "maxTasks":4,"maxFindings":5}'