Files
fusion/docs/test-velocity-baseline.md
gsxdsm 8f4897d3aa FN-6905: add build preflight to velocity measurement
Add a non-measured build setup step so velocity baselines do not misclassify missing dist artifacts as lane time.

- Run a default `pnpm build` preflight before measured test velocity lanes, with an explicit skip flag for pre-built CI.
- Add injectable command-runner coverage for preflight ordering, failure reporting, and skip behavior.
- Document the preflight behavior in the generated baseline report and testing docs.

Files changed:
 docs/test-velocity-baseline.md                    |   2 +
 docs/testing.md                                   |   4 +-
 scripts/__tests__/test-velocity-baseline.test.mjs | 159 ++++++++++++++++++++++
 scripts/test-velocity-baseline.mjs                |  38 +++++-
 4 files changed, 195 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6905

Fusion-Task-Lineage: 3016a542-4395-4d06-9f2e-1a91f4939e07
2026-06-21 22:29:13 -07:00

4.5 KiB

Test velocity baseline

Weekly FN-6612 signal-per-second baseline. Measure and report feedback-loop velocity; do not add slow tests or wire this report into blocking PR checks. The merge gate remains the existing thin Lint, Typecheck, Build, and Gate path.

Latest baseline

  • Cycle: 2026-W26
  • Captured at: 2026-06-22T04:22:44.873Z
  • Timing snapshot: scripts/test-timings.json captured at 2026-06-03T23:45:49.672Z
  • Quarantine ledger: scripts/lib/test-quarantine.json

Metrics

Metric Current Delta vs previous
Merge gate wall-time (pnpm test:gate) 8.3s +2.9s
Boot smoke wall-time (pnpm smoke:boot) unavailable n/a
Changed-only test wall-time (pnpm test) 48.8s +41.5s
Quarantine / flake count 0 0
Deletion-due quarantines 0 n/a

Measurement failures

  • Boot smoke (pnpm smoke:boot): exit 1 after 406ms

Slowest 20 test files

Rank File Package Duration
1 packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.test.ts @fusion/engine 13.9s
2 packages/core/src/__tests__/agent-store.test.ts @fusion/core 11.6s
3 packages/dashboard/src/__tests__/routes-agents.test.ts @fusion/dashboard 11.2s
4 packages/core/src/__tests__/mission-store.test.ts @fusion/core 10.7s
5 packages/core/src/__tests__/db.test.ts @fusion/core 10.1s
6 packages/dashboard/src/__tests__/routes-git.test.ts @fusion/dashboard 9.4s
7 packages/engine/src/__tests__/reliability-interactions/branch-group-automerge-precedence.test.ts @fusion/engine 9.0s
8 packages/engine/src/__tests__/merger-ai.test.ts @fusion/engine 8.7s
9 packages/engine/src/__tests__/reliability-interactions/branch-group-merge-routing.test.ts @fusion/engine 8.4s
10 packages/engine/src/__tests__/reliability-interactions/branch-group-promotion-gate.test.ts @fusion/engine 8.4s
11 packages/core/src/__tests__/task-documents.test.ts @fusion/core 8.3s
12 packages/engine/src/runtimes/__tests__/in-process-runtime.test.ts @fusion/engine 7.8s
13 packages/cli/src/__tests__/extension.test.ts @runfusion/fusion 7.0s
14 packages/core/src/__tests__/run-audit.test.ts @fusion/core 6.9s
15 packages/engine/src/__tests__/reliability-interactions/branch-group-promotion.test.ts @fusion/engine 6.1s
16 packages/dashboard/src/__tests__/routes-planning.test.ts @fusion/dashboard 5.6s
17 packages/core/src/__tests__/store-merge-queue.test.ts @fusion/core 5.2s
18 packages/dashboard/app/components/__tests__/FileEditor.test.tsx @fusion/dashboard 5.1s
19 packages/engine/src/__tests__/reliability-interactions/integration-worktree-state.test.ts @fusion/engine 4.9s
20 packages/engine/src/__tests__/self-healing-already-merged.real-git.test.ts @fusion/engine 4.9s

Quarantine age buckets

Age bucket Count
0-6 days 0
7-13 days 0
deletion due (>=14 days) 0
unknown/future 0

Deletion-due entries

File Quarantined at Age (days)
— — —

Before / after trend

Row Captured at Gate Boot smoke pnpm test Quarantine count
Previous 2026-06-18T16:12:01.248Z 5.4s 18.1s 7.2s 0
Latest 2026-06-22T04:22:44.873Z 8.3s unavailable 48.8s 0
Delta — +2.9s n/a +41.5s 0

Future weekly rows append to scripts/test-velocity-history.json; compare the latest row against the previous row before posting to #leads.

Post to #leads

FN-6612 weekly test velocity: gate 8.3s (+2.9s), boot smoke unavailable (n/a), pnpm test 48.8s (+41.5s), quarantine ledger 0 (0). Slowest file: packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.test.ts at 13.9s. Deletion-due quarantines: 0.

How to refresh

pnpm test:velocity -- --measure --write-report

In measure mode, the script runs a non-measured pnpm build preflight before timing pnpm test:gate, pnpm smoke:boot, or pnpm test. The preflight time is setup only and is excluded from lane metrics; if it fails, the Measurement failures section records Build preflight (pnpm build) as the reason. Use --skip-build-preflight only when the workspace is already built by CI.

Report-only regeneration is cheap and does not run any suite:

pnpm test:velocity