Skip to content

planted-bugs: km-censored-as-death matched three sites in lib/stats.ts - #64

Merged
alisman merged 1 commit into
masterfrom
session/page-mutants
Oct 23, 2026
Merged

alisman merged 1 commit into
masterfrom
session/page-mutants

Conversation

@alisman

@alisman alisman commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Reproduction

The planted-bugs job has failed on master since #59 merged:

Error: km-censored-as-death: expected the bug's site exactly once in lib/stats.ts, found 3

The new kmMedianCi and rmst functions repeat kaplanMeier's tie-counting line word for word. The planted bug's search text therefore matched three places, and the check stopped before planting anything.

Fix

The search text now takes in the next line, const atRisk = atRiskAt(t);. Only kaplanMeier has that line; the other two read the risk set as n.

Testing

  • All 18 planted bugs' search texts now match exactly once in their files.
  • With this bug planted, npm test fails 14 tests, so the check still catches it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TyVfAhLnjshk2kWewGnLum

kmMedianCi and rmst repeat kaplanMeier's tie-counting line, so the planted bug's site matched three
times in lib/stats.ts and the check stopped before planting anything (failing on master since #59).
The site now takes in the next line, which only kaplanMeier has. All 18 sites match exactly once;
with this one planted, 14 unit tests fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TyVfAhLnjshk2kWewGnLum
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Oct 23, 2026 2:44pm UTC
cohort-lab Ready Ready Preview Oct 23, 2026 2:44pm UTC

Request Review

@alisman
alisman merged commit dcd5746 into master Oct 23, 2026
8 checks passed
@alisman
alisman deleted the session/page-mutants branch October 23, 2026 14:44

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 438a7c72 Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant