DecisionModel accepts non-finite probabilities and undeclared choices
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
Research direction
Start with hindsight_api/engine/decision_model.py and trace how parsed DecisionResponse answers reach the decision code that applies choices and probabilities. Check the existing safe error or fallback behavior and any tests for malformed provider responses. Done means malformed answers are rejected or safely handled, while valid confidence: 0.0 remains accepted.
Written by the indexing model from the issue text.
Description
Bug description
DecisionAnswer accepts non-finite probability values and does not check that a choice belongs to the options declared for its question. It also accepts probability maps that omit options. Downstream decision code uses these values for ranking and gates without one shared structural validation step, so an invalid provider answer can influence a decision or fail inconsistently.
Minimal synthetic reproduction
from hindsight_api.engine.decision_model import DecisionResponse
response = DecisionResponse.model_validate({
"answers": {
"rank": {
"choice": "not-an-option",
"probabilities": {"o0": float("nan"), "o1": 0.7},
"confidence": 0.9,
}
}
})
assert response.answers["rank"].choice == "not-an-option"
The current model accepts this payload. Replacing float("nan") with float("inf") is accepted as well; probabilities outside [0, 1] and partial maps are also representable by the model. This is an offline, synthetic reproduction and makes no provider request.
Expected behavior
Validate the parsed answer against its question before a caller applies it:
- probabilities must be finite and within
[0, 1](and sum to one within a documented tolerance where the provider protocol requires it); - every expected option must be present, with no undeclared option keys;
choicemust be one of the declared option IDs and, where applicable, agree with the probability ranking;- a structurally invalid answer should use the existing safe error/fallback behavior, not be applied as a decision;
confidence: 0.0must remain a valid value.
This is structural validation only; it does not ask the engine to determine whether a model's valid answer is semantically correct.
Version and related work
Reproduced against v1.3.1; the same response model is present on main at 4b8dfb644c7ec568645fa58878c8b78424276189. Related but distinct: #7071 evaluates decision quality on partial numeric evidence; it does not cover malformed response validation.
- Dominant language
- Python
- Stars
- 45.2k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vectorize-io/hindsight
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vectorize-io/hindsight#7254 ·
-
Control Plane shows different calendar dates for the same occurrence in Constellation and TimelineOpencore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vectorize-io/hindsight#7240 · 1 comment ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vectorize-io/hindsight#7233 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
vectorize-io/hindsight#7231 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
vectorize-io/hindsight#7228 · 1 comment ·
All issues in vectorize-io/hindsight
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day