Repository navigation
Description
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 usecode_cycle.resolve.effort, orhighwhen 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 todeep_coder, whose primary effort in this repository moves frommediumtohigh. Valid values arelow|medium|high|max; any other value is refused with an explicit error. The pin is applied at dispatch time and.code-cycle.ymlprofiles are not edited. If the CLI rejects a pinned effort (an explicitcode_cycle.resolve.effortor the defaulthigh), it is handled like amaxrejection: 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.effortcounts as an override: it pins that effort and disables the automatic escalation. Declaringprofiles.cheap_coderorprofiles.deep_coderis not an override. - Escalation.
maxapplies 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 withHUMAN_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 acceptmax, the fallback runs without dispatching. When the cache is absent, the model is not listed, or the executor is Claude, dispatch atmax. An explicit effort rejection by the CLI is classified with a new failure codeunsupported_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 andescalation_acceptance = rejectedis 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, andunsupported_effortis added toattempt_error_codeandreroute_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).
escalatedbecomes role-agnostic and its documented meaning is widened.escalation_finding_idsis a new validated list kind (REV-id pattern, no duplicates, bounded size, JSON-serialized).escalation_acceptanceis a token with the valuesaccepted|rejected|unsupported|unknown|not_applicable. No new effort fields are added: the dispatch's existingeffortfield records the effort requested, and a fallback after a rejection is a separate dispatch with its owneffort.escalation_finding_idsholds at most 16 IDs. On a resolve row,escalatedrecords the effort escalation without changing profile routing. Updatedocs/telemetry.mdanddocs/instrumentation.md. Old rows read asescalated=falsewith an empty list.escalated=truemeans the escalation policy was triggered, not that the final row ran atmax; the effort actually run is theeffortof 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.pyand its modules). Register thecode_cycle.resolveconfig key, document it indocs/configuration.mdanddocs/routing.md, and update the ladder prose ofcc-orchestratorandcc-orca-orchestratorto 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
maxon the target the previous resolve used, withescalated = true,escalation_finding_ids, andescalation_acceptancerecorded. - 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 orunsupported_effort) uses the fallback at its own effort; on a target that is already the fallback it runs without escalation and recordsrejected; 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_VERSIONbump and that old rows read asescalated=falsewith an empty list; fixtures come from recorded real CLI output).
Activity
[-]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[/+]