Clean up inconsistencies in public API and documentation#11
Draft
DRMacIver wants to merge 9 commits into
Draft
Conversation
…tors The engine schema honors only one of the two keys (verified against the real engine: with both sent, the exclusion is silently ignored), so TextGenerator emitted categories and dropped exclude_categories whenever both were configured. Throw IllegalArgumentException at configuration time instead of silently generating excluded characters. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
maxSize(-1) silently meant "unbounded" because -1 is the C ABI's internal UNBOUNDED sentinel; any other negative value already threw. The public fluent setters now reject all negative values with an IllegalArgumentException telling the user to omit the call for no bound. The sentinel stays internal (factory methods still use it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The default Settings name (which derives the example-database key) was the bare method name, so same-named test methods in different classes shared replay-database entries. The default is now the fully-qualified declaring class name plus the method name. Existing database entries stored under bare-method-name keys will no longer be found (a one-time invalidation); explicit name overrides are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion Rebased remnant of "Document fromRegex's unanchored semantics and add a fullmatch overload": main's regex-fullmatch-default change (PR #9) has since made fromRegex generate whole-string matches by default with a fullmatch(boolean) opt-out, superseding the overload and the unanchored documentation. What remains from the original commit: document that patterns use the engine's Python re dialect (which differs from java.util.regex.Pattern in some constructs), and strengthen the previously-vacuous GeneratorSmokeTest assertion (length() >= 0) to pin the fullmatch semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
durations() silently clamped its range to [0, Long.MAX_VALUE] nanoseconds even though java.time.Duration is signed (and Hypothesis's timedeltas covers negatives). The engine's integer schema accepts negative bounds (verified against the real engine), so the default range is now the full signed nanosecond range [Long.MIN_VALUE, Long.MAX_VALUE] (~±292 years) and min()/max() accept negative bounds. Use durations().min(Duration.ZERO) for the old non-negative behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The javadoc said "single-character strings", but size is measured in codepoints: a supplementary-plane draw has String.length() == 2, which breaks naive charAt(0) use. Say so, recommend codePointAt(0), and note that further size calls replace the one-codepoint contract. Add a conformance test demonstrating length-2 single-codepoint values. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- datetimes() swapped the two zone methods: timezones(Generator<? extends ZoneId>) produces ZonedDateTime and offsets(Generator<ZoneOffset>) produces OffsetDateTime, not the other way round. - forType(Class) advertised List/Set/Optional/Map support that the Class-based signature cannot express (those work only as record components, where the declared element types are known), and omitted the supported java.time scalars. Document the actual supported set, the record-component restriction, and the thrown HegelException; pin forType(List.class) throwing in DerivationTest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Maven and Gradle snippets still said 0.1.0; the latest release per the CHANGELOG (and the pom) is 0.4.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RELEASE_TYPE is minor per the zerover guidance (breaking changes only): the durations() range change, the categories()/excludeCategories() conflict now throwing, the negative-maxSize rejection, and the example-database key qualification can all break existing usage. The fromRegex bullet from the pre-rebase entry is gone: main's 0.4.0 release already shipped fullmatch-by-default fromRegex, superseding it; only the Python-re dialect documentation remains from that commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3bca1d1 to
c8d9b06
Compare
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.
Implementation details (AI-generated)
Fixes from a documentation-vs-behavior audit of the public API:
characters().categories(...).excludeCategories(...)now throws — the engine accepts both keys but ignores the exclusion, so the combination silently did nothing.maxSizeis always rejected; the-1unbounded sentinel of the engine ABI no longer leaks through the public API.@HegelTestdatabase keys are qualified by declaring class, so same-named test methods in different classes no longer share replay state (changelog notes the one-time invalidation of existing keys).fromRegexdocumented as unanchored, Python-dialect; added a workingfullmatchoverload (default remains unanchored).durations()now generates negative durations by default — the engine supports the full signed range, and the docs promised it.datetimes(),forType(), andcharacters(); README updated to 0.3.0.RELEASE.md(RELEASE_TYPE: minor) for the release automation.Verification: 220 tests plus the invoker integration test pass, jacoco 100% instruction and branch coverage, spotless and javadoc clean (built on JDK 25, matching the CI matrix).
🤖 Generated with Claude Code