Skip to content

[P1] Validate reasoning-provider outputs against signatures before evaluating rules #57

Closed

Description

@AetherAI3

Reproduced defect

At main d740bb53, nano/runtime/vm.py accepts provider mappings without checking the signature's declared outputs. _field_of accepts booleans and non-finite numbers.

tier nano+
strategy S {
  input close: series<float>
  signature Bias {
    input price: float
    output score: float
  }
  let call = infer(Bias, close)
  every 1m { if call.score > 0.5 { buy(BTC) } }
}

A fake provider returning {"score": true} or a Python infinity produces a BUY proposal. A numeric string or missing score instead appears as condition.unwarmed. No provider call or external action was used for this reproduction; the host gate still owns execution.

Work packet

Validate responses atomically against declared output fields before values enter the graph. Match existing scalar assignability and ranges: bool is not numeric, numeric outputs must be finite, confidence must stay in range, and absent/extra fields need a documented strict policy. Types not currently consumable by the VM must receive an explicit unsupported-type diagnostic rather than silently appearing as warm-up.

Emit stable bounded infer.invalid diagnostics containing signature and field path; distinguish invalid output, provider failure, absent provider and actual indicator warm-up. Withhold dependent proposals while preserving unrelated rule behavior. Do not include provider secrets, arbitrary exception text or private model reasoning in logs.

Acceptance

  • Fake-provider cases: valid high/low values, bool-as-float, strings, missing/extra fields, NaN/infinities, non-mappings and exceptions.
  • Malformed records cannot produce dependent intents, even if another field in the same record is valid.
  • Valid responses replay identically; absent-provider behavior remains covered.
  • Document supported output types and any remaining limitations.
  • Focused VM/type/receipt tests plus reference-suite validation.

Scope and dependency

Main-based fix; independent of the open quantum PR stack. This is a prerequisite for reliable local-model adapters and agent-generated plans. No model spend or IBM execution. Keep broader provider SDKs and grammar extensions separate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions