✨ feat(plan): Node AST, strict Planned values, GraphBuildError - #181
Merged
Conversation
roninjin10
force-pushed
the
plan-node-ast
branch
from
August 11, 2026 23:27
ecca8ca to
64624ac
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)
roninjin10
force-pushed
the
plan-node-ast
branch
from
August 12, 2026 05:48
64624ac to
2cd29ff
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. |
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 authoring half of
@smthrs/plan: the pure Node AST that flow bodies will build, ahead ofGraph.build(PR4) and the declared Activity/Flow surface (PR2/PR3).Node.ts+internal/node.ts: seven closure-free, serializable variants —Succeed,All,Map,AndThen,FlowCall,ActivityCall,Branch. Deferred functions (map transforms, branch predicates, continuations) live in out-of-band WeakMap tables withfnv1a32-source/v1digests in the AST, so an edited function re-keys exactly its cone.Planned.ts: thePlanned<T>branded placeholder for step results at plan time. Property access records reference paths (legal — becomesRef{from, path}key material); any computation —Symbol.toPrimitive,valueOf,toString,toJSON, function application — throwsGraphBuildErrornaming the node and the fix (Node.mapto compute,Node.branchto decide, or pass into a payload).GraphBuildError.ts:planned_value_computed,invalid_continuation,invalid_all_member,recursion_requires_boundary(reserved for PR4).docs/specs/Concepts/Unified Flow Authoring.md+Trampoline Loops.md(decided 2026-08-11). Deviations from the agent-repo prior art are deliberate:Branch/ActivityCalladded,Dynamicdropped (agent-layer concept), lenient proxy made strict.Verification
npm run check --workspace @smthrs/plan— cleannpm run lint --workspace @smthrs/plan— cleanNode.test.ts(13),Planned.test.ts(8),GraphBuildError.test.ts(2); full package suite 6 files / 79 tests, 100% branch/function/line/statement coverage enforced by the runvitest.config.ts: focused single-file runs now scope coverage to the same-named source module; the package-widesrc/**100% gate is unchanged for full runs