You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1] Reject coerced types at the Intent IR boundary before agent plans are admitted #56
At main d740bb530262c1c76a2b18c8a8aa47476f8b6b96, the published Intent JSON schema and Python admission behavior disagree. Starting with compile_intent("spy earnings").to_dict():
Set confidence = True: validate_document accepts it as 1.0.
Set confidence = "0.9": it accepts a string as 0.9.
Set entities[0].kind = 42: it accepts the number as the string "42".
This becomes more consequential when local models or agent tools generate plan JSON: invalid proposals should receive a repairable error, not acquire a different meaning during admission.
Agent work packet
Remove implicit coercion of invalid input types. Accept genuine JSON integer/float confidence values, excluding booleans; check finiteness and range before normalization. Require an actual string for entity kind. Keep the existing IR version and canonical bytes for valid compiler-produced plans.
Acceptance
Bool, numeric-string, null, non-finite and out-of-range confidence are rejected through IntentIR.from_dict, validate_document and canonical serialization with a controlled IntentValidationError.
Non-string entity kinds are rejected.
Numeric confidence 0, 0.5 and 1 remain valid; compiled golden plans retain canonical bytes.
Include positive controls and direct-constructor/API coverage where applicable.
Run focused Intent tests and the reference suite, separating unrelated baseline failures.
Delivery and limits
One focused main-based PR. No changes to model routing, inference providers, network effects or QPU authority. This issue does not attempt to solve all future proposal-schema validation.
Activity