Repository navigation
Typed pin literals: a value typed on an unwired input takes the input's type (ADR 0049) - #7
Merged
Merged
Conversation
…'s type A number input stores a number, a true/false input a boolean; an any input that shares a type variable with others of its node (Pin.typeVar on the template: Compare a/b, Coalesce, Get Property/Element/Random Element and Get Variable default+value) takes the type wired to them, resolved through generic nodes; with nothing wired a typed value is text and a stored value keeps its own JSON type. One pure module (utils/pinLiterals.ts) resolves, converts exactly on rewire (store subscription and loadFlow) and flags what does not convert (card row, type tag, blocking run check). Flows saved by 0.13.0 are converted on open with a notice. Runtime smoke runs the typed and the 0.13.0-style fixtures; catalog marks [type T] pins. Root ADR 0049.
…niencies, Add to List item and number-to-text formatting documented; legacy runtime expectation moves to AbstractRuntime's Compare test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operator ruling 2026-11-02: a value typed on an unwired input must take the type the graph gives it, not always text. Since 0.13.0, Compare
awired to 5 with5typed inbcompared5 == "5"(false, silently). Root ADR 0049 (lpalbou/AbstractFramework,docs/adr-0049-typed-pin-literals).What changes
Pin.typeVaron node templates: Comparea/b; Coalescea/b/result;defaultwith the read value of Get Property, Get Element, Get Random Element, Get Variable. Read from the template, never from a saved pin, so old flows resolve too.src/utils/pinLiterals.ts(one module): resolves an input's literal type (declared type; else the type variable from a pin the node types itself, then wired inputs, then output consumers, through other generic nodes, cycle-safe, disagreeing wires = unresolved; else text), parses typed text by kind (decimal-number grammar, true/false, JSON object/list; never guesses from the text), converts stored values exactly or reports a problem.typePinLiterals, so any rewire (connect, delete, undo, the assistant) converts exact values;loadFlowdoes the same and recordsliteralsRetypedOnLoad, shown as a toast; the returned baseline stays the flow as stored (unsaved changes until saved).TypedLiteralInputforanyinputs (keeps the draft while focused, empty = no value) with a type tag (number / text / true/false / JSON / list); a mismatched value is outlined and explained under its row, for declared number/boolean pins too.durationis text when the node waits for a timestamp (the runtime reads it as text then).[]defaults in deep-research / ltm flows stay lists); new typed text is text.Evidence
npx vitest run: 144 files / 1364 tests pass;npm run lintclean;npm run buildOK.src/utils/pinLiterals.test.ts(20),src/components/nodes/typedLiteral.test.tsx(3). Mutation check: removing Compareb'stypeVarand the store conversion turns 7 tests red.scripts/typed_literals_smoke.py(added to the CI smokes job, real AbstractRuntime, no network): typed fixture5 == 5and10 > 9true; the 0.13.0-style fixture runs as stored (false). The unit test proves opening the 0.13.0 fixture yields exactly the typed fixture's values.abc) in the author's scratch.Not changed
_normalize_pin_defaults). Its Compare returns false when Python refuses10 > "9"; making that a visible error is a separate runtime decision (ADR 0049 follow-up).