✨ feat(flow): Graph.build — plan-time expansion of flow bodies - #184
Merged
Conversation
roninjin10
force-pushed
the
flow-body-values
branch
from
August 11, 2026 23:27
1fe7197 to
009cf09
Compare
roninjin10
force-pushed
the
flow-graph-build
branch
2 times, most recently
from
August 11, 2026 23:30
9f6dc76 to
f8bf150
Compare
roninjin10
force-pushed
the
flow-body-values
branch
from
August 11, 2026 23:30
009cf09 to
ad7df62
Compare
…Error The authoring half of the plan: seven closure-free node variants (Succeed, All, Map, AndThen, FlowCall, ActivityCall, Branch) with digested deferred functions in out-of-band tables, the Planned<T> branded placeholder whose proxy throws GraphBuildError on any computation (toPrimitive, valueOf, toString, toJSON, application), and the GraphBuildError vocabulary. Docs: docs/specs/Concepts/Unified Flow Authoring.md (cherry picked from commit 64624ac)
Activity.make gains a string-first overload: a named, schema-typed atom (payload/success/error/tier/idempotencyKey) whose implementation attaches separately via .toLayer(execute) through the existing registration and activity machinery, and whose .call(payload) records an ActivityCall node for plans. The inline options form is unchanged. Docs: docs/specs/Concepts/Unified Flow Authoring.md (cherry picked from commit b883814)
…otations Flow.make accepts an optional plan-time body (required once the migration completes), Flow.prototype.call records a FlowCall node, the trampoline outcome vocabulary lands as pure data (Flow.done / flow.to / Flow.park over the existing Waiting reasons), and Capabilities / EffectsDeclaration / Placement join the annotation keys. Docs: docs/specs/Concepts/Unified Flow Authoring.md Docs: docs/specs/Concepts/Trampoline Loops.md (cherry picked from commit ad7df62)
roninjin10
force-pushed
the
flow-body-values
branch
from
August 12, 2026 05:48
ad7df62 to
c7865ac
Compare
roninjin10
force-pushed
the
flow-graph-build
branch
from
August 12, 2026 05:48
f8bf150 to
ba7b300
Compare
Contributor
Author
|
Review round 1 complete (sol + fable, independent). Findings for this PR were fixed and folded into its commit; the full ledger (15 fixes, 6 resolved-as-designed) lives in the stack's review notes. All 14 branches rebased and re-verified: whole-repo check green, all package suites at 100% coverage, rebuilt tip byte-identical to the verified fix tree. |
Evaluates a body against its real payload with strict Planned placeholders for step results, expands branch arms as static topology, splices inline flow calls with capability intersection, rejects recursive calls with recursion_requires_boundary, reads effects/capabilities/placement from the authoring annotations, and emits NodeDrafts that Plan.compile keys directly. Docs: docs/specs/Concepts/Unified Flow Authoring.md (cherry picked from commit f8bf150)
roninjin10
force-pushed
the
flow-graph-build
branch
from
August 12, 2026 06:51
ba7b300 to
ce958cc
Compare
Contributor
Author
|
Swap pass complete — review loop closed. Both seats have now reviewed every PR. Swap findings (6: nested-catch subject scoping, foreign-flow wait tokens, two |
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.
Summary
The analysis phase:
Graph.build(flow, payload)turns a bodied flow into keyed plan input.Plannedplaceholders — computation throwsGraphBuildErrorwith the node path (PR1's traps, now exercised end-to-end).Branchexpands both arms as static topology with the digested predicate on the branch node's material — the plan shows the whole choice..call()splices a bodied callee's subgraph (capability intersection); body-less flow calls and activity calls are leaf drafts. Recursive.call()throwsrecursion_requires_boundarydirecting to.to()/.child().KeyMaterial+NodeEffects.Plan.compile/Plan.appenddirectly — round-trip test proves drafts → keyed Plan with correctdependsOnfromRef/Pendinginputs, and that editing a map function's source re-keys exactly the downstream cone.Two
OPEN QUESTION (2026-08-11)markers (deliberate): default boundary mode for nodes without declared effects; nested-branch planned-subject binding.Depends-on: #183
Verification
npm run checkclean for@smthrs/flowand@smthrs/plan; lint clean for bothGraph.test.ts(20) + extendedNode.test.ts(15); full suites: flow 15 files / 141 tests, plan 6 files — both at the enforced 100% coverage (independently re-verified)Decisions taken (were open questions — review these)
{reads: [], writes: [], boundaryMode: "expected"}(Graph.ts:200). Rationale: a node that declared nothing claims no path either way;"expected"means runtime deviation is surfaced, not fatal. The"hard"alternative would fail any run whose node touches an undeclared path — the right strictness only after authors actually declare effects routinely. Revisit when effect declarations are pervasive.Graph.ts:674). The arm subject is recorded under oneNode.branchSubjectname, so an arm nested in another branch's arm sees the inner subject — exactly lexical shadowing semantics from ordinary code. Per-branch subject names in the AST were deliberately not added; they buy disambiguation nobody has needed at the cost of AST surface.