Files
flowgraph/tasks/host-reactive.md

50 lines
2.5 KiB
Markdown

---
id: host/reactive
name: Implement ReactiveHostConfig — render ujsx template to reactive execution engine
status: completed
depends_on:
- component/operation
- component/sequential
- component/parallel
- component/conditional
- component/map
- reactive/workflow-root
- reactive/node-status
- schema/edge-attrs
scope: broad
risk: critical
impact: phase
level: implementation
---
## Description
Implement the `ReactiveHostConfig` that renders a ujsx workflow template into a reactive execution engine with signal-backed `NodeStatus` tracking, computed preconditions, and failure propagation. This is the runtime execution rendering path.
## Acceptance Criteria
- [ ] `src/host/reactive.ts` exports `ReactiveHostConfig` implementing ujsx `HostConfig<WorkflowTag, WorkflowNode, ReactiveContext>`
- [ ] `WorkflowNode`: `{ key, type, status: Signal<NodeStatus>, preconditions: Computed<boolean>, blockedByFailure: Computed<boolean>, operationId?, output?: Signal<unknown>, children: WorkflowNode[] }`
- [ ] `ReactiveContext`: `{ operationRegistry, nodes: Map, statusSignals: Map, preconditions: Map, blockedByFailure: Map, resultProjection: EventLogProjection, parentMap, siblingMap, results: Map }`
- [ ] `createInstance("operation", props, ctx)`: creates `WorkflowNode` with status signal from `ReactiveContext`, registers in context maps
- [ ] `createInstance` for structural containers: creates WorkflowNode tracking children but no graph node
- [ ] Prerequisite computation: Sequential child → previous sibling completed/skipped; Parallel child → parent's preconditions met; Conditional child → condition evaluates to true
- [ ] Status propagation: effects on `preconditions` and `blockedByFailure` drive state transitions
- [ ] `removeChild`: removes parent-child dependency, preconditions/blockedByFailure auto-re-evaluate (reactive)
- [ ] `removeChildFromHost`: disposes node's signal references from context maps
- [ ] Re-exported from `src/host/index.ts`
- [ ] Integration tests: render template → assert signal initial states, transition predecessor → assert dependent precondition updates, failure propagation, Conditional as error boundary
## References
- docs/architecture/host-configs.md — ReactiveHostConfig full specification, WorkflowNode, ReactiveContext
- docs/architecture/reactive-execution.md — signal-backed execution model, precondition computation, status propagation
- docs/architecture/workflow-templates.md — template→reactive execution conversion
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion