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.
2.9 KiB
2.9 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| graph/flowgraph-class | Implement FlowGraph class skeleton wrapping graphology DirectedGraph | pending |
|
moderate | medium | phase | implementation |
Description
Create the FlowGraph class that wraps a graphology DirectedGraph and enforces DAG invariants. This is the core data class. At this stage, implement the constructor, generic type parameters, the _graph instance, the graph getter, FlowGraphOptions, and the _edgeKey() helper. Construction factory methods come in dependent tasks.
Acceptance Criteria
src/graph/construction.tsexportsFlowGraphclass (orsrc/graph/index.tsif preferred, matching source structure)- Class has type parameters:
NodeAttrs extends TSchema,EdgeAttrs extends TSchema - Constructor creates internal
graphology.DirectedGraphwith options{ type: "directed", multi: false, allowSelfLoops: false } FlowGraphOptionsinterface:type?: "directed",multi?: false,allowSelfLoops?: falseget graph(): DirectedGraphreturns the underlying graphology instance_edgeKey(source, target): stringproduces deterministic keys${source}->${target}addNode(key, attrs)— adds node, throwsDuplicateNodeErroron duplicateremoveNode(key)— removes node and edges, throwsNodeNotFoundErrorif missingupdateNode(key, attrs)— partial merge of attributes, throwsNodeNotFoundErrorif missinghasNode(key): booleangetNodeAttributes(key): NodeAttrs— throwsNodeNotFoundErrorif missingaddEdge(source, target, attrs?)— throwsNodeNotFoundErrorfor missing endpoints,CycleErrorif edge creates cycle,DuplicateEdgeErrorif edge existsremoveEdge(source, target)— no-op if edge doesn't existhasEdge(source, target): booleangetEdgeAttributes(source, target): EdgeAttrs— throws if edge doesn't existnodes(): string[],edges(): string[],order: number,size: numberforEachNode(callback),forEachEdge(callback)predecessors(nodeId),successors(nodeId)delegating tograph.inNeighbors/graph.outNeighbors- Static construction methods (
fromSpecs,fromCallEvents,fromJSON) are stubs (throw "not implemented") - Re-exported from
src/graph/index.tsandsrc/index.ts - Unit tests: constructor, node operations, edge operations, cycle detection on addEdge
References
- docs/architecture/flowgraph-api.md — FlowGraph class full API surface, delegation model
- docs/architecture/schema.md — edge key convention
- docs/architecture/error-handling.md — throwing contract for mutations
Notes
To be filled by implementation agent
Summary
To be filled on completion