Skip to content

docs(openspec): plan #2742 Bound prewarm model label cardinality - #3163

Merged
dan-petty merged 4 commits into
mainfrom
fix/2742-bound-the-number-of-prewarm-model
Nov 2, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/2742-bound-the-number-of-prewarm-model

Conversation

@devops-cli-service

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

Copy link
Copy Markdown
Contributor

Plans #2742

The plan bounds the model label of devops_cli_ai_prewarms_total and the ai.model attribute of the ai.prewarm span to three kinds of value: ai.model, a model that a server of the run reports, and other. Without a bound, a calling model that sends 10000 names makes 10000 series (the SDK 1.45.1 has no limit; a run shows it). The plan asks each server that the run prewarms for its models, only for the provider ollama, because list_models() as the issue wrote it asks a server that --url does not name. It MODIFIES the requirement of the old label, changes 11 test cases, and adds the span requirement.

Change: openspec/changes/2742-bound-the-number-of-prewarm-model/

🤖 Generated with Claude Code

https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW

@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 2, 2026 06:04

Copy link
Copy Markdown
Owner

Review of the plan for #2742.

CI: all 18 checks pass or skip. Premise: it holds. trace_span("ai.prewarm", ...) sets "ai.model": str(target_model) raw (src/devops_cli/commands/ai.py:821-823), and the counter uses bounded_label(str(target_model)) (ai.py:850), which bounds characters and length only (telemetry/instruments.py:511). The PR base is 11dc347, not the current main (ac16675); ai.py and instruments.py do not differ between them.

  1. The plan contradicts an existing requirement and an existing test. openspec/specs/ai-prewarm/spec.md:50 says the model label holds the model with unsafe characters replaced, and its scenarios say gemma4:26b gives gemma4:26b and the symbol name gives my/model__v2_.0_beta. TestPrewarmCounterModelLabel (tests/ai/mcp/test_ai_prewarm.py:615-643) runs ai prewarm --model <m> --single-node for 5 models and expects the cleaned name. After this change, a model that is neither settings.ai.model nor in list_models() becomes other. The delta uses ADDED and leaves the old requirement, so two requirements disagree, and no task changes that test. Fix: MODIFIED for the existing requirement (keep the character and length clause as the inner bound), update its scenarios, and change the parametrized test. Not verified: whether ModelFake reports those models or even has list_models (the test file does not mention it).

  2. The new test file is in the wrong place. Tasks put the tests in new tests/test_ai_prewarm_cardinality.py. docs/TESTING.md:205 says a new test joins the file that already tests the behavior, which is tests/ai/mcp/test_ai_prewarm.py (it already has the otlp collector and the AI_PREWARMS_TOTAL points). Fix the Reads, Changes and Impact lists.

  3. Test-first proof is weak. Task 1.1 calls bounded_model_label directly, so on the base the test fails by ImportError and proves nothing about behavior. Drive the CLI as the existing tests do, assert other, and cite the run of devops ci fail-to-pass --base origin/main (commands/ci.py:2514).

  4. The design leaves out facts the code shows.

    • The client is created inside the span and request_priority_scope(AS_AVAILABLE) (ai.py:814-830). "Create the client before the span and call list_models()" adds a request on a path that had none, outside that priority scope unless placed inside. Say where.
    • list_models() (ai/client/unified.py:1124-1131) depends on the provider: ollama uses _ollama_models(), copilot/openai/gateway use _openai_models(), any other provider returns the configured model. It takes no URLs, so with --url or --all-nodes the list may not come from the servers being prewarmed. The spec says "the models that the configured servers report". Check this against _resolve_prewarm_urls and _ollama_models. Not verified here.
    • The dry-run path (ai.py:790-805) does not emit, so it needs no change. Good.
  5. Feasibility is not evidence. "The inputs show ..." quotes no output, the 10000-series premise is not shown, and the two "real-system checks" are commands listed, not run. The config rule asks for command output with its version. Existing Tool Considered says OpenTelemetry "does not bound the number of label values". Not verified: the OpenTelemetry metrics specification defines a cardinality limit with an overflow series, so check the Python SDK before you write this. The cost "about 300 tokens ... under one hour" does not fit a helper, two call sites, spec changes and the changes to existing tests (point 1).

Related issues: none found by search other than #2742 itself. #2676 (archived at openspec/changes/archive/2026-10-30-2676-prewarm-output-server-labels) is the change that created the requirement and test in point 1.

Verdict: hold until the delta is MODIFIED with the existing test and scenarios changed, the tests move into tests/ai/mcp/test_ai_prewarm.py, and Feasibility has real output.


Generated by Claude Code

Check the premise with a run, ask the servers of the run for their models
with a new `urls` argument, MODIFY the existing label requirement, move
the tests into `tests/ai/mcp/test_ai_prewarm.py`, and give the cost of the
change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW
@dan-petty
dan-petty merged commit 70cf298 into main Nov 2, 2026
20 checks passed
@dan-petty
dan-petty deleted the fix/2742-bound-the-number-of-prewarm-model branch November 2, 2026 17:18
dan-petty added a commit that referenced this pull request Nov 14, 2026
…ve (#5576)

Plans #3257

Staged designs restate the issue and give no reason for the chosen
design, and in #3163 and #3168 the missing alternative hid a wrong
premise. The stage check refuses a plan that states a decision and gives
no rejected alternative, and refuses an alternative whose evidence is
only an opinion. A fact is a path and line, a quoted command output or a
number. The planner prompt, the design rule and the verification prompt
state the rule, and the golden set holds a case of pull request 3168.
The rule lives in `content_problems` of the stage check, so the stage
job and the replay judge a plan with one rule set.

Change: `openspec/changes/3257-require-a-rejected-alternative-with-a/`

---------

Co-authored-by: devops-cli-service[bot] <349441588+devops-cli-service[bot]@users.noreply.github.com>
Co-authored-by: Daniel Petty <[email protected]>
dan-petty added a commit that referenced this pull request Nov 23, 2026
Issue #3257: a staged design often restates the issue and gives no
reason for the chosen design, and in #3163 and #3168 the missing
alternative hid a wrong premise. The stage check refuses a decision with
no rejected alternative and an alternative whose evidence is only an
opinion, before the implementation starts.

Closes #3257

Change:
`openspec/changes/archive/2026-11-23-3257-require-a-rejected-alternative-with-a/`

`uv run devops roadmap eval stage --replay`:
before: 86 of 323 (27%)
after: 87 of 324 (27%)
Base eval score: 86 of 323 (27%)
Head eval score: 87 of 324 (27%)
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.

2 participants