Skip to content

test: scroll-edge-state has zero direct tests and a 28.75% mutation score — write the missing suite #1455

Description

@thymikee

Context

mutation-baselines/decision-kernels.json (the pre-graduation baseline for the mutation gate, see #1415 and mutation-affected.yml/mutation-weekly.yml) records scroll-edge-state at 28.75% mutation score — 92 killed / 228 survived of 320 mutants, the worst of the five designated decision kernels. Root cause: src/utils/scroll-edge-state.ts (326 LOC of real decision logic) has no dedicated test file anywhere in the repogrep -rl 'scroll-edge-state' --include='*.test.ts' src test returns nothing. Its only coverage is incidental exercise through settle-related suites, which kills barely a quarter of mutants.

This matters now because scripts/mutation/ratchet.ts graduates a kernel to gating purely on score stability across weekly runs (requiredStableRuns: 2), with no minimum-score bar — so this 28.75% floor could become permanently enforced-as-is (see companion issue about the ratchet policy).

Task

Write src/utils/scroll-edge-state.test.ts (or src/utils/__tests__/, match the dominant convention in src/utils/) as a direct behavioral suite for the module's exported API.

Acceptance criteria

  • Tests target behavior of every exported function/state transition of scroll-edge-state.ts — read the module and its call sites (settle/scroll paths) first to write assertions about decisions (edge reached? direction? progress?) not implementation details.
  • Run pnpm mutation:run scoped to this kernel (see scripts/mutation/run.ts --help / stryker config for per-target invocation) before and after; report both scores in the PR. Target: ≥85% on the module. Use the stryker HTML report's surviving-mutant list to drive test additions — each surviving mutant is either killed or explicitly justified in the PR (e.g. equivalent mutant).
  • Do NOT update mutation-baselines/decision-kernels.json by hand — regenerate via pnpm mutation:baseline if the workflow requires it, per docs/agents/testing.md.
  • No production-code changes unless a genuine bug is exposed (if so: fix + regression test in the same PR, called out in the description).
  • Suite is deterministic (no timers/race dependence — note repo memory: unit lanes suffer under CPU contention; keep tests pure-logic).
  • pnpm test:unit and pnpm check:tooling green.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions