Files
alknet/tasks/architecture/spec-flowgraph.md
glm-5.1 19b3d3a078 docs: write Phase 0 architecture foundation — ADRs 026-034, spec docs, and task updates
Phase 0a — ADRs (9 new):
- ADR-026: Transport/interface separation (three-layer model)
- ADR-027: Crate decomposition (core, secret, storage, flowgraph, napi, CLI)
- ADR-028: Auth as irpc service (AuthProtocol behind feature flag)
- ADR-029: Identity as core type (Identity + IdentityProvider in alknet-core)
- ADR-030: Static/dynamic config split (ArcSwap, ConfigReloadHandle)
- ADR-031: Forwarding policy (rule-based allow/deny, TransportKind-aware)
- ADR-032: Event boundary discipline (domain, irpc, call protocol boundaries)
- ADR-033: OperationEnv universal composition (three dispatch paths)
- ADR-034: Head/worker terminology (replace hub/spoke)

Phase 0b — New spec documents (7):
- identity.md, services.md, interface.md, configuration.md,
  storage.md, flowgraph.md, secret-service.md

Updated existing docs:
- auth.md: reference identity.md for canonical definitions, add AuthProtocol
- open-questions.md: resolve OQ-12, OQ-16, OQ-18, OQ-22, OQ-23-25
- README.md: add all new docs, ADRs 026-034

Marked 19 architecture tasks as completed.
2026-06-07 09:32:58 +00:00

52 lines
2.2 KiB
Markdown

---
id: architecture/spec-flowgraph
name: Create flowgraph.md architecture spec (or stub referencing crate docs)
status: completed
depends_on:
- architecture/adr-027-crate-decomposition
scope: narrow
risk: low
impact: component
level: implementation
---
## Description
Create `docs/architecture/flowgraph.md` — an architecture spec for the `alknet-flowgraph` crate, covering FlowGraph<N,E>, operation graph construction, call graph population, and type compatibility checking.
Like storage.md, this can be a contract-level document if the crate will have its own docs later. The key contract point: `OperationSpec` and `CallNodeAttrs` types must match alknet-core's definitions, with serialization as the bridge.
**Source**: `docs/research/flow.md` (472 lines, straightforward port of TypeScript design)
This is the lowest-risk new spec — pure computation crate, no I/O, no external state, straightforward petgraph port.
## Acceptance Criteria
- [ ] `docs/architecture/flowgraph.md` exists with YAML frontmatter (`status: draft`)
- [ ] Follows spec format: What, Why, Architecture, Constraints, Open Questions, Design Decisions
- [ ] Documents `FlowGraph<N, E>` generic graph over `petgraph::DiGraph`
- [ ] Documents `NodeAttributes` / `EdgeAttributes` traits
- [ ] Documents operation graph construction from `OperationSpec`s
- [ ] Documents call graph population from `EventEnvelope` events
- [ ] Documents type compatibility checking (jsonschema)
- [ ] Documents cycle detection, topological sort, reachability queries
- [ ] Documents serde serialization/deserialization
- [ ] States crate dependencies: petgraph, serde, serde_json, jsonschema, thiserror
- [ ] States crate does NOT depend on alknet-core, alknet-storage, or alknet-secret
- [ ] States interface back to core: OperationSpec and CallNodeAttrs types match alknet-core's definitions; bridge is serialization
- [ ] References ADR-027
- [ ] `docs/architecture/README.md` updated to include flowgraph.md
## References
- docs/research/flow.md — full FlowGraph, operation graph, call graph design
- docs/research/integration-plan.md — Phase 2.3 (alknet-flowgraph)
- docs/architecture/decisions/027-crate-decomposition.md
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion