Skip to content

release: v0.3.1 (fingerprint + Pool double-count fixes)#8

Merged
oniani1 merged 3 commits intomasterfrom
release/v0.3.1
Apr 16, 2026
Merged

release: v0.3.1 (fingerprint + Pool double-count fixes)#8
oniani1 merged 3 commits intomasterfrom
release/v0.3.1

Conversation

@oniani1
Copy link
Copy Markdown
Owner

@oniani1 oniani1 commented Apr 16, 2026

Summary

  • Fixes the mysql2 Pool CI failure by guarding nested patched calls with AsyncLocalStorage
  • Cuts v0.3.1 with the hardening-pass fixes visible to users
  • Refreshes landing-page stats to match reality

Fixes

  • fingerprint: normalize negative numeric literals consistently (WHERE id = -1 and WHERE id = 1 now share a fingerprint). Previously silent miss.
  • drivers: skip re-recording when an outer patched method is already active. mysql2 Pool.query internally delegates to a patched Connection.query and ALS propagates, causing 2× recording. Guarded with a fresh AsyncLocalStorage flag.
  • drivers: mysql2 queries that emit error without end (connection-level failures) now record correctly.

Features

  • New type exports from the package root: StackFrame, QueryGuardError, ScalingError, ScalingDetection, ScalingReport, AssertScalingOptions, AssertOptions.

Test plan

  • 242 unit tests pass locally
  • typecheck with noUncheckedIndexedAccess passes
  • lint clean
  • build succeeds
  • CI integration job passes (previously failed on Pool double-count; fixed here)
  • CI claims gate (pack size ≤ 40 KB, zero runtime deps) passes
  • Overhead bench within baseline

Release steps after merge

  1. Merge to master
  2. Tag v0.3.1 on master, push tag
  3. .github/workflows/publish.yml triggers and runs pnpm publish --provenance
  4. Requires NPM_TOKEN secret to be set on the repo — if it isn't, I'll flag that as a blocker

🤖 Generated with Claude Code

oniani1 and others added 3 commits April 17, 2026 00:12
… active

mysql2 Pool.query internally delegates to Connection.query. Both prototypes
are patched and AsyncLocalStorage propagates through mysql2's getConnection
boundary, so the same user-observable query recorded twice — surfacing in CI
as a Pool N+1 test that saw 6 occurrences instead of 3.

Guard with an AsyncLocalStorage flag set by the outermost patched call. A
nested patched call sees the flag and invokes the original directly without
recording. pg is unaffected because its Pool.connect callback does not
preserve ALS (the existing Pool-layer patching still records as before).

Add a unit test that exercises the nested-call path with a custom original
that delegates to an inner patched method.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bump package version, add changelog entry, and refresh landing-page stats
(package size, test count, overhead) to reflect the hardening pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GitHub Pages deploys from docs/. The previous commit only updated site/, so
the live landing page kept the stale 18KB / 128 tests / 0% numbers. Sync
the same refresh to docs/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oniani1 oniani1 merged commit 7508444 into master Apr 16, 2026
5 of 6 checks passed
@oniani1 oniani1 deleted the release/v0.3.1 branch April 16, 2026 20:24
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