Repository navigation
Description
Part of #5164 (child 6).
Problem or Motivation
TypeSafe Jev answers the decision points of the roadmap jobs (ADR 0019, ADR 0020) and devops ai ask-jev. A Jev error, a timeout or a reply that does not parse makes the step fail open to the existing path (roadmap/decision_step.py). The counter devops_cli_roadmap_decision_step_total has the labels band, mode and step, and no label for a failed request. So no measure gives the share of Jev requests that end with a decision, and Jev gets no grade (#5164).
Proposed Solution & Architectural Design
- Add the job
jevto the result line. - Attempt: one decision request of a decision point or of
ask-jev. - Results:
decided,failed_open(error, timeout or a reply that does not parse). Intended result:decided. - First pass: decided on the first request (
retries= 0). - Names:
point(the decision point orask-jev),answer(the band or the option, never text). Counts:retries, and the attempt counts of the result line. itemis the item of the decision point, ornone.- The agreement of Jev with labelled cases stays in
devops roadmap eval jevand the shadow report. The grade report shows the last score next to the grade.
Target Subsystem
AI & Agentic Review Pipeline (src/devops_cli/ai/jev.py, src/devops_cli/ai/jev_ask.py, src/devops_cli/roadmap/decision_step.py).
Existing Tool Considered
The decision step counter exists and does not count failures. The line uses the writer of the roadmap jobs; no new tool. Cost: about 150,000 tokens, 4 hours elapsed.
Acceptance Criteria
- A decision with a fake Jev writes one line with
result=decided first_pass=true. - A timeout writes
result=failed_openwith the classtimeout. - No line holds the text of a question or an answer.
Dependencies
Alternatives check of 2026-11-28: none.
Tool: none found.
Reason: Searches found only generic structured-logging and LLM-observability platforms (structlog, Langfuse), which do not write the project's roadmap job result: line, derive first-pass from its tables, or feed the Loki grade report; the change extends the existing log_job_result writer.
Lacks:
- No writer of the project's
roadmap job result:line format - No first_pass derivation from the SUCCESS_RESULTS and FIRST_PASS tables
- No feed into the Loki query or
devops roadmap eval gradesrow - A hosted or self-hosted service added for one counter
Proposed design
Problem statement
TypeSafe Jev answers the decision points of the roadmap jobs and devops ai ask-jev. A Jev error, a timeout or a reply that does not parse fails open to the existing path. No result line records the attempt, so the Jev job gets no grade. This change writes one jev job result line for each request. Then devops roadmap eval grades gives the Jev job a grade.
Acceptance criteria
Requirement: Jev result line for a decision point
A decision point SHALL write one jev job result line for each Jev request, with result=decided or result=failed_open, and with the class, first_pass, point, item, answer and retries fields.
Scenario: A decided request writes one line
- WHEN A fake Jev model returns a valid answer for point
stage.verify_screenon item 5171, and the test callsResolverChain.decide. - THEN Exactly one captured line has
job=jev,result=decided,success=true,first_pass=true,class=none,point=stage.verify_screen,item=#5171,answerequal to the band of the cuts, andretries=0.
Requirement: A timeout is failed_open
A Jev request that times out SHALL write result=failed_open with class=timeout, answer=none and first_pass=false, and SHALL leave the decision to the fallback.
Scenario: A timeout writes one failed_open line
- WHEN A fake Jev model raises
TimeoutErrorfor pointstage.verify_screenon item 5171, and the test callsResolverChain.decide. - THEN The captured line has
job=jev,result=failed_open,class=timeout,answer=none,success=falseandfirst_pass=false, and the returned record hasresolver=fallback.
Requirement: A model error uses provider
A Jev request that raises ModelAPIError SHALL write result=failed_open with class=provider and infra=true.
Scenario: A model error writes provider
- WHEN A fake Jev model raises
ModelAPIError, and the test callsResolverChain.decide. - THEN The captured line has
result=failed_open,class=providerandinfra=true.
Requirement: An unparseable reply uses parser
A reply that gives no band SHALL write result=failed_open with class=parser.
Scenario: A missing answer writes parser
- WHEN A fake Jev model returns a response with no answer for a question of the cuts, and the test calls
ResolverChain.decide. - THEN The captured line has
result=failed_openandclass=parser.
Requirement: Ask-jev result line
ask_jev SHALL write one jev result line for each request with point=ask-jev, item=none, repo=none, and the chosen option or score as answer.
Scenario: An ask-jev choice writes one line
- WHEN A fake Jev model returns option
reviewtoask_jevwith a choice question, and the test callsask_jev. - THEN One captured line has
job=jev,point=ask-jev,item=none,repo=none,result=decided,first_pass=trueandanswer=review.
Requirement: No question or answer text
A jev result line MUST NOT contain the text of a question, an option description or a free-form answer.
Scenario: Question text is absent from the line
- WHEN A test calls
ask_jevwith the question textprivate question text, and a fake Jev model returns a valid option, and the test captures the result line. - THEN The captured line does not contain
private question text, and itsanswerfield is the option label only.
Requirement: The grade report lists the Jev job
devops roadmap eval grades SHALL list one row for the jev job with the grade of its result lines.
Scenario: The report has a Jev row
- WHEN A test renders the grade report from a fake Loki answer with one
jevresult line. - THEN The report has a
jevrow with the gradetoo few.
Existing Tool Considered
The alternatives check of 2026-11-19 in the issue body returned none, with no tool; its block lists the tools that it considered and what each one lacks. No open, maintained tool writes the project's roadmap job result: line, derives first-pass from its tables, or feeds the Loki grade report. The change extends the project writer log_job_result in src/devops_cli/roadmap/job_result.py, which the Loki query and devops roadmap eval grades already read. The change adds RoadmapJob.JEV with its SUCCESS_RESULTS, FIRST_PASS and FIRST_PASS_LIMITS rows and the call sites, so the line reaches the existing grade report and keeps answer in a closed set. Written cost: about 150,000 tokens and 4 hours elapsed.
Key questions
- Which writer emits the
jevresult line?: The shared writerlog_job_resultofsrc/devops_cli/roadmap/job_result.py. The change addsRoadmapJob.JEVwith itsSUCCESS_RESULTS,FIRST_PASSandFIRST_PASS_LIMITSrows. No new logger. (best practice) [sources: src/devops_cli/roadmap/job_result.py, src/devops_cli/roadmap/job_result.py:269, CONTEXT.md]- Chosen: Existing roadmap result-line writer. CONTEXT.md requires one result line for each roadmap step through the shared writer. The Loki query and the grade report already parse that format.
- Rejected: New Jev-only logger. It duplicates the result-line format. The grade report would not read its lines.
- Which values name the result and the failure class?:
resultisdecidedorfailed_open.classis aFailureClassofsrc/devops_cli/roadmap/failure.py:timeoutfor a timeout,providerfor a model error,parserfor a reply that gives no band, andci_infrafor any other error. (best practice) [sources: src/devops_cli/roadmap/failure.py:67, docs/roadmap/job-success.md, src/devops_cli/roadmap/decision_step.py:75]- Chosen: Result-line taxonomy of roadmap/failure.py. docs/roadmap/job-success.md defines the line's
classas a class of roadmap/failure.py. - Rejected: The decision-step FailureClass. Its
model_error,secretandno_cutsvalues are labels of the decision-point counter. The grade report readsclassfrom the result line.
- Chosen: Result-line taxonomy of roadmap/failure.py. docs/roadmap/job-success.md defines the line's
- Where does the code write the line?: In
ResolverChain._resolveand_aresolve, around the onedecide_alloradecide_allrequest, and inask_jev, arounddecide_with_jev. Not indecide_all, which also serves the eval batch and does not know the band. (best practice) [sources: src/devops_cli/roadmap/decision_point.py:358, src/devops_cli/roadmap/decision_point.py:374, src/devops_cli/ai/jev_ask.py]- Chosen: ResolverChain and ask_jev. The chain computes the band in
_bandedand the failure class in_failed.ask_jevreturns the typed option. - Rejected: Inside decide_all or adecide_all.
decide_allhas no cuts and no band. The screen eval calls it with a batch that must not count as job attempts.
- Chosen: ResolverChain and ask_jev. The chain computes the band in
- What does
itemhold forask-jev?:none.log_job_resultwritesitem=nonefor aNoneitem, andask-jevhas no roadmap item. The line also writesrepo=none, because the command has no repository in scope. [sources: src/devops_cli/roadmap/job_result.py] - How does the line avoid question and answer text?:
answeris theBandvalue for a decision point andJevAnswer.answerforask-jev. The line never writesDecisionRequest.state, the question instructions or a free-form reply.log_job_resultalso replaces a value outside[A-Za-z0-9_.-]withother. (best practice) [sources: src/devops_cli/roadmap/decision_step.py:54, src/devops_cli/ai/jev_ask_models.py:23, src/devops_cli/roadmap/job_result.py]- Chosen: Band or typed option label. Both values come from closed sets and carry no free text.
- Rejected: Raw model response. It can hold the question or a free-form answer.
- Does the decision-step counter need a change?: No. The counter that the issue names,
devops_cli_roadmap_decision_step_total, was replaced bydevops_cli_decision_point_total, anddevops_cli_decision_point_failed_totalalready counts a failed request by class. The result line is the new measure, because it gives the attemptfirst_passandinfrafor the grade. [sources: docs/TELEMETRY.md, docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md] - How does
first_passbecome true for a decided request?: AddRoadmapJob.JEVtoSUCCESS_RESULTSwithdecided, and toFIRST_PASSandFIRST_PASS_LIMITSwithCountLimit("retries", 0). The line writescounts={"retries": 0}, so a decided first request hasfirst_pass=true. (best practice) [sources: src/devops_cli/roadmap/job_result.py:123, src/devops_cli/roadmap/job_result.py:155, src/devops_cli/roadmap/job_grade_report.py]- Chosen: Add the count rule to both first-pass tables. The line derives
first_passfromFIRST_PASS. The report recomputes it fromFIRST_PASS_LIMITS. - Rejected: Write first_pass only as a literal field. The field is derived from the tables. A literal would not change the report's first-pass count.
- Chosen: Add the count rule to both first-pass tables. The line derives
- Which repository does the line name?:
none. A decision point andask-jevhave no repository in scope, andlog_job_resultwritesrepo=nonefor an empty repo. (best practice) [sources: src/devops_cli/roadmap/job_result.py]- Chosen: Write repo=none. The chain and
ask_jevhold no repository. The writer already defines the value for that case. - Rejected: Add a repo argument to every caller. No source names a repository for a decision point or
ask-jev. It would change every caller for no measured gain.
- Chosen: Write repo=none. The chain and
- Does the grade report show the last Jev score in this change?: No.
devops roadmap eval jevprints a comparison and stores no score. The shadow report gives per-field ratios and no single number. This change gives thejevrow its grade from the new result lines. The last score is a separate issue, filed as a deferred part. (best practice) [sources: src/devops_cli/roadmap/jev_eval.py, src/devops_cli/roadmap/jev_shadow_report.py, src/devops_cli/roadmap/job_grade_report.py]- Chosen: Defer the last score. No stored Jev score exists, so the report has no value to show.
- Rejected: Define a score in this change. It needs a stored record and a rule for the number. That is a separate change.
- Does
ask_jevreturn a typed answer with a closed option or score?: Yes._typed_answerreturns aJevAnswerwhoseansweris the choice label,yesorno, or the score string. [sources: src/devops_cli/ai/jev_ask_models.py:23, src/devops_cli/ai/jev_ask.py] - Does
decision_step.pyalready classify a failed request?: Yes.failure_classmaps each error todecision_step.FailureClassfor the decision-point counter. The result line uses theroadmap/failure.pytaxonomy instead, as the result-line contract requires. [sources: src/devops_cli/roadmap/decision_step.py:75, docs/roadmap/job-success.md]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both concern Jev decision model work in the roadmap, but #4408 is a tracker document while this candidate adds a concrete result-line job for Jev outcomes.devops-cli-service commentedon Nov 17, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
chore(main): release 0.243.0 (#7673)
devops-cli-service commentedon Nov 29, 2026
Released in v0.243.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.243.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 03:13 UTC