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:
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.
Summary
All 28 vectors in
spec/vectors/agent/agent_vectors.jsonsupply aparametersshape that the schema does not declare, so every Rustagent_vectorstest fails identically:This was initially reported as a
@typra/emitterdefect ("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:78declares:Propertiesis a named collection ofProperty. Its two canonical forms are given by the@sampleblocks immediately above that line (tool.tsp:61andtool.tsp:72):parameters: #[ #{ name: "firstName", kind: "string" }, ... ] // array form parameters: #{ firstName: #{ kind: "string" }, ... } // name-keyed object formEvery vector instead supplies a JSON-Schema-style wrapper (34 occurrences):
Under
Properties, that parses as name-keyed object form containing a single entry namedpropertieswhose value is an array. That is exactly the casespec/vectors/model/named_collection_vectors.jsonrequires be rejected, per its own header: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:
Suggested fix
Rewrite the 34
parametersoccurrences inspec/vectors/agent/agent_vectors.jsonto the declared list form. If the JSON-Schema wrapper shape is genuinely wanted on the wire, that is a schema change totool.tspand needs its own discussion — but it cannot be introduced by vector data alone.Not in scope
The 3 remaining
tests/named_collection_vectors.rsfailures are a different root cause — all three fail withmodel: missing required field, which is thePrompty.modeloptionality issue (already fixed onwip/typra-0.4.20-regen). They are not related toparameters.