template/.planning/phases/02-pathfinding/02-05-PLAN.md

6.7 KiB

phase plan type wave depends_on files_modified autonomous gap_closure requirements estimate must_haves
02-pathfinding 05 execute 4
02-03
vite.config.ts
package.json
true true
PATH-01
PATH-02
tokens raw_tokens tasks confidence
16000 16000 2 low
truths artifacts key_links
The complete Vitest suite has enough hook timeout budget for the two phase suites whose beforeAll imports exceeded the default threshold under full-suite load.
The repository exposes a deterministic non-watch full-suite command that reports a passing run without timeout-induced skipped tests.
The quality gate validates the existing data-side path entry and does not introduce mobile click wiring contrary to D-11.
vite.config.ts
package.json
Vitest reads the root Vite test configuration when `pnpm exec vitest run` or the repository test script executes.
The CI-style script invokes Vitest run mode rather than the existing watch-mode `pnpm test` script.
Make the Phase 2 full-suite quality gate reliable by addressing the observed beforeAll timeout cascade and exposing a reproducible non-watch command that confirms the suite completes without skipped tests.

Purpose: Verification recorded two hook-timeout failures and eight tests skipped as a consequence of those failed hooks, even though focused path tests passed. The fix must stabilize the runner gate without changing pathfinding behavior or the D-11 rendering scope. Output: Root Vitest timeout configuration and a deterministic test:ci package script, validated by repeated full-suite runs.

<execution_context> @C:/Users/book/.config/opencode/gsd-core/workflows/execute-plan.md @C:/Users/book/.config/opencode/gsd-core/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/02-pathfinding/02-VERIFICATION.md @.planning/phases/02-pathfinding/02-VALIDATION.md @.planning/phases/02-pathfinding/02-RESEARCH.md @.planning/phases/02-pathfinding/02-03-SUMMARY.md @vite.config.ts @package.json @packages-user/data-state/src/coreEventLayer.test.ts @packages-user/data-state/src/path/heroPathfinding.test.ts Task 1: Stabilize Vitest hook execution under the full-suite load vite.config.ts vite.config.ts, package.json, packages-user/data-state/src/coreEventLayer.test.ts, packages-user/data-state/src/path/heroPathfinding.test.ts, .planning/phases/02-pathfinding/02-VERIFICATION.md Make the root configuration Vitest-aware by using the existing vitest/config defineConfig entry point and add explicit test and hook timeout budgets of 30 seconds. This addresses the observed default 10-second beforeAll failures in coreEventLayer.test.ts and heroPathfinding.test.ts while leaving test bodies, fixture behavior, plugin setup, aliases, and data/render separation unchanged. Do not alter any client action or map-pointer code; the Phase 2 data-side entry remains the only PATH-02 artifact per D-11. $first = pnpm exec vitest run 2>&1; $first; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; $second = pnpm exec vitest run 2>&1; $second; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; $all = ($first + $second) -join "`n"; if ($all -match 'hook timed out|[1-9][0-9]* skipped|[1-9][0-9]* failed') { exit 1 } Either full-suite run exits non-zero, or combined output reports a hook timeout, a positive skipped-test count, or a positive failed-test count. Two consecutive executions of the existing full-suite command finish successfully without beforeAll hook timeouts, timeout-induced skipped tests, or failed tests. Task 2: Add a reproducible CI-style full-suite entry point package.json package.json, .planning/phases/02-pathfinding/02-VALIDATION.md, dev.md Add a `test:ci` script that invokes `vitest run` without watch mode, preserving the existing `test` script for interactive development. Use the already-installed Vitest dependency and do not add packages, reporters that hide failures, or a separate click-flow test that would contradict D-11. The command must be suitable as the phase-wide gate for PATH-01 and the delivered data-side PATH-02 entry. $output = pnpm test:ci 2>&1; $output; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; if ($output -match 'hook timed out|[1-9][0-9]* skipped|[1-9][0-9]* failed') { exit 1 } The test:ci command exits non-zero, or its output reports a hook timeout, a positive skipped-test count, or a positive failed-test count. `pnpm test:ci` is a non-watch, zero-exit full-suite gate with no timeout-induced skipped tests, and the existing interactive `pnpm test` behavior is unchanged.

<threat_model>

Trust Boundaries

Boundary Description
Test runner configuration → repository test execution Timeout and script settings control whether initialization failures are surfaced or converted into skipped dependent tests.

STRIDE Threat Register

Threat ID Category Component Severity Disposition Mitigation Plan
T-02-08 Denial of Service Vitest beforeAll hooks medium mitigate Set explicit hook/test budgets above the observed import cost and require two consecutive full-suite runs with no timeout or skipped-test summary.
T-02-09 Repudiation package test gate low mitigate Add a named non-watch test:ci command and retain the complete Vitest exit status instead of masking failures.
T-02-SC Tampering npm/pip/cargo installs low accept No package installation is part of this gap closure.
</threat_model>
- `pnpm exec vitest run` passes twice consecutively after the timeout configuration change. - `pnpm test:ci` passes as the named non-watch full-suite gate. - The full-suite output contains no hook timeout, skipped-test, or failed-test count. - No client-side click handler or Phase 1 file is modified.

<success_criteria> The verified full-suite gap is closed: the suite completes reliably under the configured hook budget, dependent tests are not skipped by initialization timeouts, and a reproducible CI-style command exists for phase verification. The D-11 Phase 4 rendering boundary remains intact. </success_criteria>

Create `.planning/phases/02-pathfinding/02-05-SUMMARY.md` when done