Skip to content

docs(openspec): plan #3060 plan model tier ladder for retries - #3225

Merged
dan-petty merged 3 commits into
mainfrom
feat/3060-a-model-ladder-for-retries-with
Nov 2, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/3060-a-model-ladder-for-retries-with

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Plans #3060

Plan the model tier ladder of #3060. Each step class (plan, edit, repair, review) gets a list of tiers, one per attempt, in config. An attempt error whose failure action is change_tier advances the ladder without spending a repair round. The gateway's tier health is read before a choice, and the item record keeps token cost per tier under implement.spend. No hosted provider is called unless the ladder names one. The plan records the order against #3207 for maintainer prioritization.

Change: openspec/changes/3060-a-model-ladder-for-retries-with/

Copy link
Copy Markdown
Owner

Review of the plan for #3060.

CI: all 18 checks green or skipped at 9bd3618 (a docs-only diff). Premise: not confirmed. The Feasibility section checks that files exist, not the premise (finding 3). Checked against main at bc0434e.

  1. The trigger ignores the failure taxonomy of feat(roadmap): classify a failure and name its class in the stop #3195. The plan advances the ladder on "a provider error". On main, src/devops_cli/roadmap/failure.py:74-75 maps provider to retry and parser to change_tier; the spec roadmap-failure-taxonomy ("One default action for each class") says the same. The case that motivates feat(roadmap): a model ladder for retries, with the tier chosen per attempt #3060 (the Ollama XML 400 of chore(k8s): bump Ollama image for qwen3-coder parser fix #2953) is class parser, so its action is change_tier. The ladder is the way to carry out FailureAction.CHANGE_TIER, chosen by classify_failure. failure.py is in neither Reads nor Changes. left_action and failure_lines (failure.py:224-238) take only repair as the action taken, so a stop after a tier change would still list change_tier as the action left. Fix: key the move on the action, name failure.py, and add a scenario and a task for the stop text. [C3]

  2. test(roadmap): score the stage pipeline with a cloud model first #3207 parks this item and the plan does not say so. Open issue test(roadmap): score the stage pipeline with a cloud model first #3207 (Status New) says: "Park cost work until the baseline passes: feat(roadmap): cost and token budgets per item and per day #3066 (budgets), feat(roadmap): a model ladder for retries, with the tier chosen per attempt #3060 (ladder) and any new cap", and "a person sets priorities". feat(roadmap): a model ladder for retries, with the tier chosen per attempt #3060 says "Dependencies: None" and the proposal is silent. perf(roadmap): raise the soft caps and request timeouts of the jobs #3206 is closed (PR perf(roadmap): raise the soft caps and timeouts of the jobs #3223): the timeouts are settings now (roadmap.implement.request_timeout_seconds), and the plan does not say how a per-tier ladder meets them. Fix: state the order against test(roadmap): score the stage pipeline with a cloud model first #3207 in the proposal, and let a person decide if the plan goes on before the baseline. [C8]

  3. Feasibility does not test the premise. Its evidence is list_files output and one probe line that a path exists. The one cited source, docs/adr/0005-review-findings-come-from-tools-not-models.md, is about review findings and says nothing about retries or tiers. The last bullet is future tense ("The first checks ... are uv run devops ci test ..."). Not checked, and checkable on main:

    • Per-tier gateway health. _probe_gateway_http (src/devops_cli/ai/gateway.py:460-476) probes only /health/readiness and /health of the whole gateway. I found no per-group read.
    • The gateway already retries and falls back (k8s/llm/gateway/config.yaml:295 num_retries: 5, :311 devops-coder: [devops-reasoning, devops-chat]), so a provider error that reaches the step comes after these. devops-coder and devops-reasoning are the same qwen3-coder:30b on the same node (config.yaml:24-35), so the "stronger local tier" of the issue is not in the gateway. Only devops-chat (qwen3.8:27b) is another family.
      Fix: quote command output for these, and say what the client ladder adds over the router fallbacks. [C2]
  4. The plan misses where the model is chosen. The model and window are set once per job: get_task_model("implement") and window=load_settings().ai.for_task("implement").context_window (src/devops_cli/commands/roadmap.py:672-673; also :535), then apply_implement -> _ItemRun.model -> run_step -> build_agent(model, ..., window, ...) (implement_step.py:419-453). The output cap and the Agent depend on the window, and tiers differ in window (config.yaml:13-22, 262144 vs 160000). _attempt (implement_step.py:1172-1200) runs the extra turns of one Agent with one history. "Attempt" is not defined (the first run? an extra turn? a resend, CONST_ROADMAP_IMPLEMENT_MODEL_RESENDS?). Group 3 changes only implement_step.py. Fix: name commands/roadmap.py, ai/client/factory.py and build_agent, and define the attempt and the window per tier. [C3]

  5. The setting has no key, shape or variable, and the show requirement repeats an existing one. The design says "in the existing settings". The tasks do not say where. AITasksConfig has extra="forbid" and a fixed list of slots (settings.py:586-609); the classes plan/edit/repair/review have no slots, and the implement job has only a group step and a fix step. devops config show prints only keys from setting_variables() (commands/config.py:140-142) and config/env.py:_declared lists a field only with a Variable() marker, so a map of lists that is not declared would not print. The staging review found the same point. The existing requirement "devops config show lists every setting and every credential" (openspec/specs/config-commands/spec.md:266) already covers a declared setting; the ADDED requirement adds a rule about display of a map. Fix: give the key, the type, the variable and the display in group 1, and use MODIFIED or drop the delta. [C4]

  6. ADDED leaves contradicting requirements. roadmap-implement-step already says "A failed model call ends the step stopped" (spec line 403) and "An error of the generation inside a stream is sent again" (line 573); the new "A provider error moves to the next tier" conflicts with both. Existing names need MODIFIED with the whole text. [C4]

  7. Wrong capability, and the record is not named. ai-spend-pricing is about the spend ledger and prices. The per-item spend is implement.spend (store.py:199 ImplementRecordKey.SPEND, implement_run.py:325-332), kept by roadmap-implement-job (spec line 182: "The spend SHALL be the requests, input tokens and output tokens of every step"). That is a MODIFIED there. StepOutcome (implement_step.py:327-353) has no tier field, so group 5 must change implement_step.py; its Changes line lists only implement_run.py. [C4]

  8. Task order. Task 3.1 needs "the run record names both tiers", but group 5 builds that record, and group 3 does not change it. The staging review flagged this; the plan keeps it. [C5]

  9. The no-hosted-call criterion has no test, and SECURITY.md is not considered. The Criteria map it to group 1, which tests only the default value. No task asserts that no request reaches a hosted group, and "local" vs "hosted" is not defined by group name. SECURITY.md item 12 says "a request reaches a provider only when its caller names a hosted group", and tests/ai/benchmark/test_k8s_llm_gateway.py guards it. A ladder entry is a new place where a caller names one, so the prompt leaves the cluster and is billed. SECURITY.md is not in Reads or Changes. Fix: name the local groups for the default, add a test that refuses a hosted name unless set, and document the setting. [C8]

  10. Group 6 and the Impact paths are wrong. openspec/changes/3060-model-tier-ladder/... (6 paths in Impact and group 6) does not exist: the folder is 3060-a-model-ladder-for-retries-with/, and there are 0 files under the other name. Group 6 "Write the change documents" restates this PR as a task and checks only openspec check. Drop it. [C9]

  11. Rule 3 cost has no number. "Existing Tool Considered" lists what is built (the schema, the retry, the read, the record) but gives no tokens and no elapsed time (AGENTS.md rule 3). It says LiteLLM "covers fallback routing", but the repo's gateway is LiteLLM with fallbacks already (finding 3), and the text does not say what the client ladder keeps from it. [C6]

  12. Minor: the rejected alternatives cite no evidence. Each reads "The issue requires...". The openspec rule asks for the evidence that rejected the alternative, for example for the health cache. [C12, new: design rationale only restates the issue]

  13. Minor: task form. The five doc tasks read "docs/CONFIGURATION.md, run ..." with no verb; task 4 reads gateway.py but changes none; the health test sits in test_roadmap_implement_step_repair.py, which is the repair-round file. [C5]

Better than the earlier plans:

  • Every verify command is uv run devops ci test <path> or uv run devops ci docs, with a fail-on-base check on each test task, and the new tests sit in existing mirror files that exist.
  • ## Criteria is present and maps all four criteria to groups, and the title, body (569 chars, Plans #3060, Change:) pass the form.
  • The spec deltas use real capability names, and the requirement names are not on main (ADDED), apart from findings 5 to 7.

Related issues: #3207 (cloud baseline first, parks #3060 and #3066), #3066 (cost and token budgets), #3053 (bounded repair rounds), #2953 (Ollama parser bump, open), #3027 (tracker). #3195 and #3206 are closed and merged.

Verdict: hold until findings 1 to 4 and 6 to 10 are fixed, and a person decides the order against #3207.


Generated by Claude Code

@dan-petty

Copy link
Copy Markdown
Owner

Plan update for #3060 to address review findings (commit e29cf02):

  1. Failure taxonomy aligned: Keyed tier escalation on FailureAction.CHANGE_TIER (e.g. FailureClass.PARSER) from src/devops_cli/roadmap/failure.py. Updated failure.py stop comment functions (left_action, failure_lines) to record tier changes as actions taken.
  2. Order against test(roadmap): score the stage pipeline with a cloud model first #3207: Recorded in proposal.md that test(roadmap): score the stage pipeline with a cloud model first #3207 asks to park cost tuning until the cloud baseline passes. A person sets priorities, so the plan lets maintainers decide scheduling. Recorded timeout configuration (roadmap.implement.request_timeout_seconds).
  3. Feasibility tested against real system: Documented k8s/llm/gateway/config.yaml LiteLLM fallback chains and shared model deployments. Clarified that the client ladder resolves client-side semantic parser failures (FailureClass.PARSER) where LiteLLM retries cannot help.
  4. Model and window per attempt: Defined an attempt as one run with a specific tier. Named commands/roadmap.py, ai/client/factory.py, and build_agent for dynamic agent rebuilding per attempt.
  5. Setting key and display: Specified setting key roadmap.implement.ladder: dict[str, list[str]] with variable DEVOPS_CLI_ROADMAP_IMPLEMENT_LADDER. Removed redundant config-commands spec delta.
  6. Spec contradictions resolved: Replaced conflicting ADDED requirements in roadmap-implement-step with a MODIFIED requirement for A failed model call ends the step stopped. Kept all original scenarios.
  7. Capability corrected: Replaced ai-spend-pricing with roadmap-implement-job. Updated requirement The job record to itemize spend per tier under implement.spend. Added tier to StepOutcome.
  8. Task order resolved: Group 5 combines tier selection and per-tier spend recording. The replay test asserts both tiers in the run record without sequence conflicts.
  9. No hosted calls guarded: Cited SECURITY.md item 12. Default ladder lists local tiers only (devops-coder, devops-reasoning). Added test rejecting hosted model names unless configured.
  10. Removed nonexistent paths: Dropped artificial Group 6. Removed nonexistent openspec/changes/3060-model-tier-ladder/ paths from proposal.md.
  11. Rule 3 cost quantified: Stated cost to build, keep, and fix as 24,000 tokens and 3 hours. Documented comparison with LiteLLM gateway capabilities.
  12. Evidence for rejected alternatives: Cited technical evidence (context window mismatches, repeating XML 400 parser errors, missing per-group health endpoint, inability to audit per-tier spend) in design.md.
  13. Task form and test locations: Added active verbs to all documentation tasks. Scoped health check test to tests/ai/test_ai_gateway_probes.py.

@dan-petty
dan-petty merged commit 56c702a into main Nov 2, 2026
19 checks passed
@dan-petty
dan-petty deleted the feat/3060-a-model-ladder-for-retries-with branch November 2, 2026 21:07
dan-petty pushed a commit that referenced this pull request Nov 14, 2026
…5651)

Plans #3246

The stage context gives the planner the names of a capability's
requirements only, and the duplicate check compares names only (#3246).
A plan then adds a requirement whose name is new while a base
requirement states, or contradicts, the behavior: #3225, #3228 and #3234
each needed a modified block that the planner did not write. This change
adds the text of the matching base requirements to the plan request, cut
to 12 requirements and 6000 characters and ordered by relevance. The
prompt tells the planner to change a requirement that states the
behavior with modified. The review request carries the same text, so a
finding that quotes a stated requirement returns the plan, and a new
golden-set case replays the conflict of #3225.

Change: `openspec/changes/3246-add-requirement-text-to-the-stage/`

Co-authored-by: devops-cli-service[bot] <349441588+devops-cli-service[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant