Decompose the reviewed architecture specs into taskgraph-managed tasks: - 2 setup tasks (project init, test infrastructure) - 4 schema tasks (enums, node attrs, edge attrs, graph schemas) - 1 error hierarchy task - 6 graph tasks (FlowGraph class, 3 construction paths, queries, validation) - 5 analysis tasks (type-compat, build-type-edges, ordering, template-validation, defaults) - 5 component tasks (Operation, Sequential, Parallel, Conditional, Map) - 2 host config tasks (GraphologyHostConfig, ReactiveHostConfig) - 4 reactive tasks (WorkflowRoot, node-status, max-concurrency, retry-semantics) - 3 review tasks (foundation, reactive-and-hosts, complete-library) - 5 meta cluster tasks (schema, graph, component, reactive, analysis layers) - 1 API exports task Validated with taskgraph: zero cycles, 38 tasks, 12 parallel generations. Critical path: 12 tasks through reactive execution layer.
38 lines
1.6 KiB
Markdown
38 lines
1.6 KiB
Markdown
---
|
|
id: reactive/max-concurrency
|
|
name: Implement maxConcurrency semaphore for Parallel groups
|
|
status: pending
|
|
depends_on:
|
|
- reactive/node-status
|
|
- component/parallel
|
|
scope: narrow
|
|
risk: medium
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
Implement the reactive counting semaphore that enforces `maxConcurrency` on Parallel groups. When the root initializes signals for nodes in a Parallel group with `maxConcurrency: N`, a node's effective `ready` transition requires both `preconditions.value === true` AND `runningCount < maxConcurrency`.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] For each node in a Parallel group with `maxConcurrency`, the `canStart` computed wraps preconditions: `preconditions.value && runningSiblingCount < maxConcurrency`
|
|
- [ ] `runningSiblingCount` is a reactive computed derived from counting sibling nodes currently in `"running"` state
|
|
- [ ] When a sibling completes and a slot opens, the next ready node transitions to ready/startable
|
|
- [ ] Parallel groups without `maxConcurrency` (default): all siblings start immediately when preconditions met — no semaphore
|
|
- [ ] `maxConcurrency` is a runtime scheduling hint — the DAG doesn't encode it
|
|
- [ ] Unit tests: parallel group with maxConcurrency: 2 limits to 2 running at a time, slot opens → next node starts, no maxConcurrency → all start immediately
|
|
|
|
## References
|
|
|
|
- docs/architecture/reactive-execution.md — maxConcurrency, counting semaphore
|
|
- docs/architecture/workflow-templates.md — Parallel.maxConcurrency prop
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |