testsAndMisc/docs/superpowers/contracts/reverse-survivors-status-effects-2026-08-09.json
Krzysztof kuhy Rudnicki 43b63ac266 reverse_survivors: survivor status effects (slow, suppress, bleed)
The warden mires, the artillery stifles, the leech unknits. All three need
contact, so a survivor that kites cleanly takes none of them — debuffs
punish positional failure rather than taxing existence.

isOn/factor are written as arithmetic rather than comparisons:
Math.min(1, Math.ceil(t)) is 1 while a timer is live and 0 once it expires,
so consumers multiply instead of branching. The whole status module
therefore contributes zero branches, which is what makes the 100% gate
affordable for a system this cross-cutting. Statuses are applied
unconditionally too; a 0-duration spec is a provable no-op.

applyStatus uses Math.max, so re-applying refreshes rather than stacks.
That caps a horde's total lockdown at one duration by construction — a
structural guarantee, not a tuned number.

123 tests, 100% coverage. Branches 117 -> 119: the draw halo gate and the
snapshot chip filter. The status logic itself adds none.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VFyXexNjMQG9V7K8de17fc
2026-08-09 23:08:51 +02:00

17 lines
1.4 KiB
JSON

{
"title": "Reverse Survivors: survivor status effects",
"objective": "Give the survivor three debuff channels - slow (movement), suppress (fire rate) and bleed (regen block) - so ranged and fast units have a lever beyond raw damage. The system must be cross-cutting yet contribute zero branches, so the 100% coverage gate stays affordable.",
"acceptance_criteria": [
"`npm run check` passes standalone: tsc --noEmit clean, eslint --max-warnings 0 clean, vitest at 100% statements/branches/functions/lines.",
"The status module itself adds zero branches, verified against the v8 branch count (117 -> 119 accounted for solely by the draw halo gate and the snapshot chip filter).",
"Re-applying a status refreshes rather than stacks, so total lockdown is capped at one duration regardless of horde size.",
"An enemy that inflicts nothing leaves all three timers at exactly 0.",
"Survivor-fired projectiles can never debuff the survivor."
],
"out_of_scope": [
"Director powers and difficulty tiers, which ship as separate commits.",
"Aura or ranged-application debuffs: all three require contact by design, so a cleanly kiting survivor takes none."
],
"verifier": "npm run check (typecheck + eslint --max-warnings 0 + vitest --coverage at 100%), plus targeted sim.test.ts assertions comparing slowed movement against an unslowed control run"
}