Skip to content

agent_vectors supplies an undeclared parameters shape; all 28 Rust vectors fail (not a typra defect) #454

Description

Summary

All 28 vectors in spec/vectors/agent/agent_vectors.json supply a parameters shape that the schema does not declare, so every Rust agent_vectors test fails identically:

thread 'test_tool_result_message_format' panicked at src/model/agent/prompty.rs:69:
tools.parameters.properties: invalid named collection entry category array
cd runtime/rust/prompty && cargo test --no-fail-fast --test agent_vectors
  test result: FAILED. 0 passed; 28 failed

This was initially reported as a @typra/emitter defect ("the emitted validator rejects the legal list form of a named collection"). It is not. The emitter is implementing the named-collection contract correctly; the vector data is wrong.

Root cause

schema/model/tools/tool.tsp:78 declares:

parameters: Properties;

Properties is a named collection of Property. Its two canonical forms are given by the @sample blocks immediately above that line (tool.tsp:61 and tool.tsp:72):

parameters: #[ #{ name: "firstName", kind: "string" }, ... ]   // array form
parameters: #{ firstName: #{ kind: "string" }, ... }           // name-keyed object form

Every vector instead supplies a JSON-Schema-style wrapper (34 occurrences):

"parameters": { "properties": [ { "name": "city", "kind": "string", "required": true } ] }

Under Properties, that parses as name-keyed object form containing a single entry named properties whose value is an array. That is exactly the case spec/vectors/model/named_collection_vectors.json requires be rejected, per its own header:

Array-valued entries in name-keyed object form are rejected recursively, while arrays in declared entry fields remain valid.

So the validator is enforcing the rule the report cited to argue it was broken.

Proof it is data, not the emitter

Rewriting only the vector data, with no emitter change and no regeneration:

"parameters": { "properties": [ ... ] }   ->   "parameters": [ ... ]
cargo test --no-fail-fast --test agent_vectors
  before: test result: FAILED. 0 passed; 28 failed
  after:  test result: ok.     28 passed; 0 failed

Suggested fix

Rewrite the 34 parameters occurrences in spec/vectors/agent/agent_vectors.json to the declared list form. If the JSON-Schema wrapper shape is genuinely wanted on the wire, that is a schema change to tool.tsp and needs its own discussion — but it cannot be introduced by vector data alone.

Not in scope

The 3 remaining tests/named_collection_vectors.rs failures are a different root cause — all three fail with model: missing required field, which is the Prompty.model optionality issue (already fixed on wip/typra-0.4.20-regen). They are not related to parameters.

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