--- id: review/foundation name: Review foundation layer — schemas, errors, FlowGraph class, construction status: completed depends_on: - schema/enums - schema/node-attrs - schema/edge-attrs - schema/graph-schemas - error/hierarchy - graph/flowgraph-class - graph/construction-operation - graph/construction-call - graph/construction-json - graph/queries - graph/validation scope: broad risk: low impact: phase level: review --- ## Description Review the foundation layer before proceeding to analysis components, host configs, and reactive execution. Verify schemas match architecture docs, errors are correctly structured, and FlowGraph construction preserves DAG invariants. ## Acceptance Criteria - [ ] All TypeBox schemas match [schema.md](../docs/architecture/schema.md) — no missing fields, no extra fields - [ ] Error hierarchy matches [error-handling.md](../docs/architecture/error-handling.md) — all classes have correct properties - [ ] FlowGraph class wraps graphology correctly per [flowgraph-api.md](../docs/architecture/flowgraph-api.md) - [ ] Operation graph construction: fromSpecs builds correct nodes and edges - [ ] Call graph construction: fromCallEvents and updateFromEvent process all event types correctly - [ ] JSON round-trip is lossless for both operation and call graphs - [ ] All query methods delegate correctly to graphology-dag - [ ] Validation functions return structured errors, never throw - [ ] All tests pass: `npm test` - [ ] TypeScript strict mode compilation succeeds: `npx tsc --noEmit` ## References - docs/architecture/schema.md, docs/architecture/error-handling.md, docs/architecture/flowgraph-api.md - docs/architecture/operation-graph.md, docs/architecture/call-graph.md ## Notes > To be filled by implementation agent ## Summary > To be filled on completion