Skip to content

Update dependency dev.hegel:hegel to v0.14.3 - #186

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/dev.hegel-hegel-0.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/dev.hegel-hegel-0.x

Conversation

@renovate

@renovate renovate Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
dev.hegel:hegel (source) 0.11.1 → 0.14.3 age confidence

Release Notes

hegeldev/hegel (dev.hegel:hegel)

v0.14.3

This release updates the bundled libhegel engine to 0.53.2.

v0.14.2

This patch sets a lower bound for the probability of checking a sampled invariant.

v0.14.1

This patch names a run of a @HegelTest method after the test, its @DisplayName or the method name.

v0.14.0

This release moves date and time generation into the engine, which draws time zones from this JVM's own zone rules or from a pinned IANA time zone database it bundles, gathers every date and time generator into the new Generators.Temporals class under the names every Hegel frontend shares, and adds instants(), zonedDatetimes() and spans() along with the date and time options every frontend shares. A few changes can break existing code or tests.

The date and time factories are now static methods of the nested class Generators.Temporals, so with import static dev.hegel.Generators.*; they are written Temporals.dates(), Temporals.times(), Temporals.datetimes(), Temporals.zonedDatetimes(), Temporals.instants(), Temporals.offsets() (a ZoneOffset), Temporals.zones() (a ZoneId), Temporals.durations() (a Duration) and Temporals.spans() (a Period). Their generator classes and enums move to the package dev.hegel.generators.temporal, named after the factories: DateGenerator, TimeGenerator, DateTimeGenerator, ZonedDateTimeGenerator, InstantGenerator, OffsetGenerator (was dev.hegel.generators.ZoneOffsetGenerator), ZoneGenerator, DurationGenerator, SpanGenerator, OffsetGranularity and Ambiguous. The top-level Generators.dates(), times(), datetimes(), zoneOffsets(), zoneIds() and durations(), and DateTimeGenerator.timezones(...) (now zones(...)), keep working as deprecated aliases, but code that names one of the moved classes needs its import updated, and code compiled against an earlier version needs recompiling, since the aliases' return types moved with the classes:

// before
import static dev.hegel.Generators.*;
import dev.hegel.generators.DateGenerator;
import dev.hegel.generators.ZoneOffsetGenerator;

DateGenerator days = dates().min(LocalDate.of(2020, 1, 1));
ZoneOffsetGenerator offsets = zoneOffsets();
Generator<ZonedDateTime> zoned = datetimes().timezones(zoneIds());

// after
import static dev.hegel.Generators.*;
import dev.hegel.generators.temporal.DateGenerator;
import dev.hegel.generators.temporal.OffsetGenerator;

DateGenerator days = Temporals.dates().min(LocalDate.of(2020, 1, 1));
OffsetGenerator offsets = Temporals.offsets();
Generator<ZonedDateTime> zoned = Temporals.datetimes().zones(Temporals.zones());

Temporals.durations() spans the whole signed range Duration represents, from Long.MIN_VALUE to Long.MAX_VALUE seconds, shrinking toward Duration.ZERO. Most of that range is beyond what Duration.toNanos() and toMillis() can return, so code that converts wants bounds. The deprecated Generators.durations() still draws what it always did, a non-negative duration of at most Long.MAX_VALUE nanoseconds (about 292 years), and this is the same generator under the new name:

// before
Generator<Duration> gen = durations();

// after
Generator<Duration> gen = Temporals.durations().min(Duration.ZERO).max(Duration.ofNanos(Long.MAX_VALUE));

The constructor DurationGenerator(long minNanos, long maxNanos) is gone; use new DurationGenerator(Duration min, Duration max) or the min and max methods.

Every generator of a value with a date in it draws years 1 to 9999 by default: dates(), datetimes(), zonedDatetimes(), instants(), and the LocalDate, LocalDateTime, OffsetDateTime, ZonedDateTime and Instant fields Generators.forType and record derivation fill in. Explicit bounds reach the engine's whole range of years [-999999, 999999]. A bound that is not set stays at the default, so a lower bound beyond the year 9999 needs an upper bound as well, the two in either order, as in dates().min(LocalDate.of(12000, 1, 1)).max(LocalDate.of(12999, 12, 31)); a generator made by dates().min(LocalDate.of(12000, 1, 1)) alone fails its first draw with an IllegalArgumentException that says so.

zones() (and the deprecated zoneIds()) returns a ZoneGenerator rather than a Generator<ZoneId>, and draws the names ZoneId.getAvailableZoneIds() lists; link names such as Asia/Calcutta are included and legacy names such as EST5EDT excluded by default. Code holding the result in a Generator<ZoneId> variable still compiles; code that relied on legacy names appearing asks for them:

Generator<ZoneId> zones = Temporals.zones().allowLegacy(true);
Generator<ZoneId> canonical = Temporals.zones().allowLinks(false);
Generator<ZoneId> some = Temporals.zones().names("Europe/London", "Asia/Kolkata");

Half the zone draws are weighted toward zones with a rare feature (a fractional offset, negative daylight saving, a skipped day), and a name shrinks toward UTC through the zones a reader recognises, rather than alphabetically.

The new zonedDatetimes() draws a ZonedDateTime as a zone and a wall-clock time in one engine draw, and datetimes().zones(zones) now returns one too: one draw in twenty on average lands within a second, an hour or a day of one of the zone's daylight-saving or offset transitions, or of a well-known instant such as the Unix epoch. A repeated wall time is drawn as either instant by default, or as the one ambiguous(Ambiguous.EARLIER) or LATER asks for, and a skipped wall time, which a ZonedDateTime cannot hold, is never drawn. Bounds are either on the wall clock (min/max of a LocalDateTime) or on the instant (min/max of an Instant or a ZonedDateTime); setting both kinds on one generator is an IllegalArgumentException.

Generator<ZonedDateTime> transitions = Temporals.zonedDatetimes()
        .zones(Temporals.zones().names("America/New_York"))
        .min(LocalDateTime.of(2024, 1, 1, 0, 0))
        .max(LocalDateTime.of(2024, 12, 31, 23, 59))
        .ambiguous(Ambiguous.LATER);

The engine targets each zone's transitions using the zone data of a ZoneSource. The default, ZoneSource.javaTime(), uploads this JVM's own ZoneRules the first time a generator needs them, so drawn values agree exactly with java.time. ZoneSource.bundled() is the engine's pinned IANA release (whose version Temporals.tzdbVersion() reports), which aims draws at the same transitions on every JVM; a drawn value still means what this JVM's rules say, and a wall-clock time this JVM skips rejects the test case rather than failing it. ZoneSource.builder() assembles a source from other data, to aim draws at transitions this JVM's database does not have yet or to draw from fewer zones: TZif bytes, ZoneRules, a function from instants to offsets, links, and names declared up front and loaded on first use. Building a source uploads its data, so build one once, in a static field, and share it; version() reports the release a source holds:

static final ZoneSource VENDOR = ZoneSource.builder()
        .rules("America/New_York", vendorRules)
        .version("vendor-3")
        .build();

Generator<ZoneId> names = Temporals.zones().source(VENDOR);
Generator<ZonedDateTime> zoned = Temporals.zonedDatetimes().source(VENDOR);

zones().source(source) and zonedDatetimes().source(source) set the source of one generator, and ZoneSource.setDefault(source) the default for the process, returning the default it replaced so that a caller can put it back. A generator reads the default when it is created and keeps that source afterwards. zonedDatetimes() uses the source of the zones() generator it is given, and giving it both such a generator and source(...) is an IllegalArgumentException. The zones of any other generator, such as just(zone) or a filtered zones(), are looked up by name in the source given to source(...), or else in the default, and a region zone that source does not know is an IllegalArgumentException naming it. A ZoneOffset needs no zone data and is drawn in directly:

Generator<ZoneId> american = Temporals.zones().source(VENDOR).filter(z -> z.getId().startsWith("America/"));
Generator<ZonedDateTime> zoned = Temporals.zonedDatetimes().zones(american).source(VENDOR);
Generator<ZonedDateTime> fixed = Temporals.zonedDatetimes().zones(just(ZoneOffset.ofHours(5)));

dates() takes weekdays(DayOfWeek...) and months(Month...) to draw only, say, weekends or Februaries, moving a drawn date to the nearest allowed one rather than filtering, and targets the leap days nearest the bounds, the year boundaries, the 2038 and 2106 overflow days and ISO week 53 in one draw of twenty on average. times(), datetimes(), instants(), durations() and zonedDatetimes() take a precision(ChronoUnit) of NANOS (the default), MICROS, MILLIS, SECONDS, MINUTES or HOURS, so every drawn value is a whole number of that unit. offsets() takes a granularity(OffsetGranularity) of hours, quarter-hours, minutes or seconds and targets the offsets real zones have used. The new instants() draws Instant values, and spans() draws Period values with each of years, months and days independently signed, or nonNegative(true); enabling a unit replaces the default of all three. By default each unit spans the whole int range, which LocalDate.plus(Period) overflows for most draws, so a span that will be added to a date wants bounds:

Generator<Period> stays = Temporals.spans().days(1, 30).months(0, 11).nonNegative(true);
Generator<Instant> recent =
        Temporals.instants().min(Instant.parse("2020-01-01T00:00:00Z")).precision(ChronoUnit.MILLIS);

The fluent methods of every one of these generators can be called in any order: the same calls make the same generator, which works or fails the same way, however they are ordered. Settings that cannot work together are an IllegalArgumentException from the method that gives the last of them, as the date and time generators always reported them, never from the first draw: bounds in the wrong order, bounds with no date on an allowed weekday and month or no value at the precision, a zone name that the source given to source(...) does not know or that its loader fails for. So zones().names(...) takes names of whichever source the generator ends up with, and source(...) may come before or after it.

A setting that was not given counts as its default only when the generator first draws, so one that conflicts with nothing but a default, which a later call can still replace, is reported by the first draw, as an IllegalArgumentException thrown inside the test: a min beyond the year 9999 with no max, a zone name the default zone source lacks when source(...) is never called, a zone source none of whose zones allowLinks and allowLegacy admit when names(...) is never called.

Generators.forType and record derivation now cover Instant, Period, Year, YearMonth and MonthDay as well as LocalDate, LocalTime, LocalDateTime, ZonedDateTime, OffsetDateTime, ZoneId, ZoneOffset and Duration; DayOfWeek and Month draw as any enum does.

The low-level Libhegel binding contract gains the engine's new functions: generateDate takes a date options handle and generateTime and generateDatetime a precision, and generateTimestamp, generateOffset, generateDuration, validateDate, validateTime, validateDatetime, validateTimestamp, validateOffset, validateDuration, generateTimezone, generateZonedDatetime, generateZonedDatetimeForZone, generateSpan, the dateOptions*, timezoneSpec*, zonedSpec* and spanSpec* handle functions (each spec with a *Validate), timezoneInfo, timezoneOffsetAt, timezoneResolve, the zoneSource* functions (zoneSourceSetLoader takes a hook run when the engine releases the loader), setDefaultZoneSource and tzdbVersion are new. A custom binding needs to implement them.

v0.13.0

This release moves to the engine's new test-case output protocol, in which libhegel decides what a test case's output is used for and prints it itself.

A run at Verbosity.VERBOSE now shows, through the run's Reporter.engineOutput, a one-line summary of each failing test case right after that case's draws and notes — the file and line of the test it was thrown from, then the exception, for example SortTest.java:23: java.lang.AssertionError: not sorted — and a Test case stopped: failed assumption or Test case stopped: out of data line for each case that was rejected or ran out of data. At Verbosity.DEBUG each failing test case shows its full stack trace instead. The stack trace is only rendered when the engine will use it. The default report of a failure is unchanged.

TestCase.isFinal() is removed. The engine now decides which test cases' output it uses, and that set (every test case of a verbose run, and the executions a failure report is built from) no longer matches what the name promised. A frontend built on dev.hegel:hegel-lowlevel can ask the engine directly with Libhegel.testCaseWantsOutput.

Reporter.silent() now gives the engine no output destination, so a verbose or debug run with it renders nothing nobody would see.

The dev.hegel:hegel-lowlevel binding contract changes with the C ABI: Libhegel.testCaseShouldCapture is replaced by Libhegel.testCaseWantsOutput and Libhegel.testCaseWantsDetail, Libhegel.markComplete takes a failure's summary and detail after its origin, and Libhegel.failureOutput and Libhegel.failureDiagnostic are new. A null output callback now means no destination rather than stderr; pass the new Libhegel.STDERR to have the engine print to stderr. The output callback passed to Libhegel.testCaseFromBlob is now kept alive until the test case is released with testCaseFree, since the engine prints the replay's output when the test case completes.

v0.12.5

This release updates the bundled libhegel engine to 0.51.6.

v0.12.4

This patch adds pauseFaults to @Invariant. An invariant declared with @Invariant(pauseFaults = true) is bracketed by the engine's new hegel_pause_faults / hegel_unpause_faults calls every time it runs (on the initial state, at each sampled join point and on the final state, in both the sequential and the concurrent driver), and is unpaused even when it throws:

class IntegerStack {
  @Rule
  void push(TestCase tc) { ... }

  @Invariant(pauseFaults = true)
  void sizeIsNonNegative(TestCase tc) {
    assertTrue(stack.size() >= 0);
  }
}

The flag is meant for tests that run inside Antithesis, where it pauses fault injection for the duration of the invariant so a fault cannot land in the middle of the check. Outside Antithesis the flag has no effect.

The dev.hegel:hegel-lowlevel binding contract gains the matching Libhegel.pauseFaults and Libhegel.unpauseFaults methods.

v0.12.3

This release updates the bundled libhegel engine to 0.51.4.

v0.12.2

This release updates the bundled libhegel engine to 0.51.3.

v0.12.1

This release updates the bundled libhegel engine to 0.51.2.

v0.12.0

This release adds Hegel.main, for writing a test as a standalone program. A program runs one test case and takes its settings from the command line. --help lists the options.

public static void main(String[] args) {
    Hegel.main(args, tc -> {
        int x = tc.draw(integers());
        assertEquals(x + 0, x);
    });
}

The process exits with status 0 if the test case passes, 1 if it fails or the run ends in an error, and 2 if the command line is invalid.

In dev.hegel:hegel-lowlevel, Libhegel gains settingsFromString (hegel_settings_set_from_string), setDefaultProfile (hegel_set_default_profile), settingsGetVerbosity (hegel_settings_get_verbosity) and settingsGetSuppressHealthCheck (hegel_settings_get_suppress_health_check).

v0.11.2

This patch adds a weighted generator for booleans, booleans(double p).

booleans(1.0) // always true
booleans(0.7) // 70% probability of true
booleans(0.0) // always false

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot requested a review from JonathanO as a code owner November 11, 2026 03:38
@renovate
renovate Bot force-pushed the renovate/dev.hegel-hegel-0.x branch from a00b966 to 1a9a237 Compare November 13, 2026 17:41
@renovate renovate Bot changed the title Update dependency dev.hegel:hegel to v0.12.0 Update dependency dev.hegel:hegel to v0.12.4 Nov 13, 2026
@renovate
renovate Bot force-pushed the renovate/dev.hegel-hegel-0.x branch from 1a9a237 to d18c6a7 Compare November 16, 2026 22:04
@renovate renovate Bot changed the title Update dependency dev.hegel:hegel to v0.12.4 Update dependency dev.hegel:hegel to v0.12.5 Nov 16, 2026
@renovate
renovate Bot force-pushed the renovate/dev.hegel-hegel-0.x branch from d18c6a7 to 51e9259 Compare November 18, 2026 21:32
@renovate renovate Bot changed the title Update dependency dev.hegel:hegel to v0.12.5 Update dependency dev.hegel:hegel to v0.13.0 Nov 18, 2026
@renovate
renovate Bot force-pushed the renovate/dev.hegel-hegel-0.x branch from 51e9259 to 52b17cd Compare November 19, 2026 19:56
@renovate renovate Bot changed the title Update dependency dev.hegel:hegel to v0.13.0 Update dependency dev.hegel:hegel to v0.14.1 Nov 19, 2026
@renovate
renovate Bot force-pushed the renovate/dev.hegel-hegel-0.x branch from 52b17cd to d51fb5e Compare November 20, 2026 23:45
@renovate renovate Bot changed the title Update dependency dev.hegel:hegel to v0.14.1 Update dependency dev.hegel:hegel to v0.14.2 Nov 20, 2026
@renovate
renovate Bot force-pushed the renovate/dev.hegel-hegel-0.x branch from d51fb5e to c36a16b Compare November 25, 2026 03:00
@renovate renovate Bot changed the title Update dependency dev.hegel:hegel to v0.14.2 Update dependency dev.hegel:hegel to v0.14.3 Nov 25, 2026
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.

0 participants