A contract entry states the port's lane as well as its schema
A port's lane and its JSON Schema type are two different vocabularies. Answering one with the other would make a contract entry contradict the port it is bound to.
The rule
- An interface entry MUST state its lane and its structural schema separately: the lane is a data-type lane, and the schema is the JSON Schema fragment.
- The lane MUST NOT be the fragment's
type. - The lane MUST be the lane the entry's declared
schemaderives (SCH-10) where the entry declares one, otherwise its bound port's declared or derived lane. - An unbound entry that declares no
schemaMUST be on the sink lane (SCH-35). - The lane MUST be resolved once, when the contract is built, against the vocabulary the implementation actually serves.
- The resolved lane MUST be pinned into the stored fragment, so a reader sees the lane the workflow was published against rather than one that could drift since.
- Reading the contract MUST only read that pin.
- A stored contract without a pin MUST fall back to the lane derivable from the fragment's
type, which is never wider than the truth. - Such a contract MUST correct itself on the workflow's next rebuild.
- The schema emitted alongside the lane MUST be the structural contract only.
- The pinned lane, the title, the description, the examples and property-level required flags MUST be stripped from it, because the entry states each of them itself.
- None of this changes the launch check, which reads
typeandenumfrom the stored contract and MUST NOT consult this projection.
What it means
A port's lane and its JSON Schema type are two different vocabularies, and
they diverge exactly where a port carries a domain-specific meaning over an
ordinary structural shape: an array of conversation messages is, structurally,
just an array. Reading the schema's type and calling that the lane would
answer array for a case the lane can name precisely.
Where an entry declares its own schema, the lane comes from that schema, and the port it binds only says where the value goes; R4.f warns when the two disagree. An unbound entry with no schema is on the sink lane and accepts anything.
The lane is resolved once, when the contract is built, and pinned into the
stored fragment — it is not re-derived on every read. A contract built
before the lane existed has no pin to read, so it falls back to the lane the
schema's type implies, which is never wider than the truth, and corrects
itself the next time the contract is rebuilt. The schema published alongside
an entry is stripped of the lane, the title, the description and the
examples on the way out, because the entry states each of those itself; none
of it changes what the launch check reads, which is still type and enum
on the stored contract, never this projection.
Example
A node produces two outputs: one declares a messages lane over a JSON
Schema array, the other declares nothing over an object.
POST /api/flowdrop/workflows
{"name": "Lane WF", "nodes": [ … ], "interface": {"outputs": [
{"id": "out_list", "bindings": [{"nodeId": "msg1", "portId": "messages"}]},
{"id": "out_one", "bindings": [{"nodeId": "msg1", "portId": "message"}]}
]}}{ "outputs": [
{"id": "out_list", "dataType": "messages", "schema": {"type": "array"}},
{"id": "out_one", "dataType": "json", "schema": {"type": "object"}}
] }The node type's own fragment carries more than the pin keeps:
{ "type": "array", "title": "Messages", "x-data-type": "messages" }{ "type": "array", "x-data-type": "messages" }