3.0 KiB
3.0 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| host/graphology | Implement GraphologyHostConfig — render ujsx template to graphology DAG | completed |
|
broad | high | phase | implementation |
Description
Implement the GraphologyHostConfig that renders a ujsx workflow template (UNode tree) into a graphology DirectedGraph DAG. This is the structural analysis rendering path — it validates templates by producing a DAG that can be checked for cycles, type compatibility, and topological ordering.
Acceptance Criteria
src/host/graphology.tsexportsGraphologyHostConfigimplementing ujsxHostConfig<WorkflowTag, GraphNode, GraphContext>WorkflowTag: "operation" | "sequential" | "parallel" | "conditional" | "map"GraphNode:{ key: string; attributes: OperationNodeAttrs | TemplateNodeAttrs }GraphContext:{ graph: DirectedGraph; parentStack: string[]; operationRegistry?: OperationRegistry }createRootContext: creates freshDirectedGraphwith DAG constraints, empty parentStackcreateInstance("operation", props, ctx): adds graph node withOperationNodeAttrs, returnsGraphNodecreateInstancefor structural containers: returnsGraphNodewith synthetic key__${tag}_${counter++}, no graph node created (containers are transparent)appendChildfor Sequential children: creates sequential edges between consecutive siblings (managesparentStack)appendChildfor Parallel children: no inter-child edges, pushes parallel group marker for successor connectionsappendChildfor Conditional: creates conditional edge withdataFlow: true- Edge attributes include
edgeTypeanddataFlowinference (conservative strategy: conditional always dataFlow: true, sequential with result references → dataFlow: true, otherwise dataFlow: false) finalizeInstance: cleans up parentStack after container children are renderedremoveChild: removes edge between parent and child (structural containers are transparent)removeChildFromHost: removes child node from graph and all attached edges- Cycle detection after rendering: if
hasCycle()returns true, throwCycleError - Re-exported from
src/host/index.ts - Integration tests: render Sequential → assert node/edge structure, render Parallel → assert no inter-child edges, render Conditional → assert conditional edges with dataFlow, nested compositions, cycle detection
References
- docs/architecture/host-configs.md — GraphologyHostConfig full specification
- docs/architecture/workflow-templates.md — edge creation rules, root node handling, template→DAG conversion
- docs/architecture/schema.md — TemplateEdgeAttrs, dataFlow inference
Notes
To be filled by implementation agent
Summary
To be filled on completion