Tasks · 001-find-the-shortest-path-between-two
Least-weight shortest path
Ordered, parallelizable work. Tests precede implementation. Drive through with
/spectastic.implement — one task per invocation.
001-find-the-shortest-path-between-two
Created
Read time
Restored from a tracer-bullet graduation. This task list is the refactor-to-comply
path (not a clean rebuild): the build was kept. Source archive:
explorations/archive/001-find-the-shortest-path-between-two/. The classification was read from that
frozen marker, not re-chosen — so the kept code is moved into place and brought under the gates, and no
prototype-deletion task appears (that is the spike path).
Seven tasks. Setup → Foundational (move the kept build) → US1 (tests fail first, then refactor to comply) → Restore gates. Tasks marked [P] can run in parallel. The US1 tests MUST be written and failing before the kept code is moved to satisfy them.
1 · Execution strategy
US1 is the whole MVP: the least-weight finder. Land it end-to-end, then close the restore gates.
Setup → Foundational → US1 → Restore gates. The kept build only counts as complied once its tests pass green.
Single module — no parallel-team split. The [P] tasks are file-independent within one pair of hands.
2 · Phase 1 — Setup
src/pathfinding/ and tests/ dirs so the move and the suite have a home. src/pathfinding/ · tests/3 · Phase 2 — Foundational
Bring the kept build out of the archive. Behaviour-preserving — no logic changes in this phase.
graph.ts to the module — the Graph/Edge types and cost(), unchanged from the archived spike. src/pathfinding/graph.tsdijkstra.ts to the module — the kept dijkstraPath(), unchanged. src/pathfinding/dijkstra.ts4 · Phase 3 — US1 · The cheapest route, not the shortest-looking one
Tests (write & fail first)
A→B→C→D→E at cost 6 (SC-001), an unreachable goal returns null (SC-002), and a hop-count path is strictly more expensive than Dijkstra's on the sample (NFR-001). tests/pathfinding.test.tsImplementation
dijkstraPath + cost to the moved module so the failing suite passes green, covering FR-001, FR-002, FR-003, FR-004. src/pathfinding/dijkstra.tsCloses FR-001, FR-002, FR-003, FR-004, SC-001, SC-002, NFR-001.
5 · Phase 4 — Restore the gates
Re-impose the SDD rigor the exploration relaxed. The build is kept; these tasks make it accountable to the spec.
spectastic validate over the spec/design/tasks bundle and clear it at the standard profile. specs/001-find-the-shortest-path-between-two/6 · Dependencies
Setup → Foundational (move the kept build)
Foundational → US1 tests (fail) → US1 refactor-to-comply (green)
US1 → Restore gates
7 · Change log
- Restored via
/spectastic.tasks --restoreon the tracer-bullet graduation. Refactor-to-comply path.