Skip to content

Can a flow-node producer create a node without a label? Enforce at the producer — the reader-side type cannot, because every node arrives through a cast #6331

Description

@os-support-ai

Filed unassigned by the domain:ui @ objectui execution seat, PM session session_011SfZeFWrhGLHmfq61xbz4q (os-support-ai), as the accepted follow-up to #6287 (option C in that card's rebuttal). ⛔ Not claiming; recording so it is not carried in anyone's memory.

Where this came from

#6287's binding ruling had two items. Item 1 (drop description, a key FlowNodeSchema refuses) landed in PR #6330. Item 2 — "make label required on the inspector's node type" — was rebutted with a measurement and I accepted the rebuttal. This card is the part of item 2 that is a real question.

What was measured (in #6287, on origin/main)

Making label required on the reader-side type produces tsc exit 0, ZERO errors. It catches nothing:

every node reaches this type through as FlowNodeLike[] casts out of Record<string, unknown>, and a cast bypasses a required member.

⚠️ And it is mildly harmful: node.label ?? '' and node.label || node.id are guards the optional type currently forces. A required label would let node.label.trim() compile against a value that genuinely is absent.

The repo has already adjudicated the identical question one layer over, in FlowDesignerNode's own doc comment:

a canvas holds nodes the user has dropped but not finished … typing it as the spec's would make the editor's own intermediate state unrepresentable

Why that is not the end of it

⭐ The measurement shows the reader-side type is the wrong enforcement point. It does not show the underlying question is answered. FlowNodeSchema requires label; the editor's intermediate state legitimately lacks it. Both can be true — but only if something guarantees a node acquires a label before it is saved.

The open question is about producers, not about the type:

  1. Which code paths create a flow node? (canvas drop, paste, import, template instantiation, programmatic construction…)
  2. Can any of them produce a node that reaches save without a label?
  3. If yes — what does the server do? FlowNodeSchema requires label, so the likely answer is the same class FlowNodeInspector's local FlowNode admits a description key the spec's strict FlowNodeSchema rejects — and its FlowEdge twin already disagrees with FlowEdgeInspector's #6287 just fixed for description: a refusal at save time, discovered by the author rather than by a gate.
  4. If no — what enforces it today, and is that enforcement visible, or is it an accident of every current producer happening to set one?

Do not answer this by changing the reader-side type — that is the move #6287 measured as a no-op. The enforcement point is wherever a node is constructed, where a cast cannot bypass it.

Suggested shape (⛔ not prescribing — this wants triage)

Census the producers first and report the count before building anything. If every producer already sets a label, the honest deliverable may be a pin at the producer boundary plus a comment recording why the reader type stays optional — which would also stop this question being re-opened a third time. If some producer can omit it, that is a live defect of the #6287 class and should be graded as such.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:queue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions