Skip to content

refactor(F0): run resolve at high effort by default and escalate to max after a finding's first survival #175

Closed

Description

@datacas

Phase: Phase 0: stop the cycle from halting on runtime failures
Order: F0-4

Part of the cycle-time refactor plan. Baseline from local telemetry (42 cycles, 84 dispatches, 2026-09-24 to 2026-10-06): 5/42 cycles reached READY_FOR_MANUAL_MERGE without stopping; 21 stopped on technical runtime failures (12 dispatch_failed, 9 stage_not_completed); a resolve round on gpt-6-luna max takes 55 min at the median (n = 12). Issue #120 took about 10.5 h of wall time.

max effort on every resolve round multiplies its duration, and no measured quality gain justifies the cost. Median resolve duration: 55 min on gpt-6-luna max (n = 12) against 33 min on gpt-6-luna high (n = 9), on different issues.

Scope

  • Resolve keeps its profile selection (cheap_coder / deep_coder). Primary resolve dispatches use code_cycle.resolve.effort, or high when it is absent, regardless of the effort the profile declares. Fallbacks, including one chosen at routing time, keep their own configured effort and do not count as primary. The pin applies as written to deep_coder, whose primary effort in this repository moves from medium to high. Valid values are low|medium|high|max; any other value is refused with an explicit error. The pin is applied at dispatch time and .code-cycle.yml profiles are not edited. If the CLI rejects a pinned effort (an explicit code_cycle.resolve.effort or the default high), it is handled like a max rejection: the fallback runs at its own configured effort, or the stage is blocked when the rejected target is the primary with no fallback. Implementation routing does not change in this issue.
  • Only the explicit presence of code_cycle.resolve.effort counts as an override: it pins that effort and disables the automatic escalation. Declaring profiles.cheap_coder or profiles.deep_coder is not an override.
  • Escalation. max applies to resolve rounds dispatched while at least one finding has survived a claimed fix once and is still open, on the target the previous resolve actually used (the fallback, when the previous resolve ran on a fallback after a reroute). A second survival still stops the cycle with HUMAN_INTERVENTION; refactor(F0): keep claimed-fix history across resumed runs #179 covers resumed runs only.
  • Acceptance of max. When a pre-dispatch check exists (the Codex local models cache) and confirms the model does not accept max, the fallback runs without dispatching. When the cache is absent, the model is not listed, or the executor is Claude, dispatch at max. An explicit effort rejection by the CLI is classified with a new failure code unsupported_effort; the classifier is conservative, so an unknown error is never classified as a rejection. The fallback then runs at its own configured effort. When the rejected target is already the profile's fallback (after a reroute), it runs at its configured effort without escalation and escalation_acceptance = rejected is recorded. The stage is blocked only when the rejected target is the primary and the profile declares no fallback. A rejection does not consume the single reroute, and unsupported_effort is added to attempt_error_code and reroute_error_code. A rejection does not count as a failed attempt to fix the finding, and the original CLI output is kept for diagnosis. Detection is tested with representative real output fixtures from Codex and Claude.
  • Telemetry (schema 17). escalated becomes role-agnostic and its documented meaning is widened. escalation_finding_ids is a new validated list kind (REV-id pattern, no duplicates, bounded size, JSON-serialized). escalation_acceptance is a token with the values accepted|rejected|unsupported|unknown|not_applicable. No new effort fields are added: the dispatch's existing effort field records the effort requested, and a fallback after a rejection is a separate dispatch with its own effort. escalation_finding_ids holds at most 16 IDs. On a resolve row, escalated records the effort escalation without changing profile routing. Update docs/telemetry.md and docs/instrumentation.md. Old rows read as escalated=false with an empty list. escalated=true means the escalation policy was triggered, not that the final row ran at max; the effort actually run is the effort of each row. A rejection is not counted as a second fix of the finding. Rejection paths are recorded as follows (fallback row = the dispatch that runs after the refusal):
Situation escalated escalation_finding_ids escalation_acceptance
No escalation false [] not_applicable
Dispatch at max accepted (with or without a pre-check) true the IDs accepted
Pre-check confirms the model does not accept max; the fallback runs without a max dispatch true the IDs unsupported
The CLI rejects max (unsupported_effort): the rejected attempt row and the fallback row true the IDs rejected
Rejection on a target that is already the fallback: retry at its configured effort, without escalating true the IDs rejected
The outcome cannot be determined (the dispatch ends with no evidence of acceptance or rejection) true the IDs unknown

The absence of a pre-check does not produce unknown: a dispatch at max that the CLI accepts is accepted.

  • Where. The policy lives only in the runtime (run_cycle.py and its modules). Register the code_cycle.resolve config key, document it in docs/configuration.md and docs/routing.md, and update the ladder prose of cc-orchestrator and cc-orca-orchestrator to say the policy belongs to the runtime, without reimplementing it.

Acceptance criteria

  • A default resolve dispatch runs at high, even when the profile declares another effort.
  • After a finding's first survival, the next resolve runs at max on the target the previous resolve used, with escalated = true, escalation_finding_ids, and escalation_acceptance recorded.
  • The escalation continues while that finding stays open and does not apply once no once-survived finding is open.
  • With an explicit code_cycle.resolve.effort, that effort is used and no escalation happens; an invalid value is refused.
  • A rejection of max (pre-check or unsupported_effort) uses the fallback at its own effort; on a target that is already the fallback it runs without escalation and records rejected; it blocks only for a primary with no fallback.
  • Tests cover default, escalation, persistence (the escalation continues while the finding stays open and stops when none remains), explicit override, invalid value, rejection with Codex and Claude fixtures, and the migration to schema 17 (the test asserts the SCHEMA_VERSION bump and that old rows read as escalated=false with an empty list; fixtures come from recorded real CLI output).

Activity

  1. added
    enhancement
    refactor
    on Oct 7, 2026
  2. changed the title [-]refactor(F0): run resolve at high effort by default and escalate to max only after a second survival[/-] [+]refactor(F0): run resolve at high effort by default and escalate to max after a finding's first survival[/+] on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions