feat(flows): node registry + executor with topo-order dispatch (NF-2) #345
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/323-nf2-registry-executor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
First slice of the node-flows runtime. Lands a self-contained registry + executor under
apps/server/src/domain/flows/with zero touch-points to HTTP, infrastructure, or existing domain code.types.ts— Graph/Plan/ExecutionContext shapes plus typed errors (FlowPlanError,ContextFrozenError,ContextMissError).registry.ts—MapRegistrywithregister/get/has/list/compile.compile(graph)validates node types, port-type compatibility (withany+ wildcard*ports), detects cycles, and topo-sorts into layered waves via Kahn's algorithm. Ships the v1 built-in catalog:source,router.filter|switch|all|race|try,template.string,util.log|guard|delay.executor.ts—execute(plan, registry, trigger, opts). Walks waves withPromise.all, wraps each node in a per-handler timeout (default 60 s, override viaargs.timeout_ms;util.delayis exempt), honours an externalAbortSignal, propagatesFILTER_DROPskips downstream, freezes every context write, and cascades errors → downstreamskipped.Test plan
registry.test.ts+executor.test.ts— topo ordering, fan-out, fan-in viarouter.all,router.race,router.filterpass/drop,router.switchmatched-only-fires,template.stringinterpolation,util.guardfalse → flow error,util.delaytiming, externalAbortControllercancel, per-node timeout, port-type mismatch rejection, cycle detection, dot-path resolution into upstream outputs, frozen-context invariant, unresolved-ref error.bun test apps/server/src/domain/flows/— 53 pass / 0 fail.bun x turbo run typecheck --filter=@claude-hooks/serverclean.bun x biome check apps/server/src/domain/flows/clean.Out of scope
forge.*andagent.*node families (NF-3).Closes #323
Adds the first slice of the node-flows runtime under apps/server/src/domain/flows/: - `types.ts` — Graph/Plan/ExecutionContext shapes + typed errors. - `registry.ts` — MapRegistry with `compile(graph)` (type-check, port-type compatibility, Kahn-topo waves) and the v1 built-in node catalog (`source`, `router.*`, `template.string`, `util.log|guard|delay`). - `executor.ts` — layer-by-layer `execute()` with per-node timeout, external AbortController, FILTER_DROP skip-propagation, frozen append-only context, error-downstream-skipped semantics. - Test coverage: 53 unit tests across both files — topo ordering, fan-out, fan-in, router.race + switch + filter branches, port-type rejection, cycle detection, dot-path resolution, frozen context, timeout + external cancel, guard abort. Closes #323 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>