Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Run dialog: a run that ends in a fraction of a second showed an invented "On Flow End" step and
the last node's answer as its Final Result. The final result is now the run record's output, and a
flow with an On Flow End never gets an invented end row.
- Run dialog: the type after a field's label no longer repeats the label ("model (model)"); a field that picks a
decision model says "(decision model)".
- The "Decision triage" example loads with every wire drawn: its end output `model` (a text, the
provider/model that answered) is now `answered_by`; an end pin named `model` is a model picker
that a text cannot feed.
Expand Down
10 changes: 8 additions & 2 deletions docs/backlog/overview.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# AbstractFlow Backlog Overview

## Snapshot
- Updated: 2026-10-28
- Updated: 2026-11-03
- Planned: 0
- Proposed: 51 (on disk, recursive; 0161 added 2026-10-28)
- Proposed: 52 (on disk, recursive; 0162 added 2026-11-03)
- Completed: 55
- Deprecated: 0

## 2026-11-03 Pin kind from the declared type (0162), PROPOSED
Item 0162 (`proposed/0162_pin_kind_from_declared_type_not_name.md`): `isModelPin` / `isProviderPin`
(`src/utils/pinCatalog.ts:38-61`), the Run dialog's `isModelInputPin` and the load migration at
`src/hooks/useFlow.ts:2458` decide a pin's kind from its NAME; the "Decision triage" example's text
output `model` was retyped to a model picker and its wire hidden (Flow #8 renamed it `answered_by`).

## 2026-10-28 Email-triage QA (0160), COMPLETED in 0.12.0
Item 0160 (`completed/0160_email_triage_qa_compare_notify_help_mailbox_join.md`): the operator's
email-triage run ended on "No important emails" because Compare with no operator runs `==` and
Expand Down
59 changes: 59 additions & 0 deletions docs/backlog/proposed/0162_pin_kind_from_declared_type_not_name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 0162 — A pin's kind comes from its declared type, never from its name

- Status: PROPOSED 2026-11-03
- Created: 2026-11-03
- Owner: flow
- Source: adversarial review of Flow #8 (decision Run dialog, `review-flow-8.md` in the framework's
`untracked/release-2026-11-03/`), finding 2; the example rename in the same PR is the evidence.

## Problem

Several editor functions decide what a pin IS (a model picker, a provider picker) from its NAME as
well as from its declared type. A pin named `model` or `<something>_model` is treated as a model
picker even when its type is `string`:

- `src/utils/pinCatalog.ts:51-61` `isModelPin`: `pin.id === 'model' || pin.id.endsWith('_model')`
next to the `model*` types; `isProviderPin` (`:38-48`) does the same for `provider` /
`*_provider`. `modelCatalogScopeForPin` and `providerCatalogScopeForPin` then derive the catalog
from name prefixes (`image_model`, `tts_model`, `stt_model`, `music_model`, ...).
- `src/components/RunFlowModal.tsx` `isModelInputPin` (about line 1881) repeats the same rule for
the Run dialog.
- `src/hooks/useFlow.ts:2458` (load migration "promote well-known LLM routing pins"): a `string`
pin whose id AND label are `model` is retyped to `model` on every load (`provider` likewise to
`provider_text`), for inputs and outputs, on every node.

What it broke: the "Decision triage" example's On Flow End had a `string` input named `model` (the
provider/model that answered, wired from the Decision node's `model` output, a `string`). The load
migration retyped it to `model`, and the editor then refused the wire ("Type mismatch: cannot connect
string to model"), so the connection was kept hidden. Flow #8 fixed the example by renaming the pin
`answered_by`; the rule that caused it is unchanged. Any flow that names a text value `model` meets
the same thing.

## Proposal

1. The kind of a pin is its declared type. `isModelPin` / `isProviderPin` / `isModelInputPin` read
`pin.type` only; the scope comes from the type (`model_image`, `model_voice`, ...) and, for a
generic `model`, from the provider pin of the same node or the node type (as today).
2. Migrate on load, once and visibly: a saved pin whose type is `string` but whose name says model
or provider keeps `string`. Pins that relied on the name (old flows whose model pins were saved
as `string` with a picker shown because of the name) are listed by an audit over the example and
bundled corpus. Each one gets its declared type written in the source (builder scripts, bundled
JSON), not inferred at load.
3. Retire the `useFlow.ts:2458` promotion after the corpus is migrated. A flow saved before that keeps
working because its migrated pins carry their type.

## Acceptance

- A `string` pin named `model` on any node (On Flow End included) accepts a `string` wire and shows
a text box, not a model picker.
- Every shipped example and bundled flow loads with no hidden connection
(`loadFlowEdges.test.ts` corpus test stays green) and with the same pickers as today where the
type says model or provider.
- A test that a `string` pin named `model` / `x_model` is not a model pin (it goes red with the
name rule restored).

## Notes

- Root ADR 0049 (typed pin literals) already moved typed VALUES to come from the graph, not from
the wording. This item does the same for pin KINDS.
- Not urgent for 0.14.0: the example no longer meets it; flows authored by people may.
2 changes: 2 additions & 0 deletions llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6651,6 +6651,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Run dialog: a run that ends in a fraction of a second showed an invented "On Flow End" step and
the last node's answer as its Final Result. The final result is now the run record's output, and a
flow with an On Flow End never gets an invented end row.
- Run dialog: the type after a field's label no longer repeats the label ("model (model)"); a field that picks a
decision model says "(decision model)".
- The "Decision triage" example loads with every wire drawn: its end output `model` (a text, the
provider/model that answered) is now `answered_by`; an end pin named `model` is a model picker
that a text cannot feed.
Expand Down
45 changes: 30 additions & 15 deletions src/components/RunFlowModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,21 @@ function getPlaceholderForPin(pin: Pin): string {
}
}

/**
* The type tag after a Run-form label: "(text)", "(decision model)". None when it would only repeat
* the label ("model (model)").
*/
export function runFormTypeLabel(pin: Pin, scope?: ProviderScope): string | null {
const type = scope === 'decision' ? 'decision model' : displayPinType(pin);
if (!type || type.trim().toLowerCase() === String(pin.label || pin.id).trim().toLowerCase()) return null;
return type;
}

function RunFormType({ pin, scope }: { pin: Pin; scope?: ProviderScope }) {
const type = runFormTypeLabel(pin, scope);
return type ? <span className="run-form-type">({type})</span> : null;
}

function displayPinType(pin: Pick<Pin, 'type' | 'schema'> | undefined): string {
return displayDataPinTypeLabel(pin);
}
Expand Down Expand Up @@ -8169,7 +8184,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<ArtifactInputField
pin={pin}
Expand All @@ -8192,7 +8207,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<ArtifactListInputField
pin={pin}
Expand All @@ -8213,7 +8228,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<WorkspacePathInputField
kind={pin.type === 'workspace_folder' ? 'folder' : 'file'}
Expand All @@ -8232,7 +8247,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={value}
Expand Down Expand Up @@ -8261,7 +8276,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={value}
Expand Down Expand Up @@ -8290,7 +8305,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={value}
Expand Down Expand Up @@ -8319,7 +8334,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={value}
Expand Down Expand Up @@ -8386,7 +8401,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} scope={scope} />
</label>
<AfSelect
value={value}
Expand Down Expand Up @@ -8431,7 +8446,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={current}
Expand All @@ -8453,7 +8468,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={current}
Expand All @@ -8475,7 +8490,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfMultiSelect
values={values}
Expand All @@ -8499,7 +8514,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={value}
Expand All @@ -8519,7 +8534,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<AfSelect
value={value}
Expand All @@ -8538,7 +8553,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>
<ArrayParamEditor
value={value}
Expand All @@ -8553,7 +8568,7 @@ export function RunFlowModal({
<div key={pin.id} className="run-form-field">
<label className="run-form-label">
{pin.label}
<span className="run-form-type">({displayPinType(pin)})</span>
<RunFormType pin={pin} />
</label>

{inputType === 'textarea' ? (
Expand Down
10 changes: 9 additions & 1 deletion src/components/runDecisionModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Pin, VisualFlow } from '../types/flow';
import { useFlowStore } from '../hooks/useFlow';
import { decisionModelOptions, decisionModelPinIds } from '../utils/decisionPins';
import { flowCompleteEventFromSummary } from '../utils/ledgerEvents';
import { flowCompletionRow, modelPickerWaitsForProvider, modelScopeForPin } from './RunFlowModal';
import { flowCompletionRow, modelPickerWaitsForProvider, modelScopeForPin, runFormTypeLabel } from './RunFlowModal';

const EXAMPLE = resolve(__dirname, '../../examples/flows/decision-triage.json');
const example = (): VisualFlow => JSON.parse(readFileSync(EXAMPLE, 'utf8')) as VisualFlow;
Expand Down Expand Up @@ -102,3 +102,11 @@ describe('a completed run`s final result is the run record`s output', () => {
});
});
});

describe('Run-form type tag', () => {
it('never repeats the label ("model (model)"), and names a decision model', () => {
expect(runFormTypeLabel(modelPin)).toBeNull();
expect(runFormTypeLabel(modelPin, 'decision')).toBe('decision model');
expect(runFormTypeLabel({ id: 'ticket', label: 'ticket', type: 'string' })).toBe('string');
});
});
Loading