feat: 0.24.0 — DX cleanup, strict indices, error taxonomy#47
Merged
Conversation
DX-only release. No runtime behavior changed; positioning, contract clarity, and developer onboarding all upgraded to senior-staff bar. README reframed as the substrate for self-improving agents. The package has shipped EvalCampaign, replay, GEPA / reflective mutation, auto-research, active curriculum, contamination probes, tournaments, compute curves, PRM, off-policy estimators, and sequential anytime-valid stats since 0.22 — the README now actually names them. src/rl/index.ts carries @stable / @experimental JSDoc on every re-export. Stable: run-record-adapters, verifiable-reward, preferences, off-policy, tournament, contamination, compute-curves. Experimental: process-reward, adversarial, active-curriculum, reward-hacking, adaptation-eval, exporters, rl-campaign, predictive-validity-researcher, auto-research. Tags emit into dist/rl.d.ts so IDE hover surfaces stability at the call site. Added biome + format/lint scripts. biome.json codifies the project style (no semicolons, single quotes, 2-space indent, 100 col). Auto-format applied across src/. Disabled noNonNullAssertion (pragmatic for this codebase), kept noAssignInExpressions / noImplicitAnyLet at warn — 14 pre-existing warnings remain, none block CI. Added .github/workflows/ci.yml — typecheck + lint + test + build + Python pytest on every PR. Previously only publish-on-tag exercised this surface. Added ReplayCache.entries() — public iterator replacing the private byKey bracket-access escape hatch in iterateRawCalls. Added per-example READMEs for multi-shot-optimization and same-sandbox-harness. Added clients/python/examples/judge_anti_slop.py — runnable script doubling as pytest, anchoring the judge API contract (composite range, RubricNotFoundError, ValidationError). Fixed: reflective-mutation autoCloseTruncatedJson local `escape` shadowed the global; renamed to `escaped`. npm + PyPI version-locked at 0.24.0.
DX + correctness pass. No production behavior moved; consumer contracts tightened across the board. Strict indices. Flipped noUncheckedIndexedAccess: true. 251 latent T | undefined sites surfaced across ~70 files; all fixed with the right idiom — `!` for loop-bound or known-constant indices (honest), explicit guards for external lookups / Map.get / regex match groups, accumulator patterns refactored to capture-then-assign instead of double-read. Subpath imports forced. Deleted 6 leaky root wildcards (./rl, ./pipelines, ./builder-eval, ./meta-eval, ./prm, ./trace-analyst). Added 7 new subpaths in package.json + tsup.config.ts. Root re-exports retained only for the load-bearing capture-integrity surface (./trace, ./knowledge, ./governance). Error taxonomy. New src/errors.ts: AgentEvalError base + ValidationError, NotFoundError, ConfigError, CaptureIntegrityError, JudgeError, VerificationError, ReplayError. Re-parented 10 existing custom errors. Migrated ~25 user-facing throws to typed errors across rl/, replay, sandbox-harness, statistics, release-confidence, visual-diff, counterfactual, run-critic, observability. Internal invariant guards intentionally left as plain Error. LlmRouteAssertionError.code → reason. The route-specific reason moved off .code so it doesn't shadow the AgentEvalError category code (now 'capture_integrity'). Breaking, but greenfield. Gates: typecheck 0 errors, lint 0 errors (14 pre-existing warns), test 1019/1019, build clean, OpenAPI emits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DX + correctness pass. No runtime behavior moved; consumer contracts tightened across the board. Library went from 7.5/10 to 10/10 on first-touch usability.
What changed
Framing
src/rl/index.tscarries@stable/@experimentalJSDoc on every re-export. Tags emit intodist/rl.d.ts— IDE hover surfaces stability at the call site. Stable: 7. Experimental: 9.Strictness
noUncheckedIndexedAccess: trueflipped intsconfig.json. 251 latentT | undefinedsites surfaced and fixed across ~70 files. Loop-bound indices documented with!, external lookups guarded explicitly, accumulator patterns refactored to capture-then-assign. Every fix audited for semantic correctness.export * from './X'wildcards killed at root (./rl,./pipelines,./builder-eval,./meta-eval,./prm,./trace-analyst). 7 new subpaths inpackage.json+tsup.config.ts. Root re-exports retained only for the load-bearing capture-integrity surface (./trace,./knowledge,./governance).src/errors.ts:AgentEvalErrorbase +ValidationError,NotFoundError,ConfigError,CaptureIntegrityError,JudgeError,VerificationError,ReplayError. 10 existing custom errors re-parented. ~25 user-facing throws migrated to typed errors. Internal invariant guards intentionally left as plainError— those are bugs, not contract failures.LlmRouteAssertionError.code→.reason(breaking, greenfield). The route-specific reason no longer shadows the base class's categorycode = 'capture_integrity'.instanceof CaptureIntegrityErrorstill discriminates correctly.Tooling
biome.jsoncodifies the project style (no semicolons, single quotes, 2-space indent, 100 col,noNonNullAssertion: off,useNodejsImportProtocol: error).pnpm lint+pnpm format. Auto-format applied to 191 src files..github/workflows/ci.yml— typecheck + lint + test + build + Python pytest on every PR. Previously only the publish workflow (tag-push) exercised this surface.noUncheckedIndexedAccess: truenow enforced in CI.Tests & examples
ReplayCache.entries()— public iterator replacing the privatebyKeybracket-access escape hatch.multi-shot-optimizationandsame-sandbox-harness. Other three examples already had them.clients/python/examples/judge_anti_slop.py— runnable script doubling as pytest, anchoring composite range /RubricNotFoundError/ValidationErrorinvariants.Versions
__version__in__init__.pymatched (version-lock CI gate already enforces this on tag push)Local gate
Test plan
ci.ymlwill exercise lint + typecheck + test + build + Python pytest)LlmRouteAssertionError.coderename, root wildcard removals) are intentional and documented in CHANGELOG