Skip to content

test(streaming): kill piezoStream surviving mutants (#591 hit list)#665

Merged
ng merged 3 commits into
devfrom
test/piezostream-mutants-591
Jul 12, 2026
Merged

test(streaming): kill piezoStream surviving mutants (#591 hit list)#665
ng merged 3 commits into
devfrom
test/piezostream-mutants-591

Conversation

@ng

@ng ng commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Works this week's top entry on the mutation hit list (#591): src/streaming/piezoStream.ts, 151 surviving mutants — the largest single contributor after last week's mqttBridge pass (#635).

  • ~30 new tests + tightened assertions in existing ones, targeting the survivor list extracted from run 29145443368's mutation-report-streaming artifact:
    • readRawRecord: direct byte-level tests — every seq/data CBOR encoding width (inline/1/2/4/8-byte), the 23-byte inline boundary, per-byte key corruption, exact error messages, data: null for placeholders, exact nextOffset.
    • findIndexEntry: boundary-exact binary-search assertions (kills the </<= and loop-condition mutants).
    • decodeSensorFrames: primitive/null inner values must not abort the batch.
    • Seek: full-window replay is not silently truncated (64 MB cap regression), window boundary is inclusive at exactly +30s, replay stops for good at the first out-of-window frame, incomplete/droppedFrames absent on clean replays, distinct error messages for no-file vs no-frames, numeric-string and Infinity timestamps rejected.
    • Tail loop: split-record delivery is exactly-once with a seekable index offset (leftover-buffer offset accounting), resync warnings carry exact byte counts, resync from a malformed record that itself starts with 0xa2, Pod 3 scalar capSense snapshot, non-frzHealth frames don't reach server listeners.
    • Lifecycle: shutdown actually closes the listening port, connect/disconnect/drop-count log lines asserted (field-debugging surface per docs/DEBUGGING.md).
  • One minimal source change: readRawRecord, findIndexEntry, int32BufferToArray, decodeSensorFrames added to the existing __test__ export so the parser can be tested without a WS server per assertion.
  • New /mutation-hitlist skill (.claude/skills/mutation-hitlist/): packages the weekly workflow — issue lookup, artifact download, survivors.py extraction, killing-test playbook by mutator type, known equivalent-mutant categories, CI-based verification.

Expected remaining survivors are the documented equivalent classes: module-level initializer mutants (false survivors under the vitest runner's module cache), timing/perf-only values (poll intervals, yield cadence, read-chunk sizes), and double-guarded checks. The mutation-test label on this PR triggers the scoped CI run for exact numbers.

Test plan

  • pnpm exec vitest run src/streaming/tests/piezoStream.test.ts — 91 passed, 0 failed
  • eslint clean on both changed files
  • mutation-test label applied → CI mutation run on this PR posts the before/after summary
  • Compare PR mutation summary against the 151-survivor baseline; comment results on 📊 Mutation testing — weekly baseline #591
🛏️ Beam this PR onto a sleepypod

Pick the snippet that matches your pod. Already-installed pods can't use the curl bootstraps below — sleepypod's egress firewall DROPs github.com, and the script that knows how to unblock WAN is the very file curl is trying to fetch. Use sp-update instead; it's on disk and opens WAN as its first step.

🔄 Already on a sleepypod (most common — review a PR on a running pod):

sudo sp-update test/piezostream-mutants-591

🚀 Fresh pod / first install — bootstraps from GitHub, rebuilds every push:

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/test/piezostream-mutants-591/scripts/install \
  | sudo bash -s -- --branch test/piezostream-mutants-591

🎯 Pin to this exact build (run 29174117551 · 3081292) — fresh-pod path, locked to one CI artifact for reproducible review:

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/3081292a8fc9bb6ae3c496199798d784208a39a2/scripts/install \
  | sudo bash -s -- \
      --branch test/piezostream-mutants-591 \
      --artifact-url 'https://nightly.link/sleepypod/core/actions/runs/29174117551/sleepypod-core.zip'

🧊 Artifact: sleepypod-core · self-destructs in 30 days 💥

@ng ng added the mutation-test Opt-in: trigger mutation testing on this PR label Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ng, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5cdd9cac-68ac-4b64-bb43-3107bae02603

📥 Commits

Reviewing files that changed from the base of the PR and between 613b69a and 3081292.

📒 Files selected for processing (4)
  • .claude/skills/mutation-hitlist/SKILL.md
  • .claude/skills/mutation-hitlist/survivors.py
  • src/streaming/piezoStream.ts
  • src/streaming/tests/piezoStream.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/piezostream-mutants-591

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ng
ng enabled auto-merge (squash) July 12, 2026 00:43
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@ng
ng merged commit 9316e94 into dev Jul 12, 2026
8 checks passed
@ng
ng deleted the test/piezostream-mutants-591 branch July 12, 2026 00:43
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

Mutation test report

Shard Score Killed Survived No cov Timeout Errors Total
mutation-report-db (report missing)
hardware-lib 68.2% 1667 592 180 7 985 3456
homekit 62.6% 290 164 9 0 201 689
hooks 73.5% 886 296 23 1 483 1707
server 59.5% 1421 595 371 2 1682 5117
services-scheduler 73.2% 561 186 16 3 251 1019
streaming 83.3% 1014 165 27 12 411 1638

Full HTML reports: mutation-report-<shard> artifacts. Actionable hit list: mutation-hitlist artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mutation-test Opt-in: trigger mutation testing on this PR released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant