Repository navigation
Description
Problem or Motivation
devops ai ask-jev and the MCP tool ai_ask_jev (src/devops_cli/ai/jev_ask.py) break five documented rules.
- No context. With no
--context, the code sends the question text as the state and also as the instructions (state = context if context.strip() else question,jev_ask.py:151). So Jev judges the question with no evidence and answers from its weights.- "A question written into the prompt is not lifted out: it is text to be judged, and it is judged." (https://pydantic.dev/docs/ai/models/decision/#asking-a-question)
- "Do not rely on knowledge stored in model weights when current information can come from your own knowledge base." (https://docs.typesafe.ai/concepts/how-to-build-with-system-one.md, 2. Decompose the input state)
- A coin flip reads as yes. The command prints
yeswhen p >= 0.50 (CONST_AI_JEV_DEFAULT_BOOLEAN_THRESHOLD,jev_ask.py:208), elseno. The skill tells agents that a value near 0.5 means that Jev does not know, but the answer field does not say it.- "Good starting thresholds are 0.7 and 0.3: above 0.7 reads as yes, below 0.3 as no. Give the band between 0.3 and 0.7 its own outcome in code rather than rounding it to one side." (https://docs.typesafe.ai/confidence, When to act on confidence)
- Characters, not bytes.
CONST_AI_JEV_ASK_MAX_INPUT_CHARScaps the input at 16,000 characters. With no--context, the question goes two times. Multibyte text can also go above 32,000 bytes.- Requests with "more than about 32,000 bytes of text ... run in TypeSafe's long-context mode, which TypeSafe says is slower and less accurate" (https://openrouter.ai/docs/guides/community/jev, FAQ)
- No timeout. The command sets no timeout, so the 3600 s default of the project HTTP client applies (
DEFAULT_HTTP_TIMEOUT_SECONDS). A call that hangs can stop an agent for one hour. The decision step and intake set 30 s. The gateway measured p95 0.40 s in about 3,373 Jev calls.- "timeout, extra_headers and extra_body are forwarded to the request" (https://pydantic.dev/docs/ai/models/system-one/#model-settings)
- One question for each call. The command sends one question, named
answer.- "put every independent question about the same state in one request. All questions in the request are answered in parallel and cannot see each other's answers." (https://openrouter.ai/docs/guides/community/jev-tutorial.md, FAQ)
- "Coding agents fall into the one question per request habit more than people do." (https://docs.typesafe.ai/primitives.md, Ask speculative questions)
Proposed Solution & Architectural Design
- Refuse a call with no
--context. Give a usage error that names the option, and make no request. Keep the plain-string state for one piece of text ("A string is suitable when the use case is simple and requires only one piece of text.", https://docs.typesafe.ai/concepts/state.md). - Print
unsurefor anoulanswer from 0.3 to 0.7. Put the two edges in constants. Stop the use ofCONST_AI_JEV_DEFAULT_BOOLEAN_THRESHOLDhere (refactor(ai): remove the Jev helpers that nothing calls #5276 deletes the inert bars). The output keeps the probability. - Count bytes. Count the UTF-8 bytes of the state and the questions against a budget of about 32,000 bytes. Refuse a larger request before the call, with a message that gives the count. Share the budget constant with fix(ai): set the Jev context window from the model data #5209.
- Set a short timeout, about 10 s, in the model settings of the call. A timeout gives a clear error and a non-zero exit code.
- Accept several questions about one context. Let
noultake more than one question in one call. Send them in one request, and print one answer for each question in the given order.choiceandscorekeep one question for each call, because their options belong to one question. - Update
.agents/skills/ask-jev/SKILL.mdand the help text for the new behavior.
Files: src/devops_cli/ai/jev_ask.py, src/devops_cli/ai/jev_ask_models.py, src/devops_cli/commands/ai.py, src/devops_cli/config/constants.py, src/devops_cli/lang/en/help.py, src/devops_cli/lang/en/messages.py, .agents/skills/ask-jev/SKILL.md, tests/ai/.
Target Subsystem
AI & Agentic Review Pipeline (src/devops_cli/ai/jev_ask.py, the command devops ai ask-jev and the MCP tool ai_ask_jev).
Existing Tool Considered
pydantic-ai SystemOneModel with ModelSettings(timeout=...), and several questions in one DecisionRequest (pinned 2.59.0). If #5282 merges first, the command uses the Agent path. No new tool. Cost: about 0.3M tokens and 2 hours.
Acceptance Criteria
- A test:
devops ai ask-jev noul "<question>"with no--contextexits with the usage-error code and makes no request. - A test with the
JevFaketransport: p = 0.55 printsunsure, p = 0.75 printsyes, p = 0.25 printsno. Each output holds the probability. - A test: a context under 16,000 characters but over the byte budget (multibyte text) is refused before a request.
- A test: the model settings of the call hold the timeout constant (about 10 s).
- A test: two
noulquestions about one context go in one request and print two answers in order.
Related
- refactor(ai): remove the Jev helpers that nothing calls #5276: deletes the inert global bars,
CONST_AI_JEV_DEFAULT_BOOLEAN_THRESHOLDamong them. - fix(ai): set the Jev context window from the model data #5209: the byte budget of about 32,000 bytes.
- refactor(ai): ask Jev through Agent output types #5282: the Agent path for the live calls.
- feat(roadmap): ask the verify screen one atomic question each #5281: the same question rules for the verify screen.
- chore(roadmap): track the decision model workflows #4408: the tracker of the decision model workflows.
Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: pydantic/pydantic-ai (https://github.com/pydantic/pydantic-ai), MIT, last activity 2026-11-28, maintained.
Reason: The pydantic-ai docs and facts confirm SystemOneModel forwards a ModelSettings timeout and sends several questions in one request, but refusing a no-context call, the unsure band and UTF-8 byte counting stay project code.
Covers:
- Forwards timeout in ModelSettings to the request
- Sends several questions in one DecisionRequest
- SystemOneModel is the decision-model class the project already uses
Lacks:
- No refusal of a call with no context
- No three-way unsure band for probabilities
- No UTF-8 byte budget for state and questions
Proposed design
Problem statement
Refuse a call with no context. Print unsure in the 0.3-0.7 band. Count UTF-8 bytes. Set a 10 s timeout. Let noul send several questions in one request. The current command sends the question as the state, rounds a coin flip to yes, caps characters, has no short timeout, and sends one question per request.
Acceptance criteria
Requirement: Refuse a call with no context
The ask-jev command and the ai_ask_jev tool SHALL refuse a call with no context before any request.
Scenario: A missing context is refused
- WHEN The test runs
devops ai ask-jev noul "Does this change touch only documents?"with no--context. - THEN The command exits with code 2 and the JevFake transport records no request.
Requirement: Print unsure in the middle band
A noul answer SHALL print unsure when its probability of yes is from 0.30 to 0.70 inclusive.
Scenario: A probability in the band prints unsure
- WHEN The test uses the JevFake transport to return p = 0.55, p = 0.75 and p = 0.25 for three noul calls.
- THEN The outputs are
unsure,yesandnoin that order, and each output holds its probability.
Requirement: Refuse a request over the UTF-8 byte budget
The ask-jev command and the ai_ask_jev tool SHALL refuse a request whose state and questions exceed 32,000 UTF-8 bytes before any request.
Scenario: Multibyte context over the byte budget is refused
- WHEN The test passes a context of fewer than 16,000 characters that holds multibyte text and is larger than 32,000 UTF-8 bytes.
- THEN The command exits with a validation error that gives the byte count, and the JevFake transport records no request.
Requirement: Set a short timeout
The ask-jev model settings SHALL set a 10 s timeout for each Jev call.
Scenario: The model settings hold the timeout
- WHEN The test builds the Jev model with the ask-jev settings.
- THEN The model settings hold a timeout of 10 s.
Requirement: Ask several noul questions in one request
The ask-jev command and the ai_ask_jev tool SHALL send more than one noul question about one context in one request and return one answer for each question in the given order.
Scenario: Two noul questions share one request
- WHEN The test calls
devops ai ask-jev noul "Q1" "Q2" --context "<text>"with the JevFake transport. - THEN The transport records one request with two questions, and the output holds two answers in the order Q1, Q2.
Requirement: Keep choice and score to one question
The choice and score kinds SHALL refuse more than one question in a call.
Scenario: Choice refuses a second question
- WHEN The test calls
devops ai ask-jev choice "Q1" "Q2" --option a=A --option b=B --context "<text>". - THEN The command exits with a usage error and the JevFake transport records no request.
Requirement: Show the new behavior in help
The ask-jev help text SHALL state that --context is required and that noul accepts several questions.
Scenario: Help shows the required context
- WHEN The test invokes
devops ai ask-jev --help. - THEN The help names
--contextas required and describes several noul questions.
Existing Tool Considered
pydantic-ai (https://pypi.org/project/pydantic-ai) is MIT and maintained. The alternatives check is in-use. The repository already uses it. It forwards timeout in ModelSettings and sends several questions in one request through one output type. It does not refuse a no-context call, give an unsure band or count UTF-8 bytes. Those parts stay project code. No new tool is needed. The written cost of the project logic is about 0.3M tokens and 2 hours.
Key questions
- Should a call with no context be refused or should the question become the state?: Refuse the call with a usage error before any request. The state must hold evidence. A question is not evidence. Keep the plain-string state for one piece of context. (best practice) [sources: src/devops_cli/ai/jev_ask.py]
- Chosen: Refuse no context. The model then judges evidence, not its weights, and the command follows the documented rule.
- Rejected: Use the question as the state. This is the current defect; Jev answers from its weights with no evidence.
- Which probability band prints
unsure?: Printunsurefor p from 0.30 to 0.70 inclusive. Printyesabove 0.70 andnobelow 0.30. Put the two edges in constants. (best practice) [sources: src/devops_cli/ai/jev_ask.py]- Chosen: Three-way band 0.30/0.70. The confidence guide says above 0.7 reads as yes and below 0.3 as no, and the band needs its own outcome.
- Rejected: Keep the 0.50 threshold. A coin flip then reads as yes and hides that Jev does not know.
- What budget and unit should the input check use?: Count UTF-8 bytes of the state and all questions against 32,000 bytes. Refuse a larger request before the call and give the byte count. Use one shared constant for fix(ai): set the Jev context window from the model data #5209. (best practice) [sources: src/devops_cli/ai/jev_ask.py, src/devops_cli/config/constants.py]
- Chosen: UTF-8 byte budget of 32,000. The Jev FAQ puts about 32,000 bytes at the long-context threshold, and multibyte text can exceed it under a character cap.
- Rejected: Keep 16,000 characters. The cap misses the byte size and the question can go twice when no context is set.
- What timeout should the ask-jev call use?: Set 10 s in the pydantic-ai
ModelSettingsof the call. A timeout gives a clear error and a non-zero exit code. (best practice) [sources: src/devops_cli/ai/jev_ask.py, src/devops_cli/config/defaults.py]- Chosen: 10 s in ModelSettings. The gateway p95 is 0.40 s, and 10 s bounds an agent wait without the 3600 s default.
- Rejected: Keep the 3600 s default. One hung call can stop an agent for one hour.
- How should several noul questions be named and returned in one request?: Use
answerfor one question andanswer_1toanswer_nfor several. Return oneJevAnswerfor each key in input order. Keepchoiceandscoreto one question. (best practice) [sources: src/devops_cli/ai/jev_ask.py]- Chosen: Numbered answer keys in one DecisionRequest. One request holds the questions, the keys stay stable, and the input order gives the output order.
- Rejected: One request for each question. The Jev tutorial says to put independent questions in one request, and agents overuse one question per request.
- Rejected: Use the question text as the key. Duplicate text collides and a long key copies the question into the request keys.
- How should the CLI and MCP output represent several answers?: Print one answer block for each question in input order. For
--json, return the existing single object for one question. Return a list ofJevAnswerobjects in input order for several questions. (best practice) [sources: src/devops_cli/ai/jev_ask_models.py, src/devops_cli/commands/ai.py]- Chosen: Single object for one, list for several. This keeps the current single-question output and gives a clear ordered result for several.
- Rejected: Always return an envelope with an answers list. This breaks the current single-question JSON and MCP output.
- Rejected: Write one JSON object per line. This is not one JSON document and is harder for an MCP client.
- Does this issue depend on fix(ai): set the Jev context window from the model data #5209 or refactor(ai): remove the Jev helpers that nothing calls #5276?: No. Define the shared byte budget constant here if fix(ai): set the Jev context window from the model data #5209 has not added it. Stop using
CONST_AI_JEV_DEFAULT_BOOLEAN_THRESHOLDhere so refactor(ai): remove the Jev helpers that nothing calls #5276 can delete it. Both changes stay in this pull request. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/ai/jev_ask.py]- Chosen: No dependency; add the constants here. The change can define the byte budget and the unsure edges now, and it removes the old threshold use.
- Rejected: Wait for fix(ai): set the Jev context window from the model data #5209 and refactor(ai): remove the Jev helpers that nothing calls #5276. The behavior does not need either item done first; both only touch the same constant file.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both work on the ask-jev command in jev_ask.py; #4306 delivers the feature, this candidate fixes five bugs in it.devops-cli-service commentedon Nov 16, 2026
Alternatives check: in-use
Reason: The searches found pydantic-ai, the decision-model client the issue already pins and uses (SystemOneModel). It already provides two of the five pieces the issue wants — a forwarded
timeoutin ModelSettings and several questions sent in one request via one output type — but it does not refuse a context-less call, give anunsureband, or count UTF-8 bytes, which stay project logic, so it covers only part.The repository already uses this tool.
Tool: pydantic-ai (https://pypi.org/project/pydantic-ai)
Covers:
timeout(andtemperature,extra_headers,extra_body) to the /v1/systemone request, so the short timeout can be set in the model settings of the callnoul-questions-in-one-call ruleLacks:
unsureoutcome: thresholds round a probability to yes/no, so the 0.3-0.7 band must be added in project codeTools considered:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at e6f5718 (see proposed design in issue body).
devops-cli-service commentedon Nov 28, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://pypi.org/project/pydantic-ai. A person decides what the new result means for the item.Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC