From 4e4cfe14e3c65f36f8a524f47a26a2bdd361aa45 Mon Sep 17 00:00:00 2001 From: Laurent-Philippe Albou <24249870+lpalbou@users.noreply.github.com> Date: Tue, 3 Nov 2026 04:03:56 +0100 Subject: [PATCH] Run dialog: the type tag never repeats the label and names a decision model; backlog 0162 (proposed): a pin's kind from its declared type, never its name --- CHANGELOG.md | 2 + docs/backlog/overview.md | 10 +++- ...62_pin_kind_from_declared_type_not_name.md | 59 +++++++++++++++++++ llms-full.txt | 2 + src/components/RunFlowModal.tsx | 45 +++++++++----- src/components/runDecisionModel.test.ts | 10 +++- 6 files changed, 110 insertions(+), 18 deletions(-) create mode 100644 docs/backlog/proposed/0162_pin_kind_from_declared_type_not_name.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bbb9bd..dc2d1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/docs/backlog/overview.md b/docs/backlog/overview.md index 2a14be5..f6b04b6 100644 --- a/docs/backlog/overview.md +++ b/docs/backlog/overview.md @@ -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 diff --git a/docs/backlog/proposed/0162_pin_kind_from_declared_type_not_name.md b/docs/backlog/proposed/0162_pin_kind_from_declared_type_not_name.md new file mode 100644 index 0000000..6252e14 --- /dev/null +++ b/docs/backlog/proposed/0162_pin_kind_from_declared_type_not_name.md @@ -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 `_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. diff --git a/llms-full.txt b/llms-full.txt index 20fffb5..517c64b 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -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. diff --git a/src/components/RunFlowModal.tsx b/src/components/RunFlowModal.tsx index 582d785..2da5698 100644 --- a/src/components/RunFlowModal.tsx +++ b/src/components/RunFlowModal.tsx @@ -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 ? ({type}) : null; +} + function displayPinType(pin: Pick | undefined): string { return displayDataPinTypeLabel(pin); } @@ -8169,7 +8184,7 @@ export function RunFlowModal({
{inputType === 'textarea' ? ( diff --git a/src/components/runDecisionModel.test.ts b/src/components/runDecisionModel.test.ts index 4bcb697..e5199dc 100644 --- a/src/components/runDecisionModel.test.ts +++ b/src/components/runDecisionModel.test.ts @@ -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; @@ -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'); + }); +});