DecisionModel accepts non-finite probabilities and undeclared choices
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 45.2k
- Fork
- 5.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vectorize-io/hindsight
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vectorize-io/hindsight#7254 ·
-
Control Plane shows different calendar dates for the same occurrence in Constellation and TimelineApertacore
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vectorize-io/hindsight#7240 · 1 commento ·
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vectorize-io/hindsight#7233 ·
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
vectorize-io/hindsight#7231 ·
-
Flaky system test: test_embedding_and_rerank_calls_are_in_request_history raises StopIterationApertacore
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
vectorize-io/hindsight#7228 · 1 commento ·
Tutte le issue di vectorize-io/hindsight
Issue simili
-
Test: to_hijri() accepts datetime.datetime and uses only the date partForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertagood first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
polish
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresForse già presa @AshutoshSingh840 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
UKGovernmentBEIS/control-arena#992 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
mvalentsev/awesome-free-ai-coding#70 ·
I maintainer di solito rispondono entro 1 giorno