# REASONING — Hermes Pipeline Tool

## 2026-06-26

- Wrote `PLAN.md` before code as required by protocol.
- Chose vanilla TypeScript + SVG instead of a diagramming framework to keep bundle size low and make graph/evaluator/view separation explicit.
- Started with public-contract Vitest coverage for `src/lib/dag.ts` before implementing the module, matching the hidden import path.
- Verified RED with `npm test`: tests failed because `src/lib/dag` and `src/lib/editorGraph` were intentionally missing.
- Implemented the pure DAG core first using Kahn topological sorting over dependency-to-dependent edges. Missing input ids are ignored for cycle sorting but evaluate as zero, matching the brief.
- Added editor graph conversion/cycle guards separately from rendering so the UI can refuse invalid connections while hidden tests can import the pure library without DOM dependencies.
- Built the UI with vanilla TS, absolutely positioned nodes, SVG Bezier wires, pan/zoom transforms, wire hit testing, delete selection, JSON save/load, and the `window.__buildoff` performance hook.
- Fixed strict TypeScript issues from unused imports and transient drag-state narrowing before final verification.
- Ran the full objective command chain: `npm ci && npm run build && npm test && npm run lint && test -d dist && du -sh dist`. It passed; Vite reported ~4.80 kB gzipped JS and `dist/` size of 28K.
- Browser-smoked the production build via `npx vite preview --host 127.0.0.1 --port 4175`. The app loaded with no console errors, and `window.__buildoff.workload()` returned `{ nodes: 300, evals: 100, avgEvalMs: 0.354... }`.
