Repository navigation
fix(tools/typed-decision): send documented requests to the Jev API - #2023
Conversation
onlyarnav
left a comment
There was a problem hiding this comment.
LGTM! thanks for catching and fixing the mismatch with the live Typespace System One API.
I didnt cross-check the system against an actual JEV API, while finalizing, which is where I missed it. Really appreciate your help!
potiuk
left a comment
There was a problem hiding this comment.
The rewrite to the documented System One request and response shape looks correct and well tested; before this merges, the three open threads from @onlyarnav need an answer — above all whether the dict form of criteria for choice is documented — and there are two small points on score levels below.
Smaller observations
- See inline comments on
tools/typed-decision/src/typed_decision/providers/jev.py:380,tools/typed-decision/src/typed_decision/providers/jev.py:412.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The findings
below are observations, not blockers; an Apache Magpie
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.More on how Apache Magpie handles maintainer review:
Contributing guide.
Why: every JevProvider call failed with HTTP 400. It sent operation, prompt, options and scale, while POST /v1/systemone requires model, state and questions, and it read answers from the wrong place in the response. The pinned systemone-2026-06-01 is also not a documented model. Mocks in the same invented shape kept the tests green, and the fail-open contract would have left the pr-triage pre-filter logging fell_through. Send one typed question per call with the prompt as state, read the typed answer under answers, and pin jev-1.14.0. score sends at most 10 numeric levels, the API's cap, and maps the returned position back onto the requested scale. The public contract does not change. Generated-by: Claude Code (Opus 5.5)
Score level labels were formatted with six significant digits, so scales such as (1000000, 1000004) or (0.9999999, 1.0) sent identical labels to the Jev API. Labels now keep 15 significant digits, and a scale whose labels would still collide is rejected with TypedDecisionUnavailable before any request is sent. An out-of-range level position now reports the position, the valid range and the scale. The tool docs say score levels are bare numbers, so prompts must define what high and low mean. A test is renamed to match what it covers. Generated-by: Claude Code (Sonnet 5.5)
66ff7fb to
c265ab5
Compare
potiuk
left a comment
There was a problem hiding this comment.
Approving: the rewrite matches the documented System One request and response shape, and the follow-up commit addresses everything raised — score labels stay distinct (and collide-proof scales are rejected before any request), the out-of-range message names the level position and the scale, the tool docs say score levels are bare numbers, and the test is renamed. The one open question, the dict form of criteria for choice, is confirmed by the API's OpenAPI schema (answered in the thread). Thanks for catching the mismatch and verifying it against the live API!
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
Brings the specs up to main bfc99bb (37 commits since 1e5c4f9), ahead of the next dev-version bump: - security-issue-lifecycle: the import renders the report as defanged markdown under a data note, with `description_format: inert` as the fenced alternative (#2048). - adapters: oauth-draft threading by explicit In-Reply-To / References (#2051); the typed-decision Jev request shape (#2023). - adoption-and-setup, marketplace-distribution, codex-runtime: the setup sub-action is `update`, and every skill offers the upgrade until it has run (#2041); the most specific `sandbox.enabled` wins (#2011); the family MCP allows cover single-item reads only (#2020). - agent-isolation-sandbox: bare `gh auth status` only (#2019); draft creation and whole-mailbox search stay prompted (#2020). - pr-management-family: the CI gate's way out for a non-required check (#2029); the adversarial export keeps export-ignore paths (#2030); install.md per family (#2031); merge-candidates / thread-mentor names (#2025). - contributor-growth: the candidate-screen committer / PMC headline (#2024). - issue-management-family, repo-health-family: install.md (#2031). - project-agnosticism: the merge-candidates example path and a re-counted example-name gap (#2025). Generated-by: Claude Opus 5
Summary
JevProvidercould never get an answer from the Jev API. Everychoice,scoreandnoulcall returned HTTP 400, because it sentoperation,prompt,optionsandscaletoPOST /v1/systemone, which requiresmodel,stateandquestions. It also readlabel,valueandprobabilityfrom the top level of the response, while the API returns them underanswers.systemone-2026-06-01is not a model the API documents. It is nowjev-1.14.0.pr-triageshadow pre-filter would only have loggedfell_through.The public
choice,scoreandnoulcontract does not change.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespasses, through the pre-commit hook on this commituv run pytest/ruff check/mypypasses fortools/typed-decision, andtest_typed_decision_prefilter.pypassesapi.typesafe.ai, using made-up text onlyThe mocks now follow the published OpenAPI schema, so I also ran the provider against the real API.
enforce_privacy_gatewas patched out in a throwaway script for these calls, because I have no approvedprivacy-llm.mdentry. With the real gate left in place, the same call was still denied with no request sent.mainchoiceon a crash report, options bug/feature/questionbug, confidence 1.0noul"Is the sky usually blue on a clear day?"noul"Is the sun made of cheese?"scorefull production outage, scale (1, 5)scoretypo in a comment, scale 10typed_decision_prefilter.pyalso ran end to end on a synthetic PR, enabled throughMAGPIE_ENABLE_TYPED_DECISION_PREFILTER, with the gate patched the same way. It loggedoutcome: high_confidence,predicted_label: passing,confidence: 0.98.The updated tests fail against the old provider.
RFC-AI-0004 compliance
<PROJECT>,<tracker>,<upstream>,<security-list>) used in all skill / tool prose (thecheck-placeholdersprek hook is the mechanical gate)Linked issues
Follows #1402 and #1403.
Notes for reviewers (optional)
scoremapping: the API rates against ordered level descriptions, at most 10, and returns a position starting at zero. The contract takes a numeric scale, so the provider sends numeric levels and maps the position back. Scales wider than 9 steps, such as(0, 10), or with fractional bounds use 10 evenly spaced levels, so the labels are not all whole numbers.state, with short genericinstructions, so fenced contributor text stays data.resultanddecisionenvelope handling is gone, because the API does not return those envelopes.Not in this PR:
typed-decision-prefilter.mdcalls the script at<framework>/skills/pr-management-triage/scripts/. Theskills/symlink exists in a framework checkout, but the one marketplace<framework>copy I checked held onlytools/, and it predates fix(marketplace): ship every family's framework tools, not just security's #1937. Other skills use the same<framework>/skills/...form, so this looks like a separate fix.typed_decision_confidence_thresholddefaults to 0.85, which was never measured against real Jev answers. This fix makes that measurement possible.Generated-by: Claude Code (Opus 5.5), reviewed by
shahar1before submission