Skip to content

v3.0.0 review fixes, cleanup, and coverage#41

Merged
abrisene merged 15 commits intov3.0.0from
v3.0.0-fixes
Mar 12, 2026
Merged

v3.0.0 review fixes, cleanup, and coverage#41
abrisene merged 15 commits intov3.0.0from
v3.0.0-fixes

Conversation

@abrisene
Copy link
Copy Markdown
Owner

Summary

  • Fix all 31 issues from the v3.0.0 review (P0-P3 correctness, API surface, DX)
  • Add statistical validation tests for distributions, blending, and masking
  • Extract helpers, remove dead code, fix consistency issues
  • Achieve full coverage for foundational services (mersenne-twister, random, sampler)
  • Remove unreachable geometric/harmonic fallback paths in blend.ts
  • Restructure docs: docs/ for documentation, .site/ for typedoc output
  • Move planning files (ISSUES.md, PLAN.md) to gitignored docs/.local/
  • Bump version to 3.0.0-alpha.1

Commits (13)

  • Fix P0-P2 correctness bugs and add input validation
  • Add ISSUES.md tracker and PLAN.md implementation plan
  • Fix remaining P1-P3 issues: validation, docs, rename, optimization
  • Add DX improvements: backward(), freeze/toMutable, fix stale docs
  • API surface improvements for v3.0.0
  • Add statistical validation tests for distributions, blending, and masking
  • Bump version to 3.0.0-alpha.1
  • Remove commented-out dead code from tests and production files
  • Extract validateWeights/arithmeticMean helpers, fix bool() consistency
  • Achieve full coverage for foundational services
  • Move ISSUES.md/PLAN.md to gitignored docs/.local, clean up stale TODO
  • Remove unreachable geometric/harmonic fallback paths in blend.ts
  • Restructure docs: docs/ for documentation, .site/ for typedoc output

Test plan

  • All 189 tests pass
  • Typecheck clean
  • Coverage: 98.05% stmts, 90.35% branch, 99.47% funcs
  • Foundational services at 100% stmts/funcs

🤖 Generated with Claude Code

abrisene and others added 13 commits March 11, 2026 12:36
- Fix Distribution.new() shared singleton mutation (#1)
- Fix Box-Muller and logistic log(0) singularity (#2)
- Fix pickWeighted masking to redistribute proportionally (#3)
- Deep-clone gram distributions in MarkovChain.clone() (#4)
- Fix blend weight renormalization for geometric/harmonic (#5, #6)
- Fix single-distribution blend reference leak (#10)
- Fix ImmutableMultiDimMarkovChain engine sharing (#7)
- Add parameter validation to all 14 sampler methods (#11)
- Add stateKeyRegistry collision detection + unregisterStateKey (#13)
- Add generate() min/max validation + empty-string rejection (#14)
- Add Weibull 3-parameter location support (#18)
- Document `as this` subclass limitation on immutable variants (#8)
- Add NaN/Infinity validation to Distribution.addSourceValues/addNormalValues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Document MultiDimMarkovChain.addSequence clone-on-write asymmetry (#9)
- Add delimiter collision warning in addSequence (#12)
- Add maxOrder > 0 validation in MarkovChain constructor/new (#14)
- Document Poisson draw count divergence (#15)
- Rename truncatedNormal → clampedNormal, keep deprecated alias (#16)
- Optimize ImmutableMultiDimMarkovChain.addSequence (#17)
- Document MT_PREWARM constant rationale (#19)
- Document analyze() PRNG side effects (#20)
- Document constraint retry cap in generate() (#21)
- Document PRNG correlation on fork for immutable variants (#22)
- Export MersenneTwister19937 and createEntropy for advanced use (#23)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add backward() as primary method, deprecate last() (#27)
- Add freeze()/toMutable() bridges between mutable and immutable variants (#29)
- Fix stale Jest→Vitest and random-js→MT19937 references in CHANGELOG/README (#31)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Mark internal static methods and DTO types with @internal (#24, #25)
- Convert Distribution.pick and MarkovChain.new to options objects (#26)
- Replace MCInsertOption boolean|string with false|string union (#28)
- Add int()/float() aliases on Random, mark real()/integer() internal (#30)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…king

- 12 distribution shape tests: mean/variance/range over 10k samples
- Blend strategy validation: arithmetic 50/50, geometric/harmonic sanity
- Masking proportional redistribution test over 10k picks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract validateWeights() in distribution.ts to deduplicate NaN/Infinity checks
- Extract arithmeticMean() in blend.ts to deduplicate 3 identical reduces
- Fix bool() to use this.real() instead of bypassing instance method
- Remove leftover commented-out code in distribution.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tests for Random.int/float aliases and pickWeighted edge cases
- Add sampleDistribution tests for all remaining distribution types
- Test RandomSampler.engine getter
- Remove unused bool() export from mersenne-twister

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pre-filter at L83-91 already excludes entries with value <= 0,
making the subsequent nonZeroValues check always true. Removed the
dead else branches to improve coverage and reduce confusion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move hand-written docs from readme/ to docs/
- Typedoc now outputs to .site/ (gitignored)
- Update CI workflow, package.json clean script, readme links
- docs/.local/ remains gitignored for planning files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
abrisene and others added 2 commits March 11, 2026 22:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix all 15 prettier formatting errors across 5 files
- Consolidate 4 separate CI jobs into one sequential pipeline
  per node version (lint → typecheck → test → build)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abrisene abrisene merged commit 73bb6f2 into v3.0.0 Mar 12, 2026
6 checks passed
@abrisene abrisene deleted the v3.0.0-fixes branch March 12, 2026 05:59
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