Routing and limits

Updated Oct 12, 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, high reasoning by default since the 2026-08-13 Flex repricing, de-escalating to the pre-registered pi-luna-flex-medium or pi-luna-flex adapters when lunaReasoning is set to medium or low). 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, high 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.15, 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: high (default), medium, or low; medium and low select the pre-registered Luna de-escalation adapters.
  • 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}'