Skip to content

java-sdk 2.0.0: idiomatic API - #27

Open
joalves wants to merge 58 commits into
mainfrom
next/major
Open

joalves wants to merge 58 commits into
mainfrom
next/major

Conversation

@joalves

@joalves joalves commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

java-sdk 2.0.0: idiomatic API

Status: owner decisions accepted 2026-11-17; implemented on next/major.

java-sdk is the reference implementation and the core that kotlin-sdk (an idiomatic Kotlin wrapper for any JVM,
servers and Android), android-sdk (built on kotlin-sdk) and scala-sdk wrap. 2.0 is where all breaking changes
live: the API is reshaped to read like modern Java (LaunchDarkly, Statsig, Optimizely and PostHog's Java SDKs are the
peers), while assignment, exposure, publish and refresh behaviour stays byte-for-byte the 1.x behaviour and the
cross-SDK contract (javascript-sdk is the contract reference; every cross-sdk-tests scenario must pass).

Owner decisions

All accepted by the owner on 2026-11-17.

# Decision Accepted
1 Platform floor Java 11 (no records, sealed types or pattern matching in the public API). Android consumes 2.x with core library desugaring.
2 Artifact Keep com.absmartly.sdk:core-api, now at 2.x. core-api-java6 is not continued in 2.x (1.x keeps it).
3 Package Keep com.absmartly.sdk. 1.x and 2.x cannot share a classpath (same artifact id), so a .v2 package buys nothing.
4 Events A typed listener (client.onEvent(...), context.onEvent(...), typed event classes) plus a java.util.concurrent.Flow.Publisher<ContextEvent> (events()).
5 JSON Jackson stays, shaded and relocated to com.absmartly.sdk.internal.shaded.jackson. It never conflicts with the user's Jackson and no Jackson type is in the public API.
6 Async Keep blocking + ...Async (CompletableFuture) pairs for context creation, publish, refresh and close.
7 Naming Brand spelling ABsmartly (ABsmartlyClient); records-style accessors (units(), not getUnits()).
8 Lifecycle 1.x moves to release/1.x when 2.0 merges and gets bug fixes for 12 months (see SUPPORT.md). No compat shim: MIGRATING.md only.
9 Transport java.net.http.HttpClient is the default behind a Transport interface, in a class Android never loads (see Platform).

Goals and non-goals

  • One entry point, one immutable options type per scope, structured state, typed variables, typed errors and typed
    events.
  • Nothing in the public API that a Kotlin or Scala layer has to undo: JSpecify nullability everywhere
    (@NullMarked packages, explicit @Nullable), no checked exceptions, immutable value types, CompletableFuture
    for I/O, synchronous thread-safe reads.
  • No behaviour change. Hashing, variant assignment, audiences, assignment rules, holdouts, switchbacks, exposure
    de-duplication, publish batching, retry and refresh are the 1.x engine, moved, not rewritten. The 1.x unit suite is
    ported 1:1 (only call sites renamed) and the cross-sdk-tests suite runs against both lines.
  • Not in 2.0: a Spring Boot starter (a separate optional artifact later), a compat shim.

API before and after

Area 1.x 2.0
Entry point ABSmartly.create(ABSmartlyConfig.create().setClient(Client.create(ClientConfig.create().setEndpoint(e)...))) or ABSmartly.builder() ABsmartlyClient.builder().endpoint(URI.create(e)).apiKey(k).application(a).environment(env).build()
Config types ABSmartlyConfig, ClientConfig, Client, DefaultHTTPClientConfig (mutable, setters) ABsmartlyClient.Builder (+ JdkHttpTransport.Builder for HTTP tuning)
HTTP HTTPClient + Apache HttpClient 5 DefaultHTTPClient Transport + JdkHttpTransport (java.net.http): the 1.x retry policy (5 retries on 502/503, dropped connections and connect timeouts; no retry on a refused connection; same back-off) and redirects (followed, never https to http)
Context options ContextConfig.create().setUnit(...).setAttribute(...) (mutable) ContextOptions.builder().unit(...).attribute(...).build() (immutable)
Create, block sdk.createContext(cfg).waitUntilReady() (a failed load still returns) client.context(options) returns a ready context or throws ContextLoadException
Create, async sdk.createContext(cfg).waitUntilReadyAsync() client.contextAsync(options) (CompletableFuture<Context>, fails with ContextLoadException)
Create, not awaited sdk.createContext(cfg) client.newContext(options), then context.ready() / context.readyAsync()
Prefetched data sdk.createContextWith(cfg, data) / sdk.getContextData() (Jackson model) client.context(options, data) / client.contextData() (opaque ContextData with toJson()/fromJson())
State isReady() isFailed() isClosing() isClosed() isFinalizing() isFinalized() state() → ContextState { LOADING, READY, FAILED, CLOSING, CLOSED }, failure()
Load error readyError() failure() (@Nullable Throwable)
Treatment getTreatment(e) / peekTreatment(e) treatment(e) / peekTreatment(e)
Variables Object getVariableValue(k, Object def) <T> T variable(k, T def) (typed by the default), <T> T variable(k, Class<T>, T def) (maps JSON objects to your type), untyped variableValue(k, def); peekVariable… twins
Variable keys getVariableKeys() variableKeys()
Experiments String[] getExperiments() List<String> experiments()
Custom fields getCustomFieldKeys(), getCustomFieldValue(e, k), getCustomFieldValueType(e, k) customFieldKeys(), customFieldValue(e, k), customFieldType(e, k)
Units setUnit, setUnits, getUnit, getUnits, getUnitValue(s) setUnit, setUnits, unit(t), units()
Attributes setAttribute(s), getAttribute, getAttributes setAttribute(s), attribute(n), attributes()
Overrides setOverride(s), getOverride setOverride(s), override(e), overrides(), clearOverride(e)
Custom assignments setCustomAssignment(s), getCustomAssignment setCustomAssignment(s), customAssignment(e), customAssignments(), clearCustomAssignment(e)
Goals track(goal, Map<String, Object>) track(goal), track(goal, Map<String, ?>)
Publish / refresh / close publish()/publishAsync(), refresh()/refreshAsync(), close()/closeAsync(), finalizeAsync() same pairs; finalize* removed; blocking twins throw the unwrapped ABsmartlyException instead of CompletionException
Pending getPendingCount() pendingEventCount()
Data getData() (Jackson model) data() (opaque ContextData)
Events ContextEventLogger.handleEvent(Context, EventType, Object) EventListener.onEvent(ContextEvent); ReadyEvent, RefreshEvent, ExposureEvent, GoalEvent, PublishEvent, CloseEvent, ErrorEvent, each with type() for a Java 11 switch; events() → Flow.Publisher<ContextEvent>
Errors IllegalStateException, IllegalArgumentException, raw Exception(statusMessage) in CompletionException unchecked ABsmartlyException root: ContextNotReadyException, ContextClosedException, ContextLoadException, UnitAlreadySetException, HttpStatusException(statusCode), RequestTimeoutException, DecodingException. Bad arguments stay IllegalArgumentException.
Customisation seams ContextDataProvider, ContextEventHandler, VariableParser, AudienceDeserializer, ContextDataDeserializer, ContextEventSerializer Transport (the one seam: tests, proxies, OkHttp on Android). The rest are internal.

Example

// 1.x
ABSmartly sdk = ABSmartly.create(ABSmartlyConfig.create().setClient(Client.create(ClientConfig.create()
        .setEndpoint("https://acme.absmartly.io/v1").setAPIKey(key)
        .setApplication("website").setEnvironment("production"))));
Context context = sdk.createContext(ContextConfig.create().setUnit("session_id", sid)).waitUntilReady();
if (context.isFailed()) { ... }
String color = (String) context.getVariableValue("button.color", "blue");
context.close();

// 2.0
try (ABsmartlyClient client = ABsmartlyClient.builder()
        .endpoint(URI.create("https://acme.absmartly.io/v1")).apiKey(key)
        .application("website").environment("production")
        .build();
        Context context = client.context(ContextOptions.builder().unit("session_id", sid).build())) {
    int variant = context.treatment("exp_checkout");
    String color = context.variable("button.color", "blue");
    CheckoutConfig cfg = context.variable("checkout", CheckoutConfig.class, CheckoutConfig.DEFAULT);
    context.track("purchase", Map.of("total", 19.99));
}   // close() publishes pending events

client.onEvent(event -> {
    switch (event.type()) {                       // Java 11: switch on the type enum, then cast
    case EXPOSURE:
        ExposureEvent exposure = (ExposureEvent) event;
        analytics.track(exposure.exposure().name(), exposure.exposure().variant());
        break;
    case ERROR:
        log.warn("absmartly", ((ErrorEvent) event).cause());
        break;
    default:
    }
});
// On Java 16+ user code can write `if (event instanceof ExposureEvent e)`; the SDK itself needs only Java 11.

Kotlin and Scala on top

  • Every public package is @NullMarked (JSpecify); @Nullable marks the few nullable results (unit(t),
    attribute(n), override(e), failure(), variableValue(k, def)). Kotlin sees String / String?, not
    platform types. @Nullable is preferred over Optional because Kotlin maps it to T? for free.
  • kotlin-sdk turns contextAsync into a suspend fun (await()), onEvent into a callbackFlow / SharedFlow,
    and state() into a StateFlow updated from the ReadyEvent/ErrorEvent/CloseEvent stream.
  • scala-sdk wraps CompletableFuture with FutureConverters and EventListener as a function.
  • Value types (ContextOptions, Exposure, Goal, the events) are final and immutable; their accessors are
    records-style so a later move to records (Java 16+) is source compatible.

Platform floor and why

  • Java 11 (owner decision): the oldest LTS the JVM ecosystem still widely runs and the first with
    java.net.http, Flow and CompletableFuture improvements; Java 17 would exclude a measurable set of server users
    for no API gain we use (records/sealed are not allowed in the public API anyway, to keep Android desugaring simple).
  • Android: kotlin-sdk (and through it android-sdk) consumes core-api 2.x. The Android check (Animal Sniffer,
    android-api-level-24 signature) still runs on the core sources; java.time (Duration, Instant) is ignored by
    that check because core library desugaring provides it. java.net.http is not on Android at all, so
    JdkHttpTransport is compiled from a separate source set (src/jdk) that Animal Sniffer does not check and that
    no core class references: ABsmartlyClient loads it reflectively only when the caller did not supply a
    Transport. Android callers always supply one (kotlin-sdk ships an HttpURLConnection/OkHttp transport), so ART
    never loads the class. Context.events() returns Flow.Publisher (Android API 30+); its implementation lives in
    its own class that is loaded only when events() is called, so onEvent is the Android path below API 30.
  • CI builds on JDK 11 (the floor) and tests on 11, 21 and 25.

Dependencies

1.x 2.0
org.apache.httpcomponents.client5:httpclient5 + httpclient5-fluent 5.1.3 removed (JDK HttpClient)
jackson-databind 2.13.4.2 + jackson-datatype-jsr310 (unused) jackson-databind 2.13.5 shaded and relocated into the jar (kept on 2.13 for the Android API 24 baseline; Jackson 2.14+ needs API 26). jsr310 dropped.
jsr305 3.0.2, findbugs-annotations 3.0.1 (both dead) org.jspecify:jspecify 1.0.0 (the only annotation dependency; tiny, no runtime code)
slf4j-api 1.7.30 slf4j-api 2.0.x (API-compatible for callers; bindings: any SLF4J 2 provider)
streamsupport-minifuture (java6 artifact) gone with core-api-java6

The published POM lists only slf4j-api and jspecify. A build check fails if any unrelocated com/fasterxml
class ends up in the jar.

JPMS: the jar carries Automatic-Module-Name: com.absmartly.sdk.

Behaviour parity

  • The Context engine (assignment cache, holdouts, switchbacks, exposure queue, publish/close state machine) is the
    1.x code with only public method names changed. The 1.x unit tests are ported with renamed call sites and keep the
    same assertions (752 tests on 1.9.0+main); new tests cover the new surface (typed variables, state, events, errors,
    transport).
  • ContextEventLogger semantics map 1:1 onto events: the same event kinds, fired at the same points with the same
    data. One deliberate difference: an exception thrown by a user EventListener is caught and logged instead of
    propagating into treatment()/track(). The engine paths that tolerate a throwing logger are kept and still
    tested through the internal seam.
  • Wire format: unchanged (PUT {endpoint}/context, same headers: X-API-Key, X-Application, X-Environment,
    X-Application-Version, X-Agent: absmartly-java-sdk/2.0.0, same JSON).
  • Proof: the ported unit suite, a local-HTTP-server integration test through JdkHttpTransport, and the
    cross-sdk-tests java lane (2.0 wrapper) next to the java-v1 lane (1.x wrapper).

Coexistence with 1.x

  • main becomes 2.x when this PR merges (tags v2.*). release/1.x is cut by the owner from the last 1.x tag and
    gets bug fixes for 12 months (SUPPORT.md). Fix flow: fix on main, cherry-pick to release/1.x.
  • CI (main.yml) runs on push and PR for main and release/**; publish.yml publishes on v* tags and fails
    if the tag does not equal VERSION. The same workflow files must be added to release/1.x once it is cut (a
    separate small PR).
  • Maven Central: versions coexist, nothing special. GitHub releases for v1.* tags are created with
    --latest=false so a 1.x patch never becomes "latest".
  • cross-sdk-tests: the java lane is pinned to next/major (then main), and a new java-v1 lane runs the 1.x
    wrapper against release/1.x (until it exists: the last 1.x commit on main).

Migration

See MIGRATING.md for the 1:1 table with before/after snippets. In short: replace the config objects with the two
builders, createContext(...).waitUntilReady() with client.context(options), get* accessors with their noun
forms, the is* booleans with state(), casts of getVariableValue with variable(key, default), and
ContextEventLogger with onEvent.


This PR

V1/V2 coexistence checklist

  1. CI and publish for both lines. .github/workflows/main.yml runs on push and PR for main and release/** (JDK 11 floor build + JDK 25 tests, plus a JDK 21 lane). .github/workflows/publish.yml publishes on v* tags and keeps the tag == VERSION check. The same workflow files must be added to release/1.x once the owner cuts it: a separate small PR to release/1.x will follow.
  2. Registry rules. Maven Central: versions coexist, nothing special. The GitHub release for a v1.* tag is created with --latest=false (in publish.yml), so a 1.x patch never becomes "latest".
  3. SUPPORT.md: "2.x: active. 1.x: bug fixes until <2.0 release date + 12 months> on release/1.x." The README opens with a note pointing 1.x users to release/1.x.
  4. MIGRATING.md: a 1:1 table from every 1.x API to its 2.x equivalent, with before/after snippets.
  5. cross-sdk-tests: the changes this SDK needs are listed under cross-sdk-tests changes needed below. They go into the consolidated cross-sdk-tests PR, not a per-SDK one.

cross-sdk-tests changes needed

Owner policy: all cross-sdk-tests changes land in one consolidated PR. The java changes are all committed and pushed on the companion branch feat/java-sdk-v2-lanes, head 16eaaef. Its PR, absmartly/cross-sdk-tests#27, stays open for the consolidation worker to supersede and is no longer updated.

Pins

  • sdk-branches.sh:
    • ["java-sdk"]="next/major" until this PR merges, then main.
    • Add ["java-sdk-v1"]="v1.9.0": the last 1.x tag. Switch it to release/1.x once the owner cuts that branch.
  • sdk-branches.sh: add SDK_REPO_SOURCES=(["java-sdk-v1"]="java-sdk"), a checkout directory cloned from a different repo.
    • setup-sdks.sh clones from ${SDK_REPO_SOURCES[$repo]:-$repo}.
    • .github/workflows/cross-sdk.yml does the same and adds the lane {"sdk":"java-v1","repos":"java-sdk-v1"}.

java wrapper (java-wrapper/), ported to the 2.x API

  • Rewritten on ABsmartlyClient/ContextOptions/Context and typed events (EventCollector), with a WrapperTransport (Transport) and SdkSupport. All self-tests are ported: assignment rules, holdouts, holdout arms, switchback.
  • com.absmartly.sdk.WrapperNoEnvironment covers clientNoEnvironment (scenarios 253 and 302). ABsmartlyClient.builder() rejects a missing environment, so it builds the context through the SDK's package-private constructors, with no reflection.
  • java-wrapper/Dockerfile:
    • builds with gradle:8.5-jdk17;
    • installs :core-api:shadowJar, the published shaded jar;
    • its tester runs :core-api:test -PskipJdk25.
  • build.gradle: only a comment changes (the wrapper needs the 2.x API, which no released core-api has).

New java-v1 lane (java-v1-wrapper/)

  • The 1.x wrapper, which is the previous java-wrapper, kept unchanged against core-api 1.x.
  • docker-compose.yml: adds the java-v1-sdk and java-v1-unit services.
  • docker-compose.local-sdk.yml: adds SDK_SOURCE_DIR: ${JAVA_SDK_V1_DIR:-java-sdk-v1}.
  • run-tests.sh and run-e2e-tests.sh: add java-v1-sdk/java-v1-unit to HEAVY_SDKS.
  • orchestrator/test_runner.py: maps "java-v1": "java" (same SDK family).
  • tests/test_harness.py: lane count 20 → 21, with java-v1 among the holders.

Capabilities (orchestrator/expected-capabilities.json)

  • java: unchanged.
  • java-v1: java's required set minus switchback:
    • diagnostics, publishFail, variableKeysMap, globalCustomFieldKeys, getUnits, getAttributes, readyError;
    • holdouts, holdout_arms, diagnosticsUtf8, assignmentRules, semverOperators, numericUnitIds;
    • publishThrowsOnFailure, trackRejectsNonObjectProperties, refreshNoOpOnFailedContext, clientNoEnvironment;
    • xAgentHeader, clientRejectsBlankApplication, throwsOnMisuse, singleFinalizeEvent, semverNumericOperands.
  • java-v1 unsupported:
    • clientAcceptsBlankApplication: the client rejects a blank application; scenario 322 covers it.
    • switchback: v1.9.0 predates it. Require it again once release/1.x is cut from main.

Merge order:

  1. This PR.
  2. Repin the java-sdk lane from next/major to main in the consolidated PR.
  3. When release/1.x is cut, repin java-v1 to it, and require switchback again if it is cut from main.

Local verification. I ran the cross-sdk suite at 16eaaef against this PR at cb0676d, the last commit that changes code (later commits are docs only), with java-sdk-v1 at v1.9.0. There are 305 scenarios. All SDKs agree across 1,311 comparisons.

Lane Tested Passed Skipped
java 304 304 1: clientAcceptsBlankApplication, an agreed exception
java-v1 279 279 26: 25 switchback (not in v1.9.0), 1 clientAcceptsBlankApplication

This run caught a 2.x regression, which cb0676d fixes. On ffad16e, scenarios 101-104 and 111 failed on java and passed on java-v1: a list or map attribute did not match an equal audience value. No wrapper or capability change was needed for the fix.

Not done here (owner/orchestrator)

Cutting release/1.x, tags, publishing, absmartly/docs.

🤖 Generated with Claude Code

lux worker and others added 6 commits November 17, 2026 21:34
…ables, state, typed errors and events)

The 1.x engine (assignment, holdouts, switchbacks, exposure queue, publish/close state machine) is kept as is
behind a new public surface:

- ABsmartlyClient.builder() replaces ABSmartly/ABSmartlyConfig/Client/ClientConfig/DefaultHTTPClientConfig.
- ContextOptions (immutable builder) replaces ContextConfig.
- context()/contextAsync()/newContext()/context(options, data); ContextState replaces the is* booleans.
- treatment(), typed variable(key, default) and variable(key, Class, default), noun accessors.
- Unchecked ABsmartlyException hierarchy; blocking twins rethrow the cause, not CompletionException.
- Typed ContextEvent classes via onEvent() listeners and a Flow.Publisher (events()).
- Transport interface; JdkHttpTransport (java.net.http) in a separate source set Android never loads.
- Java 11 floor, JSpecify @NullMarked, SLF4J 2, Jackson shaded and relocated; core-api-java6, Apache
  HttpClient, jsr305 and findbugs-annotations removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and publish for main and release/1.x

- main.yml runs on push/PR for main and release/** (JDK 11 floor + JDK 25, and a JDK 21 lane).
- publish.yml keeps the tag == VERSION check, publishes v* tags, and creates the GitHub release with
  --latest=false for 1.x versions so a 1.x patch never becomes latest.
- The example app uses the new API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-events test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iew-gate follow-ups

- Follow redirects (never https to http), retry dropped connections and connect timeouts, do not retry
  refused connections, and use HTTP/1.1 for plain http (no h2c upgrade), as the 1.x Apache transport did.
  Docs list the remaining differences instead of claiming the same policy.
- Tests for I/O-error retry, max retries, refused connections, redirects, h2c, Long variables, owned
  transport close and stream overflow; wait for READY in the event tests (1.x ordering, now documented on
  ReadyEvent).
- Contexts use the client's executor for their event streams; the shaded jar has no Class-Path entry.
- Import order and Eclipse formatting per gradle/spotless.eclipseformat.xml; MIGRATING names the removed
  Default* classes; SWITCHBACK.md and CHANGELOG state switchback availability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…out and stream drops

- Contexts' events() streams run on the client's executor (counting executor test).
- JdkHttpTransport's 3 s connect timeout default and the 'timed out connecting' message are asserted.
- EventStream counts dropped events; a slow subscriber that requested nothing never blocks the producer and
  loses exactly the events past the buffer.
- The shaded jar manifest rewrite drops only Class-Path and its continuation lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… when the client cannot be built

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joalves

joalves commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Independent sdk-review on fdb1835: REQUEST_CHANGES on process gates only (CI not yet run on this head; cross-sdk pin/merge order, now written in the PR description), 0 P1/P2/P3 open. 5 P2 fixed across 5 reviewer passes (9d479fd: 4 P2 + 9 P3; b4d5373: 0 code P2 + 4 P3; c30262c: 2 P3; fdb1835: none). Reviewers were fresh subagents each time, not anchored on my conclusions.

Final reviewer report and evidence log (fdb1835)

REQUEST_CHANGES at fdb1835: no code-level P1, P2 or P3 remains. Both P3s from the c30262c pass are fixed and measured: the stream-thread test passed 12 of 12 under CPU load, and M9b is now killed. The verdict stays REQUEST_CHANGES only because of two process gates. First, CI and the eclipse Spotless step have never run on this head, because it is unpushed. Second, the companion cross-sdk pin and the merge order are still open. Engine, wire, forward-compat, the public API and the hot path all measure identical to the previous head and to main.

Re-reviewed fdb1835 (1 commit since c30262c). Compared Maven Central com.absmartly.sdk:core-api:1.9.0 → merge base and main 07807b5 → head fdb1835:

  • The 1.9.0 jar sha256 1dd0bafe… equals the copy verified against tag v1.9.0 in an earlier pass. maven-metadata latest/release = 1.9.0.
  • This is a declared major (2.0.0), so the 1.x API reshape is intended and was judged in earlier passes.
  • The commit changes ABsmartlyClient.java (a package-private test seam for the default transport) and ABsmartlyClientTest.java.
  • Parity was re-measured with a local fake collector and the cross-sdk-tests orchestrator. Only this PR's delta is a finding.

Verified fixed (from the c30262c review)

  • P3 flaky contextStreamsUseTheClientExecutor. The test now names the pool thread client-executor and asserts List.of("client-executor") for the EXPOSURE delivery.
    • Under 4 busy-loop CPU hogs on a 4-core box, ABsmartlyClientTest + JdkHttpTransportTest with --rerun-tasks passed 12 of 12. The previous head failed 4 of 10 and 4 of 12.
    • It still kills C1 (context dispatcher ignores the client executor) and C2 (client dispatcher ignores builder.executor_, new mutant).
  • P3 test gap M9b (the owned transport was not closed when Client's constructor throws). This is now killed by transportIsClosedWhenTheClientCannotBeBuilt, and so are three new variants of that path:
    • M9c: ownsTransport_ = true (3 tests);
    • M9d: the supplier is bypassed;
    • M9e: the catch is narrowed to IllegalStateException.
  • Note: the test comment overclaimed "never retried into the buffer". It is reworded to "lost and the producer is never blocked", which is accurate.

Must fix (gates, not code)

  1. Gate: CI and the Spotless eclipse/greclipse steps have not run on this head.
    • git ls-remote origin next/major = 07807b5. gh run list --commit fdb1835… returns [], and there is no PR for next/major.
    • Offline: the added lines have 0 trailing-whitespace hits and 0 lines over 120 columns (tab = 4). The new wrapped ternary (ABsmartlyClient.java:60-61) follows the same ? a / newline : b layout as 8 existing sites. The formatter has join_wrapped_lines=false and lineSplit=120, and the joined line would be exactly 120 columns.
    • removeUnusedImports: AtomicInteger is still used (ABsmartlyClientTest.java:446/464), so nothing becomes unused.
    • The eclipse formatter itself cannot run here (download.eclipse.org is unreachable).
    • Please push and confirm main.yml is green on fdb1835 (or its successor) before human review.
  2. Release gate: cross-sdk pin and merge order (unchanged).
    • Companion sdk-branches.sh:26 pins ["java-sdk"]="next/major", a feature branch that will be deleted.
    • cross-sdk origin/main still pins java-sdk to main with the 1.x wrapper.
    • Please write the merge order in both PRs: merge java-sdk, then repin cross-sdk to the merged SHA, then merge cross-sdk. java-sdk-v1 → v1.9.0 (a tag) is fine.

Tests needed (current implementation correct)

I ran 17 full-suite mutations on head (705 tests each, JDK 11): 14 killed and 3 survived. All 3 survivors (M10, S2, S4) also survive on main 07807b5 (752 tests), so they are pre-existing and not this PR's.

  • Killed: M9, M9b, M9c, M9d, M9e, C1, C2, E1 (rule scope from user environment), F1 (Experiment ignoreUnknown=false).
  • Killed, standard set: SA1 (empty application injected as ""), SA2 (synthetic app_version injected), SA3 (split uses the traffic seed), SA4 (user-set app_version filtered from publish), SA5 (raw dotted X-Application-Version).

Compatibility / parity / forward-compat evidence

  • Public API. javap -public -s over every com.absmartly.sdk class in the shaded jar: 31563 lines on c30262c and 31563 on fdb1835, byte-identical. Builder.defaultTransport(Supplier) and defaultTransport_ are package-private.
  • Android lazy load kept. The constant pool references to com/absmartly/sdk/JdkHttpTransport are 0 in ABsmartlyClient and 0 in ABsmartlyClient$Builder. The default is still Class.forName behind a static method reference.
  • No-rule and rule sweep. 10 UIDs (ASCII, padded, accented, CJK, emoji, 0, -1, 9007199254740993, 1.5, decomposed é) × 7 experiments × peek, treatment and 5 variables, plus track and the event list.
    • Output: main (1.x API probe) and head (2.0 API probe) are fully identical (11 of 11 lines, events included).
    • Normalised wire: 20 of 20 requests identical after masking the X-Agent version. The head wire sends absmartly-java-sdk/2.0.0 (20 of 20) and x-application-version: 1004 (20 of 20).
  • Forward compat. 17 fixtures. The output is identical to the earlier head pass (b4d5373), with 0 throws. The only diff from main is null_experiments: ready=false failed=true on head vs ready=true failed=true on main, which is the intended 2.0 ContextState.
  • cross-sdk-tests. Companion 16eaaef (= origin feat/java-sdk-v2-lanes). The java 2.0 wrapper was rebuilt on this head's jar; the bundled core-api-2.0.0.jar sha256 79496196… equals the head jar. Result: 304 eligible / 1 skip of 305 (skip 323, the reviewed clientAcceptsBlankApplication exception), 304 of 304 pass. This was a local run on JDK 21, not CI. The java-v1 lane was not rerun because this commit cannot affect it.

Performance

Ordinary path: warmed treatment + peek + variableValue with no rules, B probe rounds 2–4, HotSpot JDK 11 aarch64. Main 297.2–297.6 ns per 3 reads and head 295.5–295.7 ns per 3 reads, both 0.0 B/iter. There is no regression. The commit only touches client construction, so the read path is unaffected. This is a synthetic microloop, not end-to-end.

P3 / notes

  • None new. Note: Builder.defaultTransport(Supplier) is a package-private test seam in production code. It is invisible to customers and adds no public API; this is acceptable.
  • Note (carried over): exhaustedConnectTimeoutsRaiseRequestTimeoutException accepts any IOException when there is no route, so T7 coverage depends on CI's network.

Version and release notes

  • VERSION = "2.0.0", the wire X-Agent absmartly-java-sdk/2.0.0 and ## 2.0.0 (unreleased) agree. Published is 1.9.0.
  • The commit touches no docs. None are needed, because it is a test seam and tests only.
  • git grep for 1.7.0|1.8.0|1.9.0 in non-test *.java, *.gradle and README: 0 hits.

Pre-existing on main (not this PR)

  • M10 (hardcoded X-Agent), S2 (attrsSeq copy) and S4 (ruleKey copy) survive on main as well as head.
  • CHANGELOG.md ## 1.9.0 (unreleased) on main although 1.9.0 is published. This is a release gate.
  • PUT is retried on 502/503 on both main and head (contracts §11); the 2.0 transport keeps it 1:1, so track it separately.
  • Main's suite needs a UTF-8 Gradle daemon: on a reused daemon with file.encoding=US-ASCII, 8 Buffers/Hashing tests fail on unmutated main. --no-daemon -Dfile.encoding=UTF-8 → 752/752. This is a sandbox artefact, and head's build sets file.encoding for tests.

Verification limits / provenance:

  • NOT RUN:
    • Spotless eclipse/greclipse (network);
    • GitHub Actions (head unpushed);
    • JS vectors and the numeric edge table (the engine is untouched by this commit, and output and wire measure identical to main);
    • Android/ART;
    • publishToMavenLocal (signing);
    • the java-v1 cross-sdk lane (unaffected).
  • The cross-sdk counts come from a local orchestrator run against a JDK 21 wrapper on localhost:3000, not Docker or CI.
  • Timings are HotSpot JDK 11 aarch64 in a shared sandbox.
  • A stale scratch from an earlier, unreported attempt on this head (/tmp/sdkrev4.amgz) was read only for its mutant list. Every count here comes from this run in /tmp/sdkrev5.tkH8.

sdk-review evidence: java-sdk next/major (no PR number)

  • Head: fdb1835722c03b23a2bfb27aa826659d15cfe3aa (local; git ls-remote origin next/major = 07807b5, not pushed; no PR)
  • Mode: independent reviewer (read-only)
  • Previous review: c30262c (.git/sdk-review/c30262c6af1cb1c196f1de275172e3c757405e1f.md). Commits since: 1 (fdb1835 test: assert the stream thread, and that an owned transport is closed when the client cannot be built)
  • Started / finished (UTC): ~2026-11-18T00:28Z / ~00:50Z. Scratch /tmp/sdkrev5.tkH8:
    • worktrees head, mut at fdb1835, prev at c30262c, main at 07807b5;
    • all removed at the end (git worktree remove --force + prune).
  • Working trees: /workspace/repos/java-sdk git status --short → 0 lines. /workspace/repos/xsdk/cross-sdk-tests → 0 lines (wrapper built from a copy in scratch with -Dmaven.repo.local=$S/m2).

1. Trees

Tree Identifier How obtained Verified
Released Maven Central core-api:1.9.0 curl repo1.maven.org/.../core-api-1.9.0.jar → 200; maven-metadata latest/release 1.9.0 sha256 1dd0bafe… = earlier pass's copy (sources = tag v1.9.0 except SdkVersion)
Main / merge base 07807b516df5 git merge-base origin/main HEAD
Head fdb1835 git rev-parse HEAD

Version / X-Agent / CHANGELOG agree: yes (VERSION = "2.0.0"; wire absmartly-java-sdk/2.0.0 ×20; ## 2.0.0 (unreleased)). git show --stat HEAD: ABsmartlyClient.java (+9/-1) and ABsmartlyClientTest.java (+30/-11).

2. Backwards compatibility

  • API diff: javap -public -s over all com/absmartly/sdk/*.class in the shaded jar, prev (c30262c) vs head: 31563 vs 31563 lines, diff → PUBLIC-API-IDENTICAL. javap -p Builder shows defaultTransport(Supplier) and defaultTransport_ as package-private/private.
  • Android lazy load: javap -v counts of Class com/absmartly/sdk/JdkHttpTransport = 0 in ABsmartlyClient and 0 in Builder.
  • Consumer probes v2n/P.java, f2/F.java, b2/B.java were recompiled against the head jar (+ slf4j-api 2.0.16, jspecify 1.0.0) and compiled. v1n/P.java was recompiled against the main jar.
  • Released tests vs head: N/A (API reshaped by the declared major, judged in earlier passes).
  • Sweep: collector.py on ports 18921 (main) and 18922 (head), then java P http://127.0.0.1:<port>/v1:
    • diff out_m.txt out_h.txt → FULL-IDENTICAL (11 lines).
    • norm.py + agent mask → WIRE-IDENTICAL-MASKED (20 requests).
    • x-application-version = 1004 in 20 of 20 requests on both.
  • Error/null/logging contract: the commit only routes the default transport through a Supplier; the error path is unchanged (IllegalArgumentException is rethrown after the close).
  • Public fields/hooks whose effect changed: none.
  • Entry points: the default-transport seam is only in ABsmartlyClient construction, which all creation APIs share.

3. Parity

  • JS reference: NOT RUN (engine untouched; outputs and wire identical to main, §2).
  • Numeric edge table: NOT RUN (same reason).
  • cross-sdk-tests (companion 16eaaef = git ls-remote origin feat/java-sdk-v2-lanes):
    • Build: the head shaded jar was copied into $S/m2 as core-api-2.0.0.jar, with the pom from the earlier pass (git diff c30262c HEAD -- core-api/build.gradle build.gradle → empty).
    • java-wrapper copy: gradle-8.5 -Dmaven.repo.local=$S/m2 -PcoreApiVersion=2.0.0 bootJar (JDK 21). Gradle 9.6.1 failed on sourceCompatibility, a tool artefact. The bundled core-api-2.0.0.jar sha256 79496196… = the head jar.
    • Run: java -jar ... --server.port=3000, then SDK_URLS_OVERRIDE=java=http://localhost:3000 python -I orchestrator/test_runner.py --sdk java --report $S/report_java.json → rc=0, java ✓ PASS (304/304 tested, 1 skipped), Total Scenarios 305, skip 323. The first attempt without --report reached 304 PASS / 0 FAIL / 1 SKIP and then crashed writing /results (permission), so it was rerun.
    • The java-v1 lane was not rerun (unaffected).

4. Tests and mutation

  • Full suite on head: JAVA_HOME=jdk11 ./gradlew --offline clean check -x spotlessCheck -Porg.gradle.java.installations.paths=/usr/lib/jvm/java-25-openjdk-arm64 → BUILD SUCCESSFUL in 17 s. XML sums: test 705 tests, 0 failures, 0 errors, 0 skipped (5.7 s); testJdk25 705/0/0/0 (3.6 s). 704 → 705 = 1 new test.
  • Flake check: 4× sh -c 'while :; do :; done' on a 4-core box, then 12× --tests '*ABsmartlyClientTest' --tests '*JdkHttpTransportTest' --rerun-tasks → pass=12 fail=0.
  • Mutants ($S/mutrun.sh, full :core-api:test -PskipJdk25, worktree mut, reset after each):
# Mutant (file:line) Killed by Result
M9b ABsmartlyClient:66 ctor-failure close if (false) transportIsClosedWhenTheClientCannotBeBuilt killed
M9c ABsmartlyClient:62 ownsTransport_ = true 3 tests (closeLeavesSuppliedSchedulerAndTransportRunning, builderRequiresEveryConnectionSetting, transportIsClosed…) killed
M9d ABsmartlyClient:61 supplier bypassed → defaultTransport() transportIsClosedWhenTheClientCannotBeBuilt killed
M9e ABsmartlyClient:65 catch narrowed to IllegalStateException transportIsClosedWhenTheClientCannotBeBuilt killed
M9 ABsmartlyClient close path if (false) clientClosesTheTransportItCreated killed
C1 Context ctor ignores parent executor contextStreamsUseTheClientExecutor killed
C2 ABsmartlyClient EventDispatcher ignores builder executor contextStreamsUseTheClientExecutor killed
SA1 Context:2658 empty application put as "" missingApplicationLeavesKeyOutOfMap killed
SA2 Context:2659 inject app_version=9.9.9 4 tests incl. appVersionIsNotAnAudienceVariable killed
SA3 Context:1653 split uses traffic seed splitHashesUnitWithExperimentSeed, splitRuleRandomizesOverTheServingUnit killed
SA4 Context buildPublishAttributes filters user app_version publishKeepsUserSetAppVersionApplicationAndEnvironment killed
SA5 Client:71 raw X-Application-Version applicationVersionIsNormalized killed
M10 Client:72 hardcoded agent — SURVIVED (also survives on main)
S2 Context no attrsSeq copy — SURVIVED (also survives on main)
S4 Context no ruleKey copy — SURVIVED (also survives on main)
F1 Experiment ignoreUnknown=false 5 tests killed
E1 Context rule scope env → null userEnvironmentAttributeDoesNotChangeRuleScope, matchesRuleForEnvironment killed

Totals: 17 run / 14 killed / 3 survived, all pre-existing.

  • Main check: mutrun_main.sh with --no-daemon -Dfile.encoding=UTF-8. Unmutated main → BUILD SUCCESSFUL (752). M10-main, S2-main and S4-main → SURVIVED. The first attempt on the shared daemon (file.encoding=US-ASCII) had 8 Buffers/Hashing failures (AIOOBE in Buffers.encodeUTF8) on unmutated main; that was a daemon artefact and was discarded.
  • Fix-commit audit (fdb1835):
Commit New state Where else it must apply Entry points skipping it Mutant
fdb1835 Builder.defaultTransport_ Supplier (package-private seam), default ABsmartlyClient::defaultTransport only the ctor's default-transport branch; ownsTransport_ still keyed on transport_ == null none (every build goes through the ctor) M9d killed; Android constant-pool check 0 refs
fdb1835 stream test asserts thread name — — C1, C2 killed; 12/12 under load

5. Performance

Path main head probe size / runtime counter test exists?
warmed treatment+peek+variableValue, no rules 297.2–297.6 ns / 3 reads, 0.0 B (rounds 2–4) 295.5–295.7 ns / 3 reads, 0.0 B B data.json, JDK 11 HotSpot aarch64 no new caches

6. Forward compatibility

  • java F fx/*.json with 17 fixtures (unknown keys at root, exp, variant, app and holdout; missing/null variant config; null name and unitType; assignmentRules null, "", bad, object, number and unknown type; reordered; null experiments):
    • diff fo_h.txt /tmp/sdkrev2.cnxz/fo_h.txt → FWD-IDENTICAL-TO-b4d5373.
    • vs main: only null_experiments differs (ready=false vs ready=true, both failed=true; intended).
    • THREW count 0.

7. Build / CI

  • clean check -x spotlessCheck → BUILD SUCCESSFUL (tests ×2 JDKs, animalsniffer, jacoco, verifyShadedJar).
  • Spotless offline: added lines have 0 trailing-whitespace hits and 0 over 120 columns. The wrap style matches 8 existing ternaries (grep -E '\? [^:]*$'). removeUnusedImports is a no-op (AtomicInteger is still used). Eclipse/greclipse: NOT RUN (network).
  • Floors: unchanged (options.release = 11).
  • Newest runtime: JDK 25, 705/705.
  • CI on this exact head: gh run list --commit fdb1835… → [] (unpushed). Gate.
  • Pins: companion sdk-branches.sh:26 ["java-sdk"]="next/major" (feature branch). Gate. :29 java-sdk-v1 = v1.9.0 OK.

8. Docs / CHANGELOG

  • git diff c30262c HEAD --stat -- '*.md' → empty (none needed for a test seam and tests).
  • Stale strings: git grep -n "1\.7\.0\|1\.8\.0\|1\.9\.0" -- '*.java' '*.gradle' README.md | grep -v src/test → 0 hits. defaultTransport in docs → 0 hits (not public).

Findings

Sev Title Evidence line above Fixed in
Gate CI + Spotless eclipse not run on head (unpushed) §7 —
Gate (release) cross-sdk pin next/major and merge order §3, §7 —
Fixed flaky stream-executor test (12/12 under load) §4 fdb1835
Fixed M9b owned transport not closed on ctor failure (killed, plus M9c/d/e) §4 fdb1835
Pre-existing M10, S2, S4 survive on main and head §4 —

Verification limits

  • Spotless eclipse/greclipse: NOT RUN (network).
  • CI: none (head unpushed).
  • JS vectors / numeric edge table: NOT RUN (engine unchanged by this commit; outputs identical to main).
  • cross-sdk java-v1 lane: NOT RUN (unaffected); java lane is a local orchestrator run against a JDK 21 wrapper, not Docker/CI.
  • Android/ART: NOT RUN. publishToMavenLocal: NOT RUN (signing).

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 199 files, which is 49 over the limit of 150.

To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to Team to raise the limit.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 552e51ce-e8e2-4c78-9e5c-c04a0a001a5e
Commits

Reviewing files that changed from the base of the PR and between 9b2414b and a30de65.

Files selected for processing: 199

  • .github/workflows/main.yml
  • .github/workflows/publish.yml
  • CHANGELOG.md
  • CONTRIBUTING.md
  • MIGRATING.md
  • README.md
  • SUPPORT.md
  • SWITCHBACK.md
  • build.gradle
  • core-api-java6/build.gradle
  • core-api/build.gradle
  • core-api/src/java6Main/java/com/absmartly/sdk/internal/Futures.java
  • core-api/src/java6Main/java/com/absmartly/sdk/internal/SdkFuture.java
  • core-api/src/java6Test/java/com/absmartly/sdk/ReturnedFutures.java
  • core-api/src/java6Test/java/com/absmartly/sdk/internal/SdkFutureTest.java
  • core-api/src/jdk/java/com/absmartly/sdk/JdkHttpTransport.java
  • core-api/src/main/java/com/absmartly/sdk/ABSmartly.java
  • core-api/src/main/java/com/absmartly/sdk/ABSmartlyConfig.java
  • core-api/src/main/java/com/absmartly/sdk/ABsmartlyClient.java
  • core-api/src/main/java/com/absmartly/sdk/ABsmartlyException.java
  • core-api/src/main/java/com/absmartly/sdk/AudienceDeserializer.java
  • core-api/src/main/java/com/absmartly/sdk/AudienceMatcher.java
  • core-api/src/main/java/com/absmartly/sdk/Client.java
  • core-api/src/main/java/com/absmartly/sdk/ClientConfig.java
  • core-api/src/main/java/com/absmartly/sdk/Context.java
  • core-api/src/main/java/com/absmartly/sdk/ContextClosedException.java
  • core-api/src/main/java/com/absmartly/sdk/ContextConfig.java
  • core-api/src/main/java/com/absmartly/sdk/ContextData.java
  • core-api/src/main/java/com/absmartly/sdk/ContextDataDeserializer.java
  • core-api/src/main/java/com/absmartly/sdk/ContextDataProvider.java
  • core-api/src/main/java/com/absmartly/sdk/ContextEventHandler.java
  • core-api/src/main/java/com/absmartly/sdk/ContextEventLogger.java
  • core-api/src/main/java/com/absmartly/sdk/ContextEventSerializer.java
  • core-api/src/main/java/com/absmartly/sdk/ContextLoadException.java
  • core-api/src/main/java/com/absmartly/sdk/ContextNotReadyException.java
  • core-api/src/main/java/com/absmartly/sdk/ContextOptions.java
  • core-api/src/main/java/com/absmartly/sdk/ContextState.java
  • core-api/src/main/java/com/absmartly/sdk/DecodingException.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultAudienceDeserializer.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultContextDataDeserializer.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultContextDataProvider.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultContextEventHandler.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultContextEventSerializer.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultHTTPClient.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultHTTPClientConfig.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultHTTPClientRetryStrategy.java
  • core-api/src/main/java/com/absmartly/sdk/DefaultVariableParser.java
  • core-api/src/main/java/com/absmartly/sdk/EventDispatcher.java
  • core-api/src/main/java/com/absmartly/sdk/EventStream.java
  • core-api/src/main/java/com/absmartly/sdk/Exposure.java
  • core-api/src/main/java/com/absmartly/sdk/Goal.java
  • core-api/src/main/java/com/absmartly/sdk/HTTPClient.java
  • core-api/src/main/java/com/absmartly/sdk/HTTPVersionPolicy.java
  • core-api/src/main/java/com/absmartly/sdk/HttpStatusException.java
  • core-api/src/main/java/com/absmartly/sdk/RequestTimeoutException.java
  • core-api/src/main/java/com/absmartly/sdk/Transport.java
  • core-api/src/main/java/com/absmartly/sdk/TransportException.java
  • core-api/src/main/java/com/absmartly/sdk/UnitAlreadySetException.java
  • core-api/src/main/java/com/absmartly/sdk/VariableConverter.java
  • core-api/src/main/java/com/absmartly/sdk/VariableParser.java
  • core-api/src/main/java/com/absmartly/sdk/event/CloseEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/ContextEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/ErrorEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/EventListener.java
  • core-api/src/main/java/com/absmartly/sdk/event/ExposureEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/GoalEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/PublishEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/ReadyEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/RefreshEvent.java
  • core-api/src/main/java/com/absmartly/sdk/event/Subscription.java
  • core-api/src/main/java/com/absmartly/sdk/event/package-info.java
  • core-api/src/main/java/com/absmartly/sdk/internal/Clock.java
  • core-api/src/main/java/com/absmartly/sdk/internal/Concurrency.java
  • core-api/src/main/java/com/absmartly/sdk/internal/Json.java
  • core-api/src/main/java/com/absmartly/sdk/internal/JsonValues.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/AssignmentRulesDeserializer.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/AttributePayload.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/ContextPayload.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/CustomFieldValue.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/Experiment.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/ExperimentApplication.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/ExperimentVariant.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/ExposurePayload.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/GoalAchievement.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/PublishPayload.java
  • core-api/src/main/java/com/absmartly/sdk/internal/json/Unit.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/Evaluator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/ExprEvaluator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/JsonExpr.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/Operator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/SemverComparator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/AndCombinator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/BinaryOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/BooleanCombinator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/EqualsOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/GreaterThanOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/GreaterThanOrEqualOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/InOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/LessThanOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/LessThanOrEqualOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/MatchOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/NotOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/NullOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/OrCombinator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverEqualsOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverGreaterThanOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverGreaterThanOrEqualOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverLessThanOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverLessThanOrEqualOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/UnaryOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/ValueOperator.java
  • core-api/src/main/java/com/absmartly/sdk/internal/jsonexpr/operators/VarOperator.java
  • core-api/src/main/java/com/absmartly/sdk/java/nio/charset/StandardCharsets.java
  • core-api/src/main/java/com/absmartly/sdk/java/time/Clock.java
  • core-api/src/main/java/com/absmartly/sdk/java/time/internal/FixedClock.java
  • core-api/src/main/java/com/absmartly/sdk/java/time/internal/SystemClockUTC.java
  • core-api/src/main/java/com/absmartly/sdk/java/util/Objects.java
  • core-api/src/main/java/com/absmartly/sdk/jsonexpr/operators/ValueOperator.java
  • core-api/src/main/java/com/absmartly/sdk/package-info.java
  • core-api/src/main/resources/META-INF/proguard/absmartly-core-api.pro
  • core-api/src/test/java/com/absmartly/sdk/ABSmartlyCompatTest.java
  • core-api/src/test/java/com/absmartly/sdk/ABSmartlyConfigTest.java
  • core-api/src/test/java/com/absmartly/sdk/ABSmartlyFixTest.java
  • core-api/src/test/java/com/absmartly/sdk/ABSmartlyTest.java
  • core-api/src/test/java/com/absmartly/sdk/ABsmartlyClientTest.java
  • core-api/src/test/java/com/absmartly/sdk/AsyncExecutorCompatibilityTest.java
  • core-api/src/test/java/com/absmartly/sdk/AudienceMatcherTest.java
  • core-api/src/test/java/com/absmartly/sdk/ClientConfigTest.java
  • core-api/src/test/java/com/absmartly/sdk/ClientFixTest.java
  • core-api/src/test/java/com/absmartly/sdk/ClientTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextAssignmentRulesTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextConfigTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextFixTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextHoldoutTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextOptionsTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextSwitchbackClusterRuleTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextSwitchbackClusterTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextSwitchbackTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextSystemAttributesTest.java
  • core-api/src/test/java/com/absmartly/sdk/ContextTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultAudienceDeserializerTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultContextDataProviderTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultContextEventHandlerTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultContextEventSerializerTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultHTTPClientConfigTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultHTTPClientRetryStrategyTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultHTTPClientTest.java
  • core-api/src/test/java/com/absmartly/sdk/DefaultVariableParserTest.java
  • core-api/src/test/java/com/absmartly/sdk/FakeTransport.java
  • core-api/src/test/java/com/absmartly/sdk/JdkHttpTransportTest.java
  • core-api/src/test/java/com/absmartly/sdk/JsonContextDecodingTest.java
  • core-api/src/test/java/com/absmartly/sdk/LocalHttpServerIntegrationTest.java
  • core-api/src/test/java/com/absmartly/sdk/LoggedWarningsTest.java
  • core-api/src/test/java/com/absmartly/sdk/ReturnedFutures.java
  • core-api/src/test/java/com/absmartly/sdk/SwitchbackServerParityTest.java
  • core-api/src/test/java/com/absmartly/sdk/SwitchbackTestSupport.java
  • core-api/src/test/java/com/absmartly/sdk/TestContextConfig.java
  • core-api/src/test/java/com/absmartly/sdk/TestContexts.java
  • core-api/src/test/java/com/absmartly/sdk/TestJson.java
  • core-api/src/test/java/com/absmartly/sdk/TestUtils.java
  • core-api/src/test/java/com/absmartly/sdk/internal/ConcurrencyTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/hashing/HashingTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/hashing/MD5Test.java
  • core-api/src/test/java/com/absmartly/sdk/internal/hashing/Murmur3_32Test.java
  • core-api/src/test/java/com/absmartly/sdk/internal/json/ContextPayloadTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/json/ExperimentSwitchbackFieldsTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/ExprEvaluatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/JsonExprTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/SemverComparatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/AndCombinatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/EqualsOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/GreaterThanOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/GreaterThanOrEqualOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/InOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/LessThanOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/LessThanOrEqualOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/MatchOperatorFixTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/MatchOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/NotOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/NullOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/OperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/OrCombinatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverEqualsOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverGreaterThanOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverGreaterThanOrEqualOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverLessThanOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/SemverLessThanOrEqualOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/ValueOperatorTest.java
  • core-api/src/test/java/com/absmartly/sdk/internal/jsonexpr/operators/VarOperatorTest.java
  • docs/plans/2.0.0.md
  • example/build.gradle
  • example/src/main/java/com/absmartly/example/Example.java
  • example/src/main/java/com/absmartly/sdk/Example.java
  • gradle/compatibility.gradle
  • gradle/findbugs.gradle
  • gradle/sdk-module.gradle
  • r8-check/build.gradle
  • r8-check/src/main/java/com/absmartly/r8check/Probe.java
  • r8-check/src/main/r8/probe.pro

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Review on demand using usage pricing
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joalves

joalves commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Independent sdk-review on edf3e1b: APPROVE, 0 P1/P2/P3 open. This push only applies the Spotless groovy formatting that CI flagged on fdb1835 (reproduced with the real Eclipse formatter from a mirror). Totals so far: 5 P2 fixed across 6 reviewer passes.

Reviewer report and evidence log (edf3e1b)

APPROVE (for push) at edf3e1b: no P1, P2 or P3. This formatting-only commit fixes the one real defect on the pushed head fdb1835: CI run 44210628708 went red on spotlessGroovyGradleCheck. Running the real greclipse formatter locally through an Eclipse mirror reproduces that exact violation on fdb1835, and the full spotlessCheck (Java and Groovy, all 3 projects) passes on edf3e1b. The shaded jar content and the POM are byte-identical to fdb1835. Two gates remain, and neither is code:

  • CI must go green on this exact head once it is pushed;
  • the companion cross-sdk pin next/major must be moved after merge (the merge order is now written in both PRs).

Re-reviewed edf3e1b (1 commit since fdb1835, the pushed PR head). Compared Maven Central com.absmartly.sdk:core-api:1.9.0 (maven-metadata latest/release = 1.9.0) → merge base and main 07807b5 → head edf3e1b. This is a declared major (2.0.0). The 1.x API reshape is intended and was judged in earlier passes (9d479fd, b4d5373, c30262c, fdb1835). The delta is build.gradle (+3/-1) and core-api/build.gradle (+3/-1): two Groovy list literals wrapped one element per line. Only this PR's delta is a finding.

Verified fixed (from the fdb1835 review)

  • Gate: Spotless eclipse/greclipse had never run on the head. It has now run in CI, and it ran locally too.
    • CI on fdb1835: gh run view 44210628708. The build job FAILED at :spotlessGroovyGradleCheck, with build.gradle @@ -51,7 +51,9 @@ wanting ["core-api"] wrapped to one element per line. test-jdk21 passed.
    • Root cause: gradle/spotless.groovyformat.prefs sets groovy.formatter.longListLength=1. Upstream GroovyBeautifier.formatLists wraps any list whose bracket span is over that length. So every non-empty Groovy list literal must be one element per line.
    • Local reproduction (real formatter, not a style eyeball): spotless 6.25 greclipse() 4.26, with withP2Mirrors pointing download.eclipse.org/eclipse/updates/4.26/ at ftp.fau.de/eclipse/releases/2022-12/202212071000/. This was done in a scratch worktree only.
      • fdb1835's two gradle files show 2 violations: root build.gradle:51 (the same hunk as CI) and core-api/build.gradle:66 (configurations = [...]). CI never got that far, because the root task failed first.
      • On edf3e1b: spotlessCheck → BUILD SUCCESSFUL, with spotlessGroovyGradleCheck ×3 and spotlessJavaCheck ×2 (core-api, example). This was reconfirmed with --rerun-tasks.
      • The formatter is not vacuous: an injected Java double-space and an injected [ "core-api" ].each {} in example/build.gradle were both reported as violations.
    • The remaining Groovy list literals ([:], [] and [sourceSets.main] in gradle/compatibility.gradle) are outside target "*.gradle", which is root-relative per project, so gradle/*.gradle is not checked. Empty lists have span ≤ 1.

Must fix

None in code.

Gates (process, not findings):

  1. CI on this exact head.
    • git ls-remote origin next/major = fdb1835, so edf3e1b is not pushed and has no run.
    • Local equivalents of the CI build job all pass: clean build (705/705 on JDK 11 and 705/705 on JDK 25, plus animalsniffer, jacoco and verifyShadedJar) and the real spotlessCheck. test-jdk21: 705/705 on JDK 21.
    • Please push, and confirm both main.yml jobs are green on edf3e1b before re-requesting human review.
  2. Release gate: cross-sdk pin (carried over).
    • Companion cross-sdk-tests#27 (16eaaef) still pins ["java-sdk"]="next/major" (sdk-branches.sh:26), a branch that will be deleted.
    • The merge order is now written in both PR bodies: java-sdk#27 body line 195, and cross-sdk-tests#27 "Merge order" steps 1–2.
    • So this is tracked, not open. Note that the planned repin target is main (a branch), which matches how the other SDK lanes are pinned in that file.

Tests needed (current implementation correct)

I ran 11 mutations on head: 9 engine/client mutants through the full :core-api:test -PskipJdk25 (705 tests each, JDK 11), plus 2 build-script mutants on the lines this commit touched. 10 were killed and 1 survived.

  • M10 (hardcoded X-Agent) survives. It survived on main 07807b5 too (measured in the fdb1835 pass), so it is pre-existing and not this PR's.
  • Build mutants:
    • B1, dropping project.configurations.runtimeClasspath from the wrapped shadowJar list, is killed by verifyShadedJar ("Relocated Jackson is missing from core-api.jar").
    • B2, renaming "core-api" in the wrapped publish-configure list, is killed: the build fails evaluating :core-api (the publish/sign block no longer applies).

Compatibility / parity / forward-compat evidence

  • Artifact unchanged by the commit. Shaded core-api.jar built on edf3e1b and on fdb1835: diff -r of the unzipped contents → identical. generatePomFileForReleasePublication sha256 is bbb35343… on both.
  • Public API, wire, rule and no-rule sweep, forward-compat, cross-sdk. The commit changes no source and no artifact byte, so these carry over unchanged from the fdb1835 pass:
    • javap 31563 lines identical;
    • 20 of 20 wire requests identical to main after masking X-Agent;
    • 17 forward-compat fixtures with 0 throws;
    • cross-sdk java lane 304 eligible / 1 skip of 305 (skip 323).
  • They were not re-executed here. The jar identity above is the evidence that they cannot have moved.

Performance

No production code or artifact change (jar content identical), so performance was not re-measured. The fdb1835 figure stands: main 297.2–297.6 vs head 295.5–295.7 ns per 3 warmed reads, 0 B, HotSpot JDK 11 aarch64, synthetic microloop.

P3 / notes

  • None.
  • Note: the sandbox cannot reach download.eclipse.org. A local Spotless run is possible with a scratch-only withP2Mirrors override (see the evidence log). It must not be committed, because CI resolves directly.

Version and release notes

  • VERSION = "2.0.0", ## 2.0.0 (unreleased) and the wire agent absmartly-java-sdk/2.0.0 agree. Published is 1.9.0. No docs are needed for a formatting commit.
  • git grep for 1.7.0|1.8.0|1.9.0 in non-test *.java, *.gradle and README: 0 hits.

Pre-existing on main (not this PR)

  • M10, S2 and S4 survive on main as well as head (S2 and S4 were measured in the fdb1835 pass and not rerun here).
  • CHANGELOG.md:47 ## 1.9.0 (unreleased) on main although 1.9.0 is published. This is a release gate.
  • PUT is retried on 502/503 (contracts §11), kept 1:1. Track it separately.

Verification limits / provenance:

  • NOT RUN:
    • GitHub Actions on edf3e1b (unpushed). Only fdb1835's run 44210628708 exists, and it is red, which is what this commit fixes.
    • JS vectors and the numeric edge table, the behaviour sweep, the forward-compat fixtures and the cross-sdk orchestrator. These were not re-executed, because the artifact is byte-identical to fdb1835, where they were run.
    • Android/ART.
    • publishToMavenLocal (signing).
  • Spotless ran against Eclipse 4.26 p2 content from the ftp.fau.de mirror (2022-12 release train), not download.eclipse.org. The formatter version (greclipse 4.26 default, org.codehaus.groovy_4.0.7) matches CI's resolution, and the violation text on fdb1835 matches CI's log hunk for hunk.

sdk-review evidence: java-sdk#27

  • Head: edf3e1bf7ecf597911fd5257a6aefc31c9cea410 (local; git ls-remote origin next/major = fdb1835… = gh pr view 27 --json headRefOid, so this head is unpushed)
  • Mode: independent reviewer (read-only)
  • Previous review: fdb1835 (.git/sdk-review/fdb1835722c03b23a2bfb27aa826659d15cfe3aa.md). Commits since: 1 (edf3e1b style: Spotless groovy formatting for the build scripts)
  • Started / finished (UTC): ~2026-11-18T00:55Z / 01:12Z. Scratch /tmp/sdkrev6.h3yA:
    • worktrees head and mut at edf3e1b, prev at fdb1835;
    • all removed (git worktree remove --force + prune; git worktree list shows only the main tree).
  • Working tree /workspace/repos/java-sdk: git status --short | wc -l → 0.

1. Trees

Tree Identifier How obtained Verified
Released Maven Central core-api:1.9.0 curl repo1.maven.org/.../maven-metadata.xml → latest/release 1.9.0 jar = tag v1.9.0 per earlier passes (not re-hashed)
Main / merge base 07807b516df5 git merge-base origin/main HEAD
Head edf3e1b git rev-parse HEAD

Version / X-Agent / CHANGELOG agree: yes (VERSION = "2.0.0", CHANGELOG.md:3 ## 2.0.0 (unreleased)). git show --stat edf3e1b → build.gradle (+3/-1), core-api/build.gradle (+3/-1).

2. Backwards compatibility

  • API diff: the artifact is unchanged. Built the shaded jar on head and on prev (clean build -x spotlessCheck), unzipped both, diff -r x_head x_prev → JAR-CONTENT-IDENTICAL.
  • POM: :core-api:generatePomFileForReleasePublication on both → sha256 bbb353431eee… on both.
  • Consumer probe / released tests / sweep: carried over from fdb1835 (artifact identical); not re-executed.
  • Error/null/logging contract, public fields/hooks, entry points: no source change (git show --stat), so unchanged.

3. Parity

  • JS reference / numeric edge table: NOT RUN (no source change; artifact identical).
  • cross-sdk-tests: not re-executed. Companion 16eaaef = gh pr view 27 -R absmartly/cross-sdk-tests --json headRefOid (OPEN, draft). Prior result 304 eligible / 1 skip of 305 (skip 323) on a byte-identical jar.
  • Pin: gh api .../sdk-branches.sh?ref=feat/java-sdk-v2-lanes → :26 ["java-sdk"]="next/major", :29 ["java-sdk-v1"]="v1.9.0".
  • Merge order: java-sdk#27 body line 195 and cross-sdk-tests#27 body "## Merge order" both state it.

4. Tests and mutation

  • Full suite on head (worktree head):
    • JAVA_HOME=jdk11 ./gradlew --offline clean build -x spotlessCheck -Porg.gradle.java.installations.paths=/usr/lib/jvm/java-25-openjdk-arm64 → BUILD SUCCESSFUL in 16 s.
    • XML sums: test 705/0 fail/0 err/0 skip; testJdk25 705/0/0/0.
  • JDK 21 (worktree mut, unmutated): JAVA_HOME=jdk21 ./gradlew --offline :core-api:test -PskipJdk25 → BUILD SUCCESSFUL; 705 tests, 0 failures.
  • Mutants: /tmp/sdkrev6.h3yA/tools/run.sh (python replace, full :core-api:test -PskipJdk25, git checkout -- . after each):
# Mutant (file:line) Killed by Result
E1 Context:1620 rule scope from user environment attribute 1 test failed killed
SA1 Context:2658 empty application put as "" 1 failed killed
SA2 Context:2659 inject app_version=9.9.9 4 failed killed
SA3 Context:1653 split uses traffic seed 2 failed killed
SA4 Context:2697 user-set app_version filtered from publish 1 failed killed
SA5 Client:71 raw X-Application-Version 1 failed killed
M10 Client:72 hardcoded agent string — SURVIVED (pre-existing; also survives on main per fdb1835 pass)
M9b ABsmartlyClient:67 ctor-failure close if (false) 1 failed killed
F1 internal/json/Experiment ignoreUnknown=false 5 failed killed
B1 core-api/build.gradle:69-71 drop runtimeClasspath from wrapped shadowJar list verifyShadedJar "Relocated Jackson is missing" killed
B2 build.gradle:54-56 "core-api" → "core-apix" in wrapped list build fails evaluating :core-api killed

Totals: 11 run / 10 killed / 1 survived (M10, pre-existing).

  • Fix-commit audit (edf3e1b):
Commit New state Where else it must apply Entry points skipping it Mutant
edf3e1b none (whitespace/newline layout of 2 Groovy list literals) every non-empty list literal in Spotless-targeted *.gradle (root, core-api, example); gradle/*.gradle is not targeted none: real greclipse passes on all 3 projects B1, B2 killed; artifact identical

5. Performance

Path main head probe size / runtime counter test exists?
warmed treatment+peek+variableValue not re-run not re-run (jar identical to fdb1835: 295.5–295.7 ns/3 reads, 0 B) — no new caches

6. Forward compatibility

  • NOT RE-RUN: jar identical to fdb1835, where 17 fixtures gave 0 throws.

7. Build / CI

  • CI on fdb1835 (the pushed head): gh run view 44210628708. build failed at "Build Java SDK", :spotlessGroovyGradleCheck FAILED, build.gradle @@ -51,7 +51,9 @@ -\t["core-api"].contains(it.name) +\t[ +\t\t"core-api" +\t].contains(it.name). test-jdk21 ✓.
  • Formatter config: gradle/spotless.groovyformat.prefs has groovy.formatter.longListLength=1. Upstream groovy-eclipse GroovyBeautifier.formatLists wraps when rbrackOffset - lbrackOffset > longListLength (fetched via gh api repos/groovy/groovy-eclipse/contents/.../GroovyBeautifier.java).
  • Local real Spotless (scratch head worktree only):
    • gradle/spotless.gradle edited to eclipse()/greclipse().withP2Mirrors(["https://download.eclipse.org/eclipse/updates/4.26/": "https://ftp.fau.de/eclipse/releases/2022-12/202212071000/", …]). GrEclipseFormatterStep/EclipseJdtFormatterStep default version 4.26 (javap -constants on spotless-lib-extra 2.45.0).
    • First attempts: unmapped → UnknownHostException download.eclipse.org; generic ftp.fau.de/eclipse/ → 404 on eclipse/updates/4.26 (the mirror only has 4.33+). The 2022-12 train worked. One run hit a transient mirror resolve error and was rerun.
    • Control: fdb1835's two gradle files → :spotlessGroovyGradleCheck violation (same hunk as CI) and :core-api:spotlessGroovyGradleCheck violation (configurations = [project.configurations.runtimeClasspath] at :66).
    • Head: ./gradlew --no-daemon spotlessCheck --rerun-tasks → BUILD SUCCESSFUL (spotlessGroovyGradleCheck ×3, spotlessJavaCheck ×2).
    • Teeth: injected return in ABsmartlyClient.java and [ "core-api" ].each { } in example/build.gradle → both reported (:core-api:spotlessJavaCheck, :example:spotlessGroovyGradleCheck).
  • Package: clean build ok; verifyShadedJar ok. publishToMavenLocal NOT RUN (signing).
  • Floors: unchanged (options.release = 11; no source/build-logic change).
  • Newest runtime: JDK 25 705/705.
  • CI on this exact head: none (unpushed). Gate.
  • Pins: companion next/major (feature branch). Release gate, with the merge order documented in both PRs.

8. Docs / CHANGELOG

  • git diff fdb1835 HEAD --stat -- '*.md' → empty (none needed).
  • Released sections: CHANGELOG.md headings 2.0.0 (unreleased), 1.9.0 (unreleased) (main-era, pre-existing), 1.8.0 (2026-11-11), 1.7.0 (2026-11-11). git diff origin/main HEAD -- CHANGELOG.md | grep '^-## ' → 0 removed headings.
  • Stale strings: git grep -n "1\.7\.0\|1\.8\.0\|1\.9\.0" -- '*.java' '*.gradle' README.md | grep -v src/test | wc -l → 0.

Findings

Sev Title Evidence line above Fixed in
Fixed CI red on fdb1835: spotlessGroovyGradleCheck (root and core-api build.gradle list wrapping) §7 edf3e1b
Gate CI not yet run on edf3e1b (unpushed) §7 —
Gate (release) cross-sdk pin next/major; merge order now documented §3 —
Pre-existing M10 survives on main and head §4 —

Verification limits

  • GitHub Actions on edf3e1b: none (unpushed).
  • Spotless ran via a Eclipse 4.26 p2 mirror (ftp.fau.de 2022-12 train), not download.eclipse.org. Results match CI's on fdb1835.
  • Not re-executed, because the artifact is byte-identical to fdb1835: behaviour sweep, wire probe, forward-compat, cross-sdk orchestrator, perf, JS vectors and the numeric edge table.
  • Android/ART: NOT RUN. publishToMavenLocal: NOT RUN (signing).

@joalves
joalves marked this pull request as ready for review November 18, 2026 01:16
@jervasion-absmartly

jervasion-absmartly commented Nov 18, 2026 •

Copy link
Copy Markdown

Review submitted

The automated review has been submitted. See the review for the verdict and any findings.

Head: a30de6558456 | Updated: 2026-11-20 17:04 UTC

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested

The Java 2.0 migration has four reproducible issues to fix: request deadlines do not cover stalled response bodies, list defaults can hide valid variables, late event-stream subscribers never finish, and the installed example cannot start. The existing tests and exact-head CI pass, but do not catch these cases.

Next step: Fix the four inline findings and add focused regression coverage.

Must fix

  1. Bound response-body receipt by the request timeout — a stalled collector can keep a configured-deadline request waiting indefinitely.
  2. Infer collection types without requiring a concrete implementation match — valid list variables fall back to empty defaults.
  3. Preserve event-stream completion across lazy initialization — subscribing after close waits forever.
  4. Restore the example's SLF4J runtime dependency — its generated launcher fails before any request.

Suggestions (optional)

  • Small comment-hygiene notes are listed below; none blocks this review.

What I checked

  • ✅ Exact-head Actions build and test-jdk21 passed, including formatting and the Java 11/21/25 test lanes.
  • ✅ Local core suite: 705 tests passed on Java 11 and 705 on Java 25; Android signature validation, coverage gates and shaded-jar validation passed.
  • ✅ Ran public-API probes against the shaded JAR on Java 11, reproducing the timeout, list-default and stream-completion failures.
  • ❌ Built and launched the installed example with its required environment variables; it fails with NoClassDefFoundError: org/slf4j/LoggerFactory.
Review details

Head: edf3e1bf7ecf597911fd5257a6aefc31c9cea410. Base and merge-base: 07807b516df5ad0d7d92e5b682041982802cd871. Initial review, round 1; complete merge-base-to-head scope.

Intent and scope: intentional major-version API breaks, Java 11 floor, immutable options and typed variables/events/errors, JDK HTTP transport, shaded Jackson, preserved assignment/exposure/publish/refresh engine semantics. JVM consumers and Kotlin/Scala/Android wrappers are affected. The owner explicitly defers release/1.x creation/workflow copying and defines the companion cross-SDK merge/repin order; those are not additional findings. Owner-reported cross-SDK results were read, not independently rerun.

Commands and evidence:

  • JAVA_HOME="${JAVA_HOME_11:?}" ./gradlew build -x spotlessCheck :example:installDist --console=plain: passed. Independent passes forced :core-api:test -PskipJdk25 --rerun-tasks (705 passing tests) and ran core checks including Java 25 (705 passing tests). Verified local Java and javac 11.0.33.
  • Local Spotless resolution was blocked by Eclipse DNS; exact-head Actions run 44214183482 passed both completed jobs and covers formatting. Commit statuses contain no separate statuses.
  • Java 11 shaded-JAR public probe: JSON list [actual] -> raw [actual], inferred Collections.emptyList() -> [], explicit List.class -> [actual].
  • Same probe: first events() call after context/client closure -> no terminal callback; code trace confirms no later close trigger.
  • Same probe with loopback HTTP server: 500 ms request timeout, immediate headers/first byte, final byte after 3 seconds -> future still incomplete after 1500 ms, eventually HTTP 200 after 3109 ms rather than a timeout.
  • JAVA_HOME="${JAVA_HOME_11:?}" ABSMARTLY_APIKEY=test ABSMARTLY_APP=app ABSMARTLY_ENV=test example/build/install/example/bin/example: startup class-loading failure, before network I/O.
  • Inspected CI/release configuration, publication POM, relocated Jackson/service files, typed error propagation, listener isolation, engine changes and test coverage. No Android ART runtime, external collector workflow, signing or publication was executed.

Passes (non-blocking): run: core runtime/API/security/data (new API and changed engine adapters); dedicated error specialist (changed HTTP, decoding and lifecycle failure paths; completed); tests/CI/packaging (changed suites, dependencies and artifacts); deployment/operations/observability (release workflow and event/drop logging); cross-cutting simplicity (new client, dispatch and transport machinery); behaviour-bearing data/policy (build/runtime configuration); comment hygiene; diff composition. Not run: shared frontend blast radius (no frontend source changed).

Comment hygiene (non-blocking): 391 comment / 5193 code lines, ratio ~1:13.3.
threshold T=52; restatements counted: no (10 × C < E).
Flagged small blocks: ABsmartlyClient.java:196 (restates scheduler ownership branch); EventStream.java:42 (restates drop-counter purpose); ContextState.java:3 (narrates 1.x naming history); TestContexts.java:9 (narrates old construction API); TestJson.java:9,14 (narrates old serializer/deserializer API). The short historical test-helper explanations are non-blocking and below T; no comment finding promoted. Platform constraints, event-ordering constraints and one-line API documentation were preserved.

Diff composition (non-blocking): every file is required for the change; none flagged. Ran the pinned introduced_blobs.py successfully and inspected/scanned all 201 content writes (201 unique blobs), including intermediate content, with no credential or scratch artifact identified. Rename-aware diff accounting excludes unchanged moved content.

Simplifications (non-blocking): none. In particular the lazy stream class and separate JDK transport source set serve the explicit Android loading constraint.

Comment thread core-api/build.gradle Resolved
lux worker and others added 12 commits November 18, 2026 01:37
…treams after close; example runtime

Addresses jervasion-absmartly's review of edf3e1b:
- JdkHttpTransport enforces requestTimeout on the whole exchange, up to the last body byte
  (HttpRequest.timeout stops at the headers), failing with RequestTimeoutException without a retry.
- variable/peekVariable infer List or Map from a List or Map default (Collections.emptyList(), List.of...)
  instead of the default's implementation class, so a JSON array or object is returned.
- An events() stream first requested after the context or client closed is complete from the start.
- The example declares slf4j-api and slf4j-simple (the project dependency resolves the plain core variant),
  and CI launches the installed example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ible collection defaults

Review-gate follow-ups to the timeout and collection-default fixes:
- orTimeout completes on the JDK's shared delay thread, so the post-attempt step and the retry back-off now run
  on the callback executor; a blocking callback on a timed-out request no longer stalls retries. A timed-out
  exchange is cancelled; requestTimeout rejects values beyond a year (they overflow the millisecond deadline).
- variable/peekVariable keep a constructible collection default's class (TreeMap, LinkedList) and convert into
  it; only non-constructible List/Map defaults (Collections.emptyList(), List.of...) infer the interface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ric conversions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct float reads

Review-gate follow-ups:
- The request deadline now goes on a copy of the HTTP future, so cancelling the original reaches the exchange and
  stops the download (from JDK 16; JDK 11's client keeps reading, a JDK limit).
- Non-constructible collection defaults convert into a class of the same shape: TreeMap for sorted maps,
  LinkedHashSet/TreeSet for sets, so emptySortedMap()/emptySet() defaults no longer throw or fall back.
- Double/Float reads accept every exact conversion (2^60 as Double, 0.3f widened, 0.1 as Float) and reject
  NaN/infinity with the default, logged.
- Tests: cancelled download, caller Content-Type not duplicated, retry completion on the callback executor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ults; untyped Infinity

Review-gate P3 follow-ups:
- Double/Float lossless checks use the computed shortest decimal and digit counts instead of Double.toString /
  Float.toString, whose output changed in JDK 19 (and differs on Android), so every JDK agrees.
- A collection default gets a substitute only when the substitute implements every interface of the default's
  class and extends its public superclass; an EnumSet default falls back to the default instead of failing the
  caller's cast.
- Non-finite numbers fall back only for Double/Float/BigDecimal reads; Object/Number reads keep Infinity.
- The back-off test records where the retry is submitted; the requestTimeout Javadoc states the JDK 11 limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es do not block substitutes

Review-gate follow-ups to 1e124f5:
- A Double/Float read is lossless when the result is the exact source value or its computed shortest decimal
  equals the source's, so 7-digit decimals (1234.567 as a Float) read as written on every JDK.
- Collection substitutes skip marker interfaces with no methods (Kotlin's KMappedMarker), so Kotlin
  emptyList()/emptySet()/emptyMap() defaults convert again; the unused skeleton set is gone.
- Tests: 7-digit decimals (and 1e23) as Float, marker-interface defaults, Infinity read as BigDecimal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ty collection defaults convert

Review-gate follow-ups to 897fd45:
- Double/Float reads now follow Java's own conversion: the nearest value, rejecting only whole-number sources
  that are not exact (2^53 + 1, a large ID), overflow, NaN/Infinity and underflow to zero. The earlier digit-count
  heuristics rejected valid values at powers of two and differed by JDK; every finite float written as the JDK
  prints it now reads back as itself on JDK 11 and 25.
- Collection substitutes also skip final classes in the superclass walk, so Kotlin's public final EmptyList and
  EmptySet defaults convert (tested against kotlin-stdlib, a test-only dependency).
- The shortest-decimal helper handles powers of two; README and Javadoc state the numeric rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g IDs read as Double must be exact

Review-gate follow-ups to f3a2e59:
- Skipping final classes broke defaults typed as a caller's own final collection (ClassCastException) and made
  ConcurrentHashMap.newKeySet() depend on the JDK; now only kotlin.collections.EmptyList/EmptySet/EmptyMap are
  exempt, and every other default without a compatible JDK substitute returns the default.
- Tests: a Long 2^53 + 1 read as Double falls back; a public final collection default falls back; the
  shortest-decimal neighbour search at a power of two.
- README and Javadoc say exactness applies to whole-number JSON values written without a decimal point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review-gate follow-ups to 4123503:
- core-api.jar carries META-INF/proguard/absmartly-core-api.pro: keep the relocated Jackson, the internal JSON
  models and the attributes Jackson reads, keep the names of Kotlin's empty collections (typed variables match
  them by name), and silence the java.net.http transport Android never loads. Verified with R8 8.5.35: a minified
  app with no SDK rules crashed in ABsmartlyClient.build() and now runs; without -keepnames a Kotlin emptyList()
  default silently stayed empty. verifyShadedJar checks the file is in the jar.
- MIGRATING tells Android users to drop the 1.x Jackson rules.
- Tests: the final-collection fixture has no no-argument constructor, so it exercises the substitute check on every
  lane; a kotlin.UIntArray default is not treated as an empty collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….create()

Review-gate follow-ups to e3e8adc:
- New r8-check module (part of check, so CI runs it): minifies a probe app with R8 8.5.35 using only the rules
  shipped in core-api.jar, then runs it alone. It decodes a payload with an unknown field, reads typed and
  class-mapped variables with list and Kotlin defaults, and builds a client on the default transport. Emptying
  the rules file or dropping -keepattributes, the JSON-model keep or the Kotlin -keepnames each fails it.
- The rules keep JdkHttpTransport.create(), which a minified JVM app needs for the default transport; the error
  for a missing transport no longer blames Android only.
- Docs: standalone ProGuard needs -include of the rules; apps keep the fields of their own variable classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onsumer rule is pinned

Review-gate follow-ups to aa3ce2b:
- r8-check minifies the probe a second time against only java.base and java.logging (jmod-extracted), as Android
  has no java.net.http, java.sql or java.beans; the probe now reads a generic List<Slot> field and a Kotlin
  emptySet() default. Removing any single line of the shipped rules fails the build.
- Two -dontwarn lines that nothing needed are gone; the rules header says R8 applies them and ProGuard needs
  -include.
- -PskipR8Check skips the probe offline (R8 comes from Google's Maven repository); CHANGELOG and CONTRIBUTING
  mention the rules and the probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oid comments; R8 task inputs

Review-gate P3s on 0abc49e: the probe needs only Signature and annotations, and each fails the build when
removed; the comments name what Android lacks; extractAndroidLikeLibrary is keyed on java.home, and the Android
minify passes its rules once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joalves

joalves commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Independent sdk-review on 1b62faf: APPROVE, 0 P1/P2/P3 open. This push answers jervasion-absmartly's four findings on edf3e1b. The commits since then went through 10 fresh reviewer passes (cf8a705 through 1b62faf), which found and fixed 12 more P2s: the timeout callback thread and cancellation, collection-default casts, Kotlin empty collections, JDK-dependent float reads, missing R8 consumer rules and their tests. Each pass's report is in .git/sdk-review/.md.

Final reviewer report and evidence log (1b62faf)

APPROVE at 1b62faf: all three P3s from 0abc49e are fixed, and nothing new was found. Every remaining consumer rule still fails the full build when it is removed (10 of 10 rule mutants killed), and the comments now match what a real android.jar measures. What is sound: build passes on JDK 11 plus the JDK 25 test lane with 1440/1440 test cases (720 per lane, 0 failures). No runtime, assignment, exposure, publish or wire code is touched. One gate is still open: CI and Spotless have not run on this exact head because it is not pushed.

Compared:

  • Maven Central com.absmartly.sdk:core-api 1.9.0 (baseline from earlier passes; not re-downloaded);
  • merge base 07807b5;
  • last pushed head edf3e1b (PR java-sdk 2.0.0: idiomatic API #27 head per gh api);
  • previous review 0abc49e;
  • head 1b62faf (1 commit since that review; 2 files, +7/−5).

The consumer rules and r8-check are new in 2.0.0, so they are judged against 0abc49e. Only this PR's delta is a finding.

Re-reviewed 1b62faf (1 commit since 0abc49e).

Verified fixed:

  • Previous P3-1 (InnerClasses,EnclosingMethod not pinned): fixed by dropping the pair.
    • -keepattributes is now Signature,*Annotation*.
    • Each remaining attribute is load-bearing. Removing Signature gives ClassCastException: LinkedHashMap cannot be cast to Probe$Slot (M1). Removing *Annotation* gives Unrecognized field "futureField" (M2).
    • The pair is not needed in practice. With it gone, an external R8 8.5.35 DEX run against the real android.jar (API 34) compiles at min-api 34 (classes.dex 1,550,220 B) and at min-api 26 (1,566,164 B). The JDK lane's minified probe also runs and prints "R8 probe OK".
    • Nothing in the SDK reflects on enclosing or inner-class metadata. getSimpleName appears only in log and exception messages (VariableConverter.java:111-144, Json.java:41, ContextLoadException.java:17), where a minified name is cosmetic. The internal.json models are all top-level classes.
  • Previous P3-2 (inaccurate Android comments): fixed.
    • absmartly-core-api.pro:9-10 now names java.beans.ConstructorProperties and java.beans.Transient. Those are exactly the classes R8 reports missing on android-34 when the Jackson dontwarn is removed. On android-24, R8 also reports java.nio.file.* and java.time.Duration, so "and others" is accurate.
    • r8-check/build.gradle:48-50 now calls the library "stricter than Android" and says Android has parts of java.sql and java.beans. That matches the earlier measurement: 49 java/sql/ classes and 6 java/beans/ classes in android.jar.
  • Previous P3-3 (task inputs, duplicate --pg-conf): fixed.
    • Measured: extractAndroidLikeLibrary ran on JDK 11, ran again on JDK 21 (it was not UP-TO-DATE, as it was before), and was UP-TO-DATE on a second JDK 21 run.
    • minifyProbeForAndroid now passes --pg-conf once (r8-check/build.gradle:85).

Must fix

None.

Tests needed (current implementation correct)

12 full-build mutations: 10 killed, 2 survived. Both survivors are in the test harness itself, not in shipped rules. Neither is a finding:

  • M11: the Android lane's only --pg-conf probe.pro removed → SURVIVED. That lane is compile-only. The consumer rules embedded in core-api.jar still keep the Jackson and model roots, so R8 still resolves (and fails on) the missing-class references. Measured without probe.pro: the shipped jar compiles, and the M5 and M10 jars fail with the same missing classes. So probe.pro is optional in that lane, and leaving it in is harmless.
  • M12: the Android-like library replaced by java.home → SURVIVED. This mutant only weakens the harness. The weakening is visible as M5/M10 being killed only through the jmod library: the JDK lane alone has java.beans and java.net.http. Nothing to add.

Compatibility / parity / forward-compat evidence

  • No public API or runtime change. git show 1b62faf --stat shows the .pro (+3/−2) and r8-check/build.gradle (+4/−3). Nothing under core-api/src/main/java.
  • The embedded rules equal the source. unzip -p core-api.jar META-INF/proguard/absmartly-core-api.pro | cmp - src/... → identical.
  • Forward compatibility under R8. The root futureField still decodes with the shipped rules. It fails under M2 (annotations) and M4 (model keep).
  • Not rerun (the delta is outside these surfaces): released suite on head, the 1.9.0 consumer probe, UID sweep, JS vectors, cross-sdk-tests. Their results from earlier passes stand because no runtime code changed since edf3e1b's review lineage.

Performance

Not applicable: no runtime path changed. Real-android DEX size is 1,550,220 B at API 34, down from 1,567,292 B with the attribute pair. That is an observation, not a claim.

P3 / notes

  • None blocking.
  • Note: extractAndroidLikeLibrary still assumes $java.home/jmods exists, which some JDK 24+ builds lack (JEP 493). CI's Temurin 11 has it, and -PskipR8Check is documented (carried note, no action).

Version and release notes

  • No CHANGELOG or version change in this commit. ## 2.0.0 (unreleased) already lists the consumer rules under Added.

Pre-existing on main (not this PR)

  • CHANGELOG ## 1.9.0 (unreleased) while 1.9.0 is on Maven Central. This is a release gate, carried from earlier passes.

Verification limits / provenance:

  • CI. 1b62faf is not pushed: the check-runs API → HTTP 422 "No commit found". Spotless NOT RUN (download.eclipse.org unreachable). This APPROVE depends on CI, including Spotless, going green on this exact head after the push. For reference, edf3e1b has build ✓ and test-jdk21 ✓.
  • R8. R8 8.5.35 CLI on HotSpot JDK 11 only. No AGP, no desugaring, no ART or device run.
  • Provenance. All counts come from /tmp/sdkrev.l88Y (a detached worktree of 1b62faf, scripts/mut.sh, scripts/dex.sh, mut.out, build.out). The worktree was removed afterwards. The branch working tree is unchanged: git status --short is empty and HEAD is 1b62faf.

sdk-review evidence: java-sdk#27

  • Head: 1b62fafe9cee039dfccba764726cb31467cb607d (local, not pushed; gh api repos/absmartly/java-sdk/pulls/27 --jq .head.sha → edf3e1bf7ecf597911fd5257a6aefc31c9cea410)
  • Mode: independent reviewer (read-only)
  • Previous pass / review: 0abc49e (commits since: 1 — 1b62faf chore: drop unneeded InnerClasses/EnclosingMethod keep; accurate Android comments; R8 task inputs)
  • Started / finished (UTC): ~13:22 / 13:42, 2026-11-18

1. Trees

Tree Identifier How obtained Verified
Released Maven Central core-api 1.9.0 earlier passes (not re-downloaded) carried
Main / merge base 07807b5 brief + earlier passes carried
Last pushed edf3e1b gh api .../pulls/27 --jq .head.sha yes
Head 1b62faf git worktree add --detach /tmp/sdkrev.l88Y/head 1b62faf; git rev-parse HEAD yes

Version / X-Agent / CHANGELOG: unchanged by this commit (git show 1b62faf --stat: 2 files).

2. Backwards compatibility

  • API diff: git show 1b62faf --stat → no Java source changed. API surface is identical to 0abc49e.
  • Consumer probe, released suite, UID sweep: NOT RUN (no runtime delta). Earlier results are carried.
  • Reflection metadata check: grep getSimpleName|getEnclosingClass|isAnonymousClass|isMemberClass|getDeclaringClass|new TypeReference core-api/src/main/java → only getSimpleName in log/exception text. No enclosing/inner-class reflection.

3. Parity

  • NOT RUN: there is no assignment, matcher, wire or header change. cross-sdk-tests are carried from earlier passes.

4. Tests and mutation

  • Full suite on head: JAVA_HOME=jdk11 ./gradlew --no-daemon build --continue -x spotlessCheck -Porg.gradle.java.installations.paths=jdk25 → BUILD SUCCESSFUL in 1m15s, rc=0.
    • JUnit XML: 1440 test cases, 0 failures, 0 skipped, across 52 classes per lane (test + testJdk25, 720 each).
    • r8-check ran extractAndroidLikeLibrary, minifyProbeForAndroid, minifyProbe and runMinifiedProbe → "R8 probe OK".
# Mutant Killed by Result
M1 .pro drop Signature runMinifiedProbe: ClassCastException LinkedHashMap → Probe$Slot killed
M2 .pro drop *Annotation* runMinifiedProbe: Unrecognized field "futureField" killed
M3 .pro drop -keep …shaded.jackson.** runMinifiedProbe: ExceptionInInitializerError killed
M4 .pro drop -keep …internal.json.** runMinifiedProbe: Unrecognized field "futureField" (class e.b) killed
M5 .pro drop -dontwarn …shaded.jackson.** minifyProbeForAndroid: Missing class java.beans.ConstructorProperties killed
M6 .pro drop EmptyList keepnames "R8 probe failed: Kotlin emptyList default" killed
M7 .pro drop EmptySet keepnames "R8 probe failed: Kotlin emptySet default" killed
M8 .pro drop EmptyMap keepnames "R8 probe failed: Kotlin emptyMap default" killed
M9 .pro drop JdkHttpTransport.create() keep IllegalStateException: default transport not available (NoSuchMethodException a.k0.create()) killed
M10 .pro drop -dontwarn java.net.http.** minifyProbeForAndroid: Missing class java.net.http.HttpClient$Builder killed
M11 build.gradle:85 drop the Android lane's --pg-conf — SURVIVED (harness-only; probe.pro is optional in a compile-only lane, see review)
M12 Android lane --lib → java.home — SURVIVED (harness weakening; second-order, no test can kill it)

Totals: 12 run / 10 killed / 2 survived. Both survivors are harness mutants, not findings.

  • Mutation command: scripts/mut.sh ID FILE SED (sed mutant, then full build --continue -x spotlessCheck, then restore). The final git status --short in the worktree printed 0 lines.

Fix-commit audit:

Commit New state Where it must be set/cleared/read Entry points skipping it Mutant
1b62faf -keepattributes narrowed to Signature,*Annotation* R8 JDK lane + Android lane + real android.jar none (real android-34 min-api 34/26 compile OK) M1, M2 killed
1b62faf inputs.property("javaHome") on extract task Gradle up-to-date check n/a measured: jdk11 ran → jdk21 ran → jdk21 UP-TO-DATE
1b62faf one --pg-conf in the Android lane minifyProbeForAndroid n/a M11 (harness, survives harmlessly)
1b62faf comment text .pro:9-10, build.gradle:48-50 n/a checked against R8 missing-class output on android-34/24

5. Performance

Path 0abc49e head probe / runtime counter test
runtime paths unchanged unchanged n/a n/a
real android-34 DEX size 1,567,292 B 1,550,220 B R8 8.5.35, min-api 34 n/a (observation)

6. Forward compatibility

  • Root futureField in the probe decodes under the shipped rules. M2 and M4 show that the keep and annotation rules are what makes it work. No other forward-compat surface changed.

7. Build / CI

  • Embedded rules: unzip -p core-api/build/libs/core-api.jar META-INF/proguard/absmartly-core-api.pro | cmp - core-api/src/main/resources/... → identical.
  • Real android.jar (platform-34-ext7_r03), R8 8.5.35 DEX mode (scripts/dex.sh):
    • shipped rules: min-api 34 → rc=0, 1,550,220 B; min-api 26 → rc=0, 1,566,164 B;
    • M5 jar (jar uf with the dontwarn removed) → rc=1, Missing java.beans.ConstructorProperties and java.beans.Transient;
    • M10 jar → rc=1, Missing java.net.http.HttpClient$Builder and HttpClient$Redirect;
    • M5 on android-24 → additionally missing java.nio.file.* and java.time.Duration (desugaring requirement, documented).
  • Android-like lane without probe.pro (manual R8 --classfile): shipped → rc=0 (1,677,776 B); M5 → rc=1; M10 → rc=1.
  • Extract-task inputs: JDK 11 → executed; JDK 21 → executed; JDK 21 again → UP-TO-DATE.
  • Floors: unchanged (no build-floor edits).
  • CI on this exact head: gh api .../commits/1b62faf.../check-runs → HTTP 422 "No commit found" (not pushed). Last pushed head edf3e1b: build success, test-jdk21 success, CodeRabbit skipped.
  • Spotless: NOT RUN (download.eclipse.org unreachable).
  • Pins: unchanged by this commit.

8. Docs / CHANGELOG

  • No CHANGELOG change. The existing Added entry (CHANGELOG.md:46) still holds.
  • Stale-claim grep: git grep InnerClasses|EnclosingMethod|java.sql|java.beans|every rule (non-gradle) → only the .pro header "r8-check … tests every rule" (now true: 10/10 rule lines killed) and the corrected comment.

Findings

Sev Title Evidence line above Fixed in
— none — —

Verification limits

  • CI and Spotless on 1b62faf: NOT RUN (not pushed; the Eclipse formatter download is blocked). Check after the push.
  • Steps 2 (consumer probe/released suite/UID sweep), 3 and 5 runtime benchmarks: NOT RUN, because nothing under core-api/src/main/java changed. Results are carried from earlier passes.
  • R8 only via the CLI on HotSpot. No AGP, desugaring or ART execution.

lux worker and others added 2 commits November 18, 2026 13:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ace a stream close

Review follow-ups (independent reviewers on d2f02dc):
- JdkHttpTransport no longer lets the JDK client follow redirects: it would resend every header, the API key
  included, to any host a redirect names. The transport follows up to 5 redirects itself, only to the same
  scheme, host and port (301/302/303 as GET, 307/308 with method and body); a redirect elsewhere is returned as
  the 3xx response. 1.x's Apache client followed cross-host redirects; MIGRATING lists the change.
- EventStream.submit drops an event whose stream closes between the isClosed check and offer() instead of
  throwing IllegalStateException into treatment()/track().
- Tests: same-origin redirect with headers, no request to another origin, 308 keeps method and body, redirect
  loops stop, origin comparison, and a deterministic close-in-the-gap stream test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested

This follow-up fixes the four earlier defects, but the exact head is not ready to merge: the new R8 Gradle module fails the repository formatter, and four runtime failure/lifecycle paths remain reproducibly broken.

Next step: fix the five inline findings below and add focused regression coverage for the runtime cases.

Must fix

  1. R8 module fails Spotless — the exact-head build fails :r8-check:spotlessGroovyGradleCheck; see the inline finding.
  2. Typed numeric reads lose JSON precision — values that the new contract says to reject are returned as converted values.
  3. The documented async checkout can deadlock — a single-thread executor can block the worker needed to publish during try-with-resources close.
  4. Rejected retry scheduling leaves requests pending forever — a 503 retry can remain incomplete after the configured timeout.
  5. Event-stream scheduling failure changes a successful load to FAILED — stream delivery must not determine context-load outcome.

What I checked

  • ✅ Exact-head Actions test-jdk21 passed.
  • ❌ Exact-head Actions build failed; the check annotation identifies :r8-check:spotlessGroovyGradleCheck.
  • ✅ Local JDK 11 build/test path passed through the core, example and R8 probe when R8 was supplied from the published 8.5.35 archive; 1440 core test cases passed across the JDK 11/25 lanes.
  • ✅ Installed example reaches ContextLoadException rather than a class-loading failure.
  • ⚠️ Android/ART was not run; exact-head CI is already a material failure, so approval is withheld.
Review details

Head: 1b62fafe9cee039dfccba764726cb31467cb607d; base and merge-base: 07807b516df5ad0d7d92e5b682041982802cd871; review round 2; follow-up to review PRR_kwDOFfwdN88AAAABYp6VdA. The four earlier findings are resolved and their threads are outdated/resolved.

Convergence summary — review round 2

  • Unresolved original blockers: 0
  • Remediation regressions: 4
  • Independent PR-change findings: 1
  • Acceptance criteria still open: Spotless passes for the complete build; typed numeric reads preserve the source value until conversion; documented async checkout completes on a single-worker executor; rejected retry scheduling settles the request; stream delivery failure cannot fail a successful load.
  • Human adjudication requested: no

Passes (non-blocking): run: core runtime/API/security/data, error handling and error messages (delegated specialist completed), tests/CI/packaging/end-to-end harnesses, deployment/operations/observability, cross-cutting simplicity, behaviour-bearing data/policy, comment hygiene, diff composition | not run: shared-component blast radius (no frontend source changed)

Comment hygiene (non-blocking): 573 comment / 5793 code lines, ratio ~1:10.1, 5 blocks flagged

  • core-api/src/main/java/com/absmartly/sdk/ContextState.java:3, narrates the removed 1.x API;
  • core-api/src/main/java/com/absmartly/sdk/ReadyEvent.java:7-9, narrates the old event timing;
  • core-api/src/test/java/com/absmartly/sdk/ABsmartlyClientTest.java:558,566,618, narrates compatibility/test sequencing;
  • core-api/src/main/java/com/absmartly/sdk/EventStream.java:42, restates the test counter;
  • core-api/src/main/java/com/absmartly/sdk/Context.java:225, narrates 1.x semantics.
    threshold T=58; restatements counted: no (10 × C < E). These are below the measured promotion threshold and do not block.

Diff composition (non-blocking): every file is required for the change; none flagged. The introduced-content audit retained 256 writes across 256 unique blobs and found no credential or scratch artifact.

Simplifications (non-blocking): 5 candidates

  • Client.java:109-128: use lambdas/thenAccept without changing the three async stages;
  • EventDispatcher.java:50-58: return a lambda subscription;
  • JdkHttpTransport.java:118-135: share timeout-exception construction;
  • VariableConverter.java:203-229: specialize the private shortest-decimal helper;
  • core-api/build.gradle:113-140: reuse one ZipFile scope.
    Run a simplification pass locally before pushing: these candidates cost less to address now than as a further review round.

Validation commands included JAVA_HOME=... ./gradlew build :example:installDist -x spotlessCheck --continue, the same build with R8 8.5.35 supplied from its published archive, local spotlessCheck using the repository formatter, the installed example launcher, and focused Java 11 probes. The ordinary build could not resolve R8 from dl.google.com, so the published R8 archive was used for the equivalent R8 tasks; the formatter reproduced the remote failure exactly.

lux worker and others added 2 commits November 20, 2026 10:48
…implementation class

Attributes are snapshotted into unmodifiable lists and maps, so the class check in ExprEvaluator.compare
made eq and in fail against the ArrayList/LinkedHashMap literals parsed from the audience. Caught by
cross-sdk-tests scenarios 101-104 and 111.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…content; test empty and nested cases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved

The post-approval changes are ready to merge. They correctly bound variant lookup to the prepared slots, preserve the negative-override behavior, resolve redirect targets only for redirect responses, and make the deadline regression test exercise the real hop timing.

Next step: None — ready to merge.

What I checked

  • ✅ Exact-head Actions build and test-jdk21 passed on ffad16ef87b4ed7d1d6aaf83b352f70d0bd0a528.
  • ✅ Focused local Java 11 validation passed: 109 tests across JdkHttpTransportTest and ABsmartlyClientTest.
  • ✅ The changed redirect cases passed, including non-redirect Location, deadline-bounded draining, production cancellation timing, and expired-hop behavior.
  • ✅ The changed context cases passed, including negative overrides, cleared absent overrides, malformed/throwing variant configs, and stored-slot bounds.
  • ⚠️ The full local check task could not load the repository formatter because the environment could not resolve download.eclipse.org; exact-head CI supplied the passing formatter/build evidence.
Review details

Reviewed head: ffad16ef87b4ed7d1d6aaf83b352f70d0bd0a528
Base: 07807b516df5ad0d7d92e5b682041982802cd871
Responsibility baseline: approved commit 2e86e8585a04ab5dc2d2fea40d651daf0c2c97b5
Review round: 7; post-approval follow-up.

Convergence summary — review round 7

  • Unresolved original blockers: 0
  • Remediation regressions: 0
  • Independent PR-change findings: 0
  • Acceptance criteria still open: none
  • Human adjudication requested: no

Passes (non-blocking): run: core runtime/API/security/data; error handling and error messages (delegated specialist completed); tests/CI/packaging/end-to-end harnesses; deployment/operations/observability; cross-cutting simplicity; behaviour-bearing data/policy; comment hygiene; diff composition | not run: shared-component blast radius (no frontend source changed)

Comment hygiene (non-blocking): 7 comment / 75 code lines, ratio ~1:10.7, none flagged
threshold T=5; restatements counted: no (10 × C < E)

Diff composition (non-blocking): every file is required for the change; none flagged. The pinned introduced-content audit completed successfully and retained 10 content-write records; no credential, scratch artifact, build output, or other unnecessary file was identified.

Simplifications (non-blocking): none.

The adversarial runtime pass and the delegated error specialist found no candidate introduced between the approved commit and this head. Existing accepted behavior was not reopened.

lux worker and others added 2 commits November 20, 2026 11:14
…RATING with the two exceptions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jervasion-absmartly
jervasion-absmartly dismissed their stale review November 20, 2026 11:17

New commits were added after this approval. Jervasion will reassess the updated head.

@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Final independent sdk-review on 6d52f41: APPROVE, 0 P1/P2/P3.

Delta since ffad16e:

  • cb0676d, a behaviour fix found by the local cross-sdk run. Attributes are snapshotted into unmodifiable lists and maps, and ExprEvaluator.compare checked classes, so a list or map attribute never matched an equal audience value. Cross-sdk scenarios 101-104 and 111 failed on the 2.x lane and passed on 1.x. Lists and maps now compare by content, as javascript-sdk does.
  • 46a13fc, 06b43e7 and 6d52f41. They document the widened matching: a CHANGELOG 2.0.0 Breaking-changes entry and a MIGRATING caveat. They also add edge-case tests. These close the P3s from the gates on cb0676d and 46a13fc.

Results on cb0676d, the last code change:

  • 4/4 mutants killed.
  • 769 tests pass on JDK 11 and on JDK 25.
  • Local cross-sdk suite: java 304/304 with 1 agreed skip, java-v1 279/279 with 26 skips. All SDKs agree across 1,311 comparisons.

Per the new owner policy, the cross-sdk-tests changes are listed in the PR body under "cross-sdk-tests changes needed". They are on branch feat/java-sdk-v2-lanes at 16eaaef, and cross-sdk-tests#27 stays open for the consolidation worker.

Reviewer report and evidence log (cb0676d)

APPROVE at cb0676d: the fix restores content equality for List and Map audience operands, which the 2.x attribute snapshot (25c16c4/29098c3) had broken. It matches javascript-sdk isEqualsDeep for every case where 1.9.0 matched and keeps every 1.9.0 mismatch for the probed cases. Both new tests fail without the fix, and the build passes on JDK 11 and JDK 25. Remaining items are P3 only: one CHANGELOG line, and a pre-existing numeric-type parity gap that is also in 1.9.0.

Re-reviewed cb0676d (1 commit since the pushed head ffad16e, gate report ffad16e…md = APPROVE). Baselines: published core-api-1.9.0.jar (~/.m2/repository/com/absmartly/sdk/core-api/1.9.0/) and tag v1.9.0 source, then merge base 07807b5 (origin/main), then head. Parity was checked against javascript-sdk main src/utils.ts isEqualsDeep and src/jsonexpr/evaluator.ts compare, fetched with gh api. Only this commit's delta is a finding.

Must fix

None.

Tests needed (current implementation correct)

5 full-suite mutation runs (:core-api:test, JDK 11, 769 tests each), plus a full revert of the fix. Result: 4 killed, 2 survived, and both survivors are equivalent or out of scope.

Mutant Result Killer
M0: revert the fix (git show cb0676d -- core-api/src/main | git apply -R) killed, 2 failed anAudienceMatchesListAndMapAttributesByContent, ExprEvaluatorTest.testCompareObjects
M1: List branch only (Map arm dropped) killed, 2 failed same two
M2: Map branch only (List arm dropped) killed, 2 failed same two
M3: lhs.equals(rhs) → true killed, 1 failed testCompareObjects ([1,2] vs [3,4])
M4: cross-kind guard (List||Map) && (List||Map) survived Equivalent. List.equals(Map) and Map.equals(List) are always false under the List/Map contracts, so the result is null either way. The new assertion unmodifiableList([1,2]) vs {a:1} already pins the null.
M5: drop getClass()== in the pre-existing fallback survived Out of delta. That line is unchanged from 1.9.0 and now reaches only non-List/Map/scalar objects (sets, arrays, custom objects). It is not a test gap of this commit.

Fix-commit audit (cb0676d):

  • New state: none. There are no flags, caches or public names. The commit only adds a branch in ExprEvaluator.compare.
  • Callers of compare are EqualsOperator (eq), InOperator (list haystack: compare(item, needle), so in over a list of lists is covered), and gt/gte/lt/lte. For those, compare returns only 0 or null for List and Map, so gt/lt stay null (no match). That is the same as 1.9.0 and as JS, where isEqualsDeep gives 0 or null.
  • Entry points: audiences and assignment-rule conditions both go through AudienceMatcher → JsonExpr.evaluateBooleanExpr → ExprEvaluator, so one fix covers both. The attribute snapshot is applied in ContextOptions.java:31 (builder attributes), Context.java:616 (setAttribute) and Context.java:924. All three produce the same unmodifiable types, and the end-to-end test exercises setAttribute.
  • Other class-based comparisons of snapshotted values: git grep getClass in core-api/src/main finds only equals() implementations of internal JSON models, VariableConverter (it types the variable default, not attributes), Algorithm and error messages. SwitchbackAttributePath.step uses instanceof List/Map, not class equality, and SwitchbackServing compares normalised strings. No other site compares an attribute against a literal by class.

Compatibility / parity / forward-compat evidence

Direct compare() probe. Head classes (core-api/build/classes) and the published 1.9.0 jar were run with the same driver on JDK 11. JS values were derived from the isEqualsDeep source quoted in the evidence log (=== on primitives, so 1 === 1.0).

lhs vs rhs head 1.9.0 jar JS isEqualsDeep
ArrayList[1,2] vs ArrayList[1,2] 0 0 true
unmodifiableList[1,2] vs ArrayList[1,2] (the 2.x snapshot) 0 null* true
List.of(1,2) vs ArrayList[1,2] 0 null true
empty list vs empty map (both directions) null null false (Array.isArray mismatch)
[1] vs {"0":1} null null false
nested unmod [[1,2],[3]] vs ArrayList literal 0 null* true
nested unmod {a:{b:[1]}} vs LinkedHashMap literal 0 null* true
HashMap{a:1} vs LinkedHashMap{a:1} 0 null true
[1,2] vs [2,1] null null false
["1"] vs [1] null null false (strict === inside arrays)
[Long 1] vs [Integer 1] null null true
[Double 1.0] vs [Integer 1] null null true
{a:Long 1} vs {a:Integer 1} null null true

* In 1.9.0 these inputs never arise from an ArrayList attribute, because 1.x stored the caller's object as-is. Under 1.x an ArrayList/LinkedHashMap attribute matched and every other List/Map implementation did not. At ffad16e (with the snapshot, before this fix) no List or Map attribute could match. That is the regression cross-sdk-tests 101–104 and 111 caught (orch-ffad16e.log:208-221: java audienceMismatch:true, variant 0; java-v1 variant 1).

  • Restored vs 1.9.0: every List/Map case that matched in 1.9.0 matches at head, and every probed case that mismatched for content reasons still mismatches.
  • Widened vs 1.9.0 (towards JS): a non-ArrayList list (Arrays.asList, List.of, Collections.unmodifiableList) or a non-LinkedHashMap map (HashMap, TreeMap, Map.of) now equals an equal-content literal. In 1.9.0 it did not, so with audienceStrict such a unit got variant 0. This is a JS-parity bug fix, but it can move units (see P3-1).
  • Number types inside containers: List.equals uses element equals, so Long 1, Integer 1 and Double 1.0 differ. JS treats them as equal. This is identical to 1.9.0 (no parity change from 1.x), but it differs from JS. Not introduced here (see P3-2). Top-level scalars are unaffected because they go through numberConvert.
  • Cross-sdk-tests (/workspace/repos/xsdk/orch-cb0676d.log, xsdk java-sdk checkout at cb0676d, java-v1 at 853feb3 = v1.9.0): 305 scenarios. java 304 eligible / 1 skip (clientAcceptsBlankApplication, a reviewed exception). java-v1 279 eligible / 26 skips (25 switchback, 1 blank application). 0 FAIL lines. "all SDKs agree (1311 comparisons)". Before the fix (orch-ffad16e.log), 101, 102, 103, 104 and 111 FAILED on java.
  • Public API: no change. ExprEvaluator is in internal.

Performance

Static only, no timing claimed. The new branch costs two instanceof checks on the non-scalar path. That replaces one getClass() comparison and adds nothing to the ordinary no-audience path. AbstractList.equals/AbstractMap.equals are O(n), the same as the old equals once classes matched.

P3 / notes

  1. P3: CHANGELOG/MIGRATING do not mention the widened container equality. MIGRATING.md:3 says 2.0 "does not change what the SDK decides". A strict audience using eq/in against a list or object literal now matches a List.of/Arrays.asList/HashMap attribute that 1.9.0 rejected. That affects only that rare targeting, and the change follows JS. Please add one line under the 2.0.0 Changed section of CHANGELOG.md, for example: "Audience eq/in compare list and map attributes by content whatever their Java implementation (1.x matched only ArrayList/LinkedHashMap); units with such attributes under strict audiences can move from variant 0." Optionally add the same caveat to MIGRATING.md:3.
  2. P3, pre-existing in 1.9.0, track separately: numeric element types in containers. ExprEvaluator.java:152-156. For [1L] vs the literal [1], and for [1.0] vs [1], the result is null in both Java versions and true in JS. Do not fix it in this PR (it would change 1.x behaviour). A follow-up could add an isEqualsDeep port that number-converts leaves.
  3. Note: the new ExprEvaluatorTest assertions do not include the empty-list vs empty-map case or a nested-snapshot case. The empty case is covered by the equivalent M4. The nested case is covered by cross-sdk 102/104, but not by the unit suite. Optional cheap hardening: assertNull(compare(unmodifiableList(EMPTY_LIST), EMPTY_MAP)) and a nested unmodifiableList(unmodifiableList(...)) vs literal.
  4. Formatting: ExprEvaluator.java:152 is exactly 120 columns with tab = 4. Eclipse lineSplit is 120 (gradle/spotless.eclipseformat.xml), so it should not be wrapped, but Spotless was NOT RUN locally (see Step 7).

Version and release notes

No version change in this commit. The 2.0.0 section is unreleased. Released sections are untouched (git show cb0676d --stat: 3 files, none docs).

Pre-existing on main (not this PR)

  • The numeric-type-in-container parity gap (P3-2) exists in the published 1.9.0.

Verification limits / provenance: Spotless could not resolve its formatters offline (Could not create task ':core-api:spotlessGroovyGradle'), so it is NOT RUN. The latest CI run, 44632929436 (success), is on ffad16e, not cb0676d. The caller must wait for CI on cb0676d (the Spotless step) before claiming all gates are green. JS behaviour was derived from the isEqualsDeep/compare source, not executed (no node runtime vectors were run). Cross-sdk counts are taken from the caller's logs; the xsdk java-sdk checkout was confirmed at cb0676d.


Evidence log: head cb0676dcc995f6d8c16f8d1659b963b211040eba

Scratch: mktemp -d → /tmp/tmp.Odj37uxcDV, with detached worktrees head and mut at cb0676d. Both were removed afterwards (git worktree remove --force; git worktree list no longer shows them). git status --short on the branch is empty, and HEAD is unchanged.

Step 1: trees. git rev-parse HEAD = cb0676dcc995…. Released artifact: ~/.m2/.../core-api-1.9.0.jar (contains com/absmartly/sdk/jsonexpr/ExprEvaluator.class). Tag source: git show v1.9.0:core-api/src/main/java/com/absmartly/sdk/jsonexpr/ExprEvaluator.java (compare fallback: lhs.getClass() == rhs.getClass() && lhs.equals(rhs)). Merge base 07807b5. PR #27 head on GitHub = ffad16e (cb0676d not pushed). Delta: git show cb0676d --stat, 3 files, +34.

Step 2: compat. No public API change (the internal package only). Behaviour probe with P.java (compare matrix above), run against head core-api/build/classes/java/main + slf4j 2.0.16, and against the 1.9.0 jar. Output is reproduced in the table. Released test suite: NOT RUN for this delta (unchanged since the ffad16e gate; the delta touches only compare).

Step 3: parity. gh api repos/absmartly/javascript-sdk/contents/src/utils.ts gives isEqualsDeep: a===b, typeof equal, numbers === (NaN==NaN), arrays require Array.isArray(b) and equal length then elementwise deep, objects require isObject(b) and equal key count then per-key hasOwnProperty+deep. src/jsonexpr/evaluator.ts:179-216 compare: number/string/boolean convert, default isEqualsDeep ? 0 : null. Cross-sdk: orch-cb0676d.log summary at lines 621-640 (java 304/304, 1 skip; java-v1 279/279, 26 skips; 1311 comparisons agree; grep -c FAIL = 0). orch-ffad16e.log:208-221: 101-104 and 111 FAIL on java.

Step 4: tests/mutation. Head full suite: core-api/build/test-results/test 769 tests, 0 failures, 0 errors, 0 skipped; testJdk25 769/0/0/0. Mutants as in the table. Each was run with ./gradlew --offline :core-api:test -PskipR8Check in the mut worktree, followed by git checkout -- . (each substitution was confirmed with git diff --stat = 1 insertion, 1 deletion):

  • M0 revert: 769 tests completed, 2 failed, anAudienceMatchesListAndMapAttributesByContent, testCompareObjects.
  • M1: 2 failed (same). M2: 2 failed (same). M3: 1 failed (testCompareObjects). M4: exit 0 (equivalent). M5: exit 0 (pre-existing line, out of delta).

Step 5: perf. Static only. See the Performance section.

Step 6: forward-compat. Not affected by this delta (no decoder change). NOT RUN for this commit; covered by the ffad16e gate.

Step 7: build/CI. JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew --offline build -x spotlessCheck -PskipR8Check :core-api:testJdk25 on the head worktree: BUILD SUCCESSFUL in 41s, 21 tasks executed, exit 0. Spotless: ./gradlew --offline :core-api:spotlessCheck fails with exit 1 because the formatter could not be resolved, so it is NOT RUN. Manual check: the new lines are at most 120 columns (tab = 4) against lineSplit 120. CI: gh run list --branch next/major shows the latest run 44632929436 = success on ffad16e. There is no run on cb0676d yet, so it is pending.

Step 8: docs. CHANGELOG.md 2.0.0 (unreleased) has no entry for container equality. MIGRATING.md:3 claims no decision changes, and MIGRATING.md:171 says "a map or list value is copied when set". See P3-1.

Step 9: verdict. APPROVE (no P1/P2). P3-1 is a docs line, P3-2 is pre-existing (track separately), and P3-3 is optional test hardening. CI on cb0676d (Spotless) must be green before the push is considered gated.

Reviewer report and evidence log (46a13fc)

APPROVE at 46a13fc: the three P3s from the cb0676d gate are closed. The new CHANGELOG and MIGRATING text matches the code and the measured 1.9.0 behaviour. Both builds pass with 769/769 tests on JDK 11 and on JDK 25. Only optional wording nits remain.

Re-reviewed 46a13fc (2 commits since the pushed head ffad16e: cb0676d and 46a13fc). cb0676d was gated APPROVE in .git/sdk-review/cb0676d….md. This pass re-measures what that commit changed and audits 46a13fc in full. Baselines:

  • published core-api-1.9.0.jar (~/.m2/repository/com/absmartly/sdk/core-api/1.9.0/) and tag v1.9.0 source;
  • merge base 07807b5;
  • head.

Only the delta git diff ffad16e HEAD (5 files, +53/-2) is a finding.

Must fix

None.

Verified fixed (P3s from the cb0676d gate)

  1. P3-1, CHANGELOG/MIGRATING caveat: closed.
    • CHANGELOG.md:5-7: the 2.0.0 intro now lists list and map attributes in audience conditions as an exception.
    • CHANGELOG.md:44-50: a new Breaking-changes bullet, flagged "This can change assignment for running experiments". It says who moves: a unit under an enforced audience that got variant 0 can now be randomized normally.
    • MIGRATING.md:3-7: the intro now names "two exceptions" and links to the CHANGELOG.
    • Placement: "Breaking changes" is stricter than the "Changed" section I suggested, which is acceptable. 2.0.0 has no Changed section.
  2. P3-2, numeric element types: documented as requested. CHANGELOG.md:49-50 says "Numbers inside lists and maps still compare by Java type, as in 1.x: 1L does not equal 1." This is measured true on both 1.9.0 and head (probe rows below). It stays a pre-existing JS-parity gap, to track separately, and was correctly left unfixed here.
  3. P3-3, test hardening: closed. ExprEvaluatorTest.java:291-292 checks empty list vs empty map in both directions. ExprEvaluatorTest.java:293-296 checks a nested unmodifiable snapshot (list of an unmodifiable list and an unmodifiable map holding a list) against an ArrayList/LinkedHashMap literal. Both pass on head, and a mutant kills each one (table below).

Docs accuracy: the "ArrayList only / LinkedHashMap only" claim

The 1.9.0 ExprEvaluator.compare fallback is lhs.getClass() == rhs.getClass() && lhs.equals(rhs). 1.9.0 setAttribute stored the caller's object as-is (Context.java v1.9.0, new Attribute(name, value, …)). The default DefaultAudienceDeserializer uses readerForMapOf(Object.class), and Jackson's untyped deserializer always yields ArrayList/LinkedHashMap for literals.

The probe ran the real AudienceMatcher + DefaultAudienceDeserializer with eq and in against the 1.9.0 jar and the head jar (JDK 11):

attribute value vs literal 1.9.0 eq/in head eq/in
ArrayList[1,2,3] vs [1,2,3] true/true true/true
Arrays.asList false/false true/true
List.of false/false true/true
unmodifiableList(ArrayList) false/false true/true
ArrayList subclass false/false true/true
LinkedList false/false true/true
empty ArrayList vs [] true/true true/true
List.of() vs [] false/false true/true
LinkedHashMap{a:1} vs {"a":1} true/true true/true
HashMap / Map.of / TreeMap false/false true/true
empty LinkedHashMap vs {} true/true true/true
ArrayList[List.of(1), Map.of(a,List.of(2))] vs [[1],{"a":[2]}] true/true true/true
ArrayList[1L] vs [1] false/false false/false
ArrayList[1.0] vs [1] false/false false/false
List.of(1L) vs [1] false/false false/false
empty list vs {} false/false false/false

Verdict on the claim: it is accurate for the top-level attribute value. In 1.9.0 a list matched only if its class was exactly ArrayList (a subclass also failed), and a map only if it was exactly LinkedHashMap. Every widened row is one the CHANGELOG describes, and nothing that matched in 1.9.0 stops matching at head. Two nuances are not stated; they are optional P3 wording (P3-a below):

  • the class check applied only to the outer value, because nested containers used equals (content). A List.of nested inside an ArrayList already matched in 1.9.0;
  • the claim assumes the default audience deserializer. 1.9.0 exposed ABSmartlyConfig.setAudienceDeserializer (README v1.9.0:170), and a custom deserializer that produced other classes would have changed which class "matched". That extension point is removed in 2.0 (MIGRATING.md:42), so this is moot for 2.0 users.

The rest of the bullet is also accurate:

  • "audience or assignment-rule condition": both paths use AudienceMatcher → JsonExpr → ExprEvaluator.compare;
  • "eq or in": in over a list haystack calls compare(item, needle);
  • "as javascript-sdk does": isEqualsDeep, per the cb0676d gate.

MIGRATING.md anchor

MIGRATING.md:5 links #units-attributes-overrides-custom-assignments. The heading is MIGRATING.md:165 ### Units, attributes, overrides, custom assignments. GitHub's slug (lower-case, drop punctuation, spaces → -) is exactly units-attributes-overrides-custom-assignments, and no other heading has the same slug. The "Custom objects as attribute or goal values" paragraph it points to is in that section (MIGRATING.md:184). It resolves correctly.

Tests needed (current implementation correct)

4 full-suite mutation runs (:core-api:test, JDK 11, 769 tests each), targeted at the new assertions. Result: 4 killed, 0 survived.

Mutant Result
M0: revert the cb0676d fix (cb0676d gate) killed (2 failed)
MA: guard widened to cross-kind, and two empty containers of any kind compare 0 killed: 1 failed, expected <null> but was <0> (the empty list vs empty map assertions)
MB: element comparison by class (shallow content, getClass()== per element) killed: 1 failed, expected <0> but was <null> (the new nested-snapshot assertion; no other test caught it)
MC: Map arm dropped killed: 2 failed (ABsmartlyClientTest.java:1060, ExprEvaluatorTest.java:288)

Note: the MA failure comes from the new lines 291-292, or from the pre-existing ExprEvaluatorTest.java:281 (EMPTY_LIST vs EMPTY_MAP). The per-line attribution for MA and MB was not captured (the XML was overwritten by the next run). MB fails only because of a nested assertion, and the only nested unit assertion is the new one at 293-296.

Fix-commit audit (46a13fc):

  • New state: none. Docs and tests only; git show 46a13fc --stat touches no src/main file.
  • cb0676d was audited in its own gate. At head there is no new flag, cache or public name, and ExprEvaluator is in internal.

Compatibility / parity / forward-compat evidence

  • Public API: unchanged by the delta.
  • Behaviour: see the probe table. Head widens matching towards JS only. Every 1.9.0 match is preserved, and the numeric-type mismatches are identical to 1.9.0.
  • Cross-sdk: not re-run for 46a13fc, because there is no main-code change since cb0676d. The cb0676d gate recorded orch-cb0676d.log: java 304 eligible / 1 skip of 305, 0 FAIL.

Performance

No main-code change in 46a13fc. For cb0676d see its gate: static only, with two instanceof checks on the non-scalar compare path.

P3 / notes

  • P3-a (optional wording), CHANGELOG.md:46-47. "In 1.x a list matched only if it was an ArrayList, and a map only if it was a LinkedHashMap" is right for the attribute value itself. Please consider "only if the attribute value itself was exactly an ArrayList … (nested lists and maps already compared by content)". That stops a reader from concluding that nested List.of values used to fail.
  • P3-b (optional wording), MIGRATING.md:3. The first sentence still says 2.0 "does not change what the SDK decides or sends", and the next sentence lists two exceptions. Consider "barely changes" or "does not change …, except:". Cosmetic.
  • Numeric element types in containers: pre-existing in 1.9.0, documented, track separately (as before).

Version and release notes

The 2.0.0 section is still "(unreleased)". Released sections are untouched (the diff hunks are only at CHANGELOG.md:3-7 and :41-50). No version source changed.

Pre-existing on main (not this PR)

  • The numeric-type-in-container JS-parity gap (1.9.0 and head both return false for [1L] vs [1]; JS returns true).

Verification limits / provenance:

  • Spotless is NOT RUN: the formatter cannot be resolved offline.
  • Manual format check on the added Java lines: none is longer than 120 columns (tab = 4), there is no trailing whitespace and no space indentation.
  • CI has not run on 46a13fc. The latest run is 44632929436 (success) on ffad16e. Wait for CI (the Spotless step) on the pushed head before calling all gates green.
  • JS behaviour comes from the cb0676d gate's source reading, not from executed vectors.

Evidence log: head 46a13fce4617a8c2ec5569c1459adf8a575c6fb4

Scratch: mktemp -d → /tmp/tmp.3Wq60px6a9, with detached worktrees head and mut at 46a13fc. The probe dir was /tmp/tmp.zRUmDmsAyf. All were removed afterwards (git worktree remove --force ×2, rm -rf). git worktree list shows no scratch tree of this run, and the pre-existing ones were left as found. git status --short is empty and git rev-parse HEAD = 46a13fce… before and after.

Step 1: trees.

  • git rev-parse HEAD = 46a13fce4617a8c2ec5569c1459adf8a575c6fb4.
  • Released: core-api-1.9.0.jar (pom: jackson-databind 2.13.4.2, runtime). Tag v1.9.0.
  • Pushed head ffad16e. Delta: git log ffad16e..HEAD gives 2 commits. git diff ffad16e HEAD --stat: 5 files, +53/-2.

Step 2: compat.

  • v1.9.0 source read: ExprEvaluator.compare (class check), DefaultAudienceDeserializer (readerForMapOf(Object.class)), InOperator, EqualsOperator, Context.setAttribute (stored as-is).
  • Head JsonValues.snapshotValue produces unmodifiable LinkedHashMap/ArrayList copies.
  • Probe com.absmartly.sdk.Probe: new AudienceMatcher(new DefaultAudienceDeserializer()).evaluate(...) with eq and in.
    • 1.9.0 run: compiled against the 1.9.0 jar + jackson 2.13.5 + slf4j-api 2.0.16 (an slf4j 1.7.36 copy from the Gradle jars-9 cache was instrumented and failed to load, so it was replaced).
    • Head run: against core-api/build/libs/core-api.jar (shaded) + slf4j 2.0.16.
    • Results: the table above.
  • Public API: no src/main change in 46a13fc.

Step 3: parity. No new parity surface. JS isEqualsDeep analysis carried from the cb0676d gate (source-derived). Cross-sdk not re-run: no main-code change since cb0676d, whose log is orch-cb0676d.log (java 304/305 eligible, 0 FAIL).

Step 4: tests and mutants.

  • JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew build -x spotlessCheck -PskipR8Check --offline: BUILD SUCCESSFUL in 38s, exit 0. :core-api:test 769 tests, 0 failures, 0 errors, 0 skipped (summed from the JUnit XML). jacocoTestCoverageVerification, animalsnifferMain, verifyShadedJar, :example:build and :r8-check:build passed.
  • ./gradlew :core-api:testJdk25 --offline: exit 0 (up to date; it already ran inside build). 769 tests, 0 failures, 0 errors.
  • Both new tests appear in both result sets (anAudienceMatchesListAndMapAttributesByContent(), testCompareObjects()).
  • Mutants MA, MB and MC were applied in the mut worktree with a Python/sed edit to ExprEvaluator.java, then ./gradlew :core-api:test --offline -q, then the file was restored. Results are in the table: all killed (1, 1 and 2 failures of 769).

Step 5: perf. NOT RUN: no main-code change in this delta.

Step 6: forward-compat. NOT RUN: no decoder change in this delta.

Step 7: build/CI.

  • Build as in step 4.
  • Spotless: NOT RUN (offline). Manual check: git diff ffad16e HEAD -U0 -- '*.java' | grep '^+' | expand -t4 | awk 'length>120' gives no output; grep -P '^\+.*[ \t]+$' gives no output; grep -P '^\+ +' gives no output.
  • gh run list --branch next/major: latest run 44632929436, success, on ffad16e. There is no CI run yet on 46a13fc.

Step 8: docs. The anchor and claim checks are above. CHANGELOG line references come from grep -n (:44 "This can change…", :49 "1L"). The MIGRATING intro is at :3-7 and the heading at :165 (grep -n '^#' MIGRATING.md). The added CHANGELOG/MIGRATING lines are all 120 columns or less (the awk length check flags only pre-existing lines 14 and 68+).

Reviewer report and evidence log (6d52f41)

APPROVE at 6d52f41: both wording P3s from the 46a13fc gate are closed, the change since that gate touches only docs, and both test lanes pass with 769/769 tests.

Re-reviewed 6d52f41 (4 commits since the pushed head ffad16e). cb0676d and 46a13fc were each gated APPROVE (.git/sdk-review/cb0676d….md, .git/sdk-review/46a13fc….md). This pass audits the two commits after them, 06b43e7 and 6d52f41. Baselines are unchanged from the 46a13fc gate: published core-api-1.9.0, tag v1.9.0, merge base 07807b5. Only this delta counts as a finding.

Must fix

None.

Verified fixed (P3s from the 46a13fc gate)

  1. P3-a, CHANGELOG wording: closed. CHANGELOG.md:46-47 now reads "In 1.x a list attribute matched only if the value itself was exactly an ArrayList, and a map only if it was exactly a LinkedHashMap (lists and maps nested inside it already compared by content)."
    • This matches the 1.9.0 probe table in the 46a13fc gate: an ArrayList subclass failed, and an ArrayList holding List.of/Map.of already matched.
    • The rest of the bullet is unchanged in content. The word diff shows only "attribute", "the value itself", "exactly" ×2 and the parenthetical added; the rest is rewrapped.
  2. P3-b, MIGRATING intro: closed. MIGRATING.md:3 now opens "2.0 reshapes the API; apart from two exceptions, it does not change what the SDK decides or sends." MIGRATING.md:4-7 then names both exceptions: custom objects, and list/map attributes in audience conditions. The meaning is unchanged; the sentence is only reordered.

Docs accuracy and links

  • The claims are unchanged from the 46a13fc gate, where they were measured. The only new claim is the nested-content parenthetical, which is true per the gate's probe row ArrayList[List.of(1), Map.of(a,List.of(2))] (1.9.0 true/true).
  • MIGRATING.md:4-5 [Custom objects](#units-attributes-overrides-custom-assignments): the link text now spans a soft line break, which is valid CommonMark. The anchor resolves to the heading ### Units, attributes, overrides, custom assignments at MIGRATING.md:165, and the target paragraph is at :184.
  • [CHANGELOG](CHANGELOG.md), [MIGRATING.md](MIGRATING.md), [SUPPORT.md](SUPPORT.md) and [SWITCHBACK.md](SWITCHBACK.md) all exist at the repo root.
  • No added line is over 120 columns, and none has trailing whitespace.

Tests needed (current implementation correct)

0 mutations run in this pass: there is no code change since 46a13fc. That gate recorded 4 run, 4 killed, 0 survived.

Fix-commit audit (06b43e7, 6d52f41): they add no new state, flags, caches or public names. git diff --quiet 46a13fc HEAD -- ':!*.md' exits 0, so the only changes are to CHANGELOG.md and MIGRATING.md.

Compatibility / parity / forward-compat evidence

  • Unchanged since 46a13fc (no source change). See that gate and the cb0676d gate (cross-sdk: java 304 eligible / 1 skip of 305, 0 FAIL).

Performance

No code change since 46a13fc.

P3 / notes

None new. Track the numeric types inside lists and maps (1L vs 1, a JS-parity gap) separately. It was already in 1.9.0 and is documented.

Version and release notes

The 2.0.0 section is still "(unreleased)". The hunks touch only CHANGELOG.md:44-50 inside 2.0.0, and no released section changed. The version source is unchanged.

Pre-existing on main (not this PR)

  • The numeric-type-in-container JS-parity gap, as above.

Verification limits / provenance:

  • Spotless: NOT RUN (formatter offline). The delta has no Java change, so the formatting risk is nil.
  • CI has not run on 6d52f41. The latest run is 44632929436 (success) on ffad16e. Confirm CI on the pushed head before calling every gate green.

Evidence log: head 6d52f41d4337244712392d6e83ad7d0875fa716f

Scratch: mktemp -d → /tmp/tmp.TlHPy6J46i, with a detached worktree head at 6d52f41. It was removed afterwards (git worktree remove --force, rm -rf). Before and after: git status --short is empty and git rev-parse HEAD = 6d52f41d….

Step 1: trees.

  • git rev-parse HEAD = 6d52f41d4337244712392d6e83ad7d0875fa716f.
  • git log ffad16e..HEAD: 4 commits (cb0676d, 46a13fc, 06b43e7, 6d52f41).
  • git diff --stat ffad16e HEAD: 5 files, +55/-4.
  • git diff --stat 46a13fc HEAD: CHANGELOG.md and MIGRATING.md only, +13/-13.
  • Release baselines: carried from the 46a13fc gate.

Step 2: compat. NOT RUN afresh: there is no source change since 46a13fc (git diff --quiet 46a13fc HEAD -- ':!*.md' exit 0). The 46a13fc gate's probe (1.9.0 jar vs head jar) still applies.

Step 3: parity. NOT RUN afresh, for the same reason. Cross-sdk evidence is the cb0676d gate's (orch-cb0676d.log: java 304/305 eligible, 0 FAIL).

Step 4: tests.

  • JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew build -x spotlessCheck -PskipR8Check --offline -q (in the worktree): exit 0.
  • ./gradlew :core-api:testJdk25 --offline: exit 0, BUILD SUCCESSFUL (up to date; it ran inside build).
  • JUnit XML sums: test 769 tests / 0 failures / 0 errors / 0 skipped; testJdk25 769 / 0 / 0 / 0.
  • Mutants: 0 run (docs-only delta). The 46a13fc gate recorded 4/4 killed.

Step 5: perf. NOT RUN: no code change.

Step 6: forward-compat. NOT RUN: no decoder change.

Step 7: build/CI.

  • Build as in step 4.
  • Spotless NOT RUN (offline).
  • gh run list --branch next/major -L 3: latest run 44632929436, success, on ffad16e. There is no run on 6d52f41 yet.

Step 8: docs.

  • git diff 46a13fc HEAD and --word-diff=porcelain were reviewed. The word diff shows only the intended wording additions plus rewrapping.
  • Long lines: git diff 46a13fc HEAD -U0 | grep '^+[^+]' | expand -t4 | awk 'length>121' gives no output. Trailing whitespace: grep -P '^\+.*[ \t]+$' gives no output.
  • Links: ls CHANGELOG.md SUPPORT.md SWITCHBACK.md MIGRATING.md shows all present. grep -n '^#' MIGRATING.md shows :165 ### Units, attributes, overrides, custom assignments, whose slug equals the anchor. grep -n 'Custom objects as attribute' gives :184.

@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Jervasion's approval of ffad16e (review 5991802787: no findings, no suggestions, no simplifications) was dismissed by the push of 6d52f41, which overlapped it.

The head moved for a behaviour fix that the local cross-sdk run caught:

  • At ffad16e, scenarios 101-104 and 111 failed on the 2.x java lane and passed on java-v1. A list or map attribute never matched an equal audience value.
  • cb0676d makes them compare by content.
  • 46a13fc, 06b43e7 and 6d52f41 document the change and add edge-case tests.

The independent gate on 6d52f41 is posted above. CI is green, there are no unresolved threads, and Jervasion is re-requested on 6d52f41.

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with suggestions

List and map attributes now match equal targeting literals even after the SDK takes an immutable snapshot. The migration notes call out the resulting assignment change for running experiments. No merge blockers found.

Next step: None — ready to merge.

Suggestions (optional)

  • Qualify the changelog’s in example: an earlier non-comparable candidate can still stop the search before an equal item.
  • One redundant test comment is noted below.

What I checked

  • ✅ Exact-head CI: build and test-jdk21 passed, covering Java 11/21/25, formatting, packaging, and the installed example smoke test.
  • ✅ Java 11: 181 focused tests and four loopback HTTP integration cases passed. The two changed equality tests both failed when I reverted only the production comparison change.
  • ✅ Reviewed the author’s companion-suite results: 304 eligible Java 2.x scenarios passed and 1,311 comparisons agreed. That run used cb0676d; production source is unchanged from that commit to this head. I did not rerun that suite.
Review details

Head: 6d52f41d4337244712392d6e83ad7d0875fa716f. Base and merge-base: 07807b516df5ad0d7d92e5b682041982802cd871. Post-approval responsibility baseline: ffad16ef87b4ed7d1d6aaf83b352f70d0bd0a528.

Convergence summary — review round 8

  • Unresolved original blockers: 0
  • Remediation regressions: 0
  • Independent PR-change findings: 0 blocking
  • Acceptance criteria still open: none
  • Human adjudication requested: no

The same evaluator handles audiences and assignment rules. The new branch uses Java collection equality only for same-kind operands; list order, nested numeric Java types, and scalar comparisons retain their existing semantics. Structural comparison is proportional to the compared contents, with no extra copy or allocation introduced by the comparator. The specialist checked strict/non-strict audience fallback, assignment-rule skips, and warnings.

Local commands used the Gradle wrapper under verified Java/Javac 11.0.33. :core-api:test --tests '*ExprEvaluatorTest' --tests '*ABsmartlyClientTest' --tests '*ContextAssignmentRulesTest' --tests '*AudienceMatcherTest' --tests '*EqualsOperatorTest' --tests '*InOperatorTest' and :core-api:test --tests '*LocalHttpServerIntegrationTest' passed. In the detached revert tree, :core-api:test --tests '*ExprEvaluatorTest.testCompareObjects' --tests '*ABsmartlyClientTest.anAudienceMatchesListAndMapAttributesByContent' failed both assertions as expected. git diff --check ffad16e..HEAD passed. Local :core-api:spotlessCheck could not resolve download.eclipse.org; the exact-head build job passed the gate.

Passes (non-blocking): run: core runtime/API/data (comparison and treatment selection), dedicated error handling/messages (completed; matcher fallback and rule skip), tests/CI/packaging (changed Java tests and unchanged build gates), cross-cutting simplicity, comment hygiene, diff composition | not run: deployment/operations/observability (no deployment, release workflow, or logging call changes), shared frontend (no frontend source), behaviour-bearing data/policy (no independently loaded config, policy, or fixture files; in-code test vectors covered by the test pass).

Comment hygiene (non-blocking): 3 comment / 34 code lines, ratio ~1:11.3, 1 block flagged.

threshold T=5; restatements counted: no (10 × C < E).

  • ExprEvaluatorTest.java:286 — restates the comparisons asserted directly below it.

Diff composition (non-blocking): every file is required for the change; none flagged. The pinned helper enumerated 10 content writes across the four commits since approval, including intermediate versions; no scratch artifacts or credential-bearing content found.

Simplifications (non-blocking): none.

Comment thread CHANGELOG.md Resolved
lux worker and others added 3 commits November 20, 2026 12:53
… a test; drop a restating test comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt rule is skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st: more headroom for the download-cancel check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Final independent sdk-review on bb86022: APPROVE, 0 P1/P2/P3.

Delta since 6d52f41, which Jervasion approved in review 5992932170:

  • c748329: Jervasion's in wording suggestion (thread 4642622057), plus a test that pins the in behaviour and removal of the redundant test comment.
  • ae14e89 and bb86022: they close the gates' wording P3s on the CHANGELOG in paragraph: boolean candidates, assignment rules, and true matching any list. bb86022 also widens timedOutDownloadIsCancelled, which failed once on JDK 25, to a 10 s body with an 8 s stop check.

Results on bb86022:

  • The CHANGELOG paragraph is verified claim by claim against the code and the 1.9.0 jar.
  • The widened test still kills the no-cancel mutant on JDK 21 and JDK 25. Under load, the server stopped 99–194 ms after the timeout, against the 8 s limit.
  • 770 tests pass on JDK 11 and on JDK 25.
Reviewer report and evidence log (c748329)

APPROVE at c748329: the one-commit delta since the approved 6d52f41 is docs plus one test. The NPE mechanism the CHANGELOG describes is real for list and map attributes on head and in 1.9.0. The new test is the only one of 770 that kills the "keep searching past a null compare" mutant, and both test lanes pass 770/770. Two wording P3s remain: a boolean-candidate exception, and assignment rules being silent in the CHANGELOG. Neither blocks.

Re-reviewed c748329 (1 commit since the pushed head 6d52f41, which Jervasion approved in review 5992932170 and the gate .git/sdk-review/6d52f41….md approved). Baselines are unchanged from that gate: published core-api-1.9.0 (~/.m2/.../core-api-1.9.0.jar), tag v1.9.0, merge base 07807b5. Only this delta counts as a finding.

Must fix

None.

Tests needed (current implementation correct)

2 full-suite mutations: 2 killed, 0 survived.

  • M1 InOperator.java:13: a null compare is treated as "not equal, continue" (c != null && c == 0). 770 run, 1 failed: only ABsmartlyClientTest.anInSearchForAListAttributeStopsAtTheFirstDifferentCandidate. The new test is therefore the sole guard of the documented 1.x stop-at-first behaviour, so it is meaningful.
  • M2 ExprEvaluator.java:152: the by-content List/Map branch is disabled (back to the 1.x class check). 3 failed: the new test (exp_first no longer matches), anAudienceMatchesListAndMapAttributesByContent and ExprEvaluatorTest.testCompareObjects.

Verification of the CHANGELOG claim (CHANGELOG.md:48-51)

  • Mechanism is the NPE: confirmed. InOperator.java:13 does evaluator.compare(item, needle) == 0 on an Integer. ExprEvaluator.compare (:130-161) returns null for a List/Map lhs vs a differing List/Map rhs, and also for a Number or String candidate vs a list attribute (numberConvert/stringConvert of a List is null). The unboxing NPE escapes JsonExpr.evaluateBooleanExpr, because no operator or combinator catches it. AudienceMatcher.evaluate (AudienceMatcher.java:119-121) catches RuntimeException, logs "Failed to evaluate audience filter; treating it as a mismatch" and returns Result(false).
  • Map attribute: same. Probe on head with Map.of("x",1): [{x:1},{x:2}] gives true, and [{x:2},{x:1}] gives NPE.
  • "The whole audience filter then fails": precise. The NPE escapes enclosing combinators. On head, or(in-NPE, {value:true}) gives false and not(in-NPE) gives false.
  • 1.9.0: same mechanism. InOperator body is byte-identical apart from the package import (git diff --no-index). AndCombinator, OrCombinator, NotOperator and BinaryOperator are identical. The 1.9.0 AudienceMatcher.evaluate has the same catch. The same probe against the published 1.9.0 jar gives NPE for every list/map row, including the first-candidate-equal row, because there List.of(1) and ArrayList differ by class. So "as in 1.x" is correct for the stop behaviour, and only the first-candidate match is new.

P3 / notes

  1. P3: "stops at the first candidate that differs" has a boolean exception (CHANGELOG.md:49-51). compare(Boolean, List) is non-null (booleanConvert(list) = true), so a boolean candidate does not end the search. On head, in [false,[1]] with attribute List.of(1) gives true (it matches on the second candidate, which contradicts "only when the first candidate equals it"), and in [true,[9]] gives true for any list or map attribute (the same in 1.9.0). The backend is unlikely to send mixed boolean/list candidates, so this is wording only. Please, optionally, add "(a non-boolean candidate)" or leave it as is.
  2. P3: assignment rules take the same NPE path but are handled per rule; the CHANGELOG is silent on them (CHANGELOG.md:50). The paragraph opens with "An audience or assignment-rule condition", but the in caveat names only the audience filter. In AudienceMatcher.evaluateRules (AudienceMatcher.java:220-226) the NPE is caught per rule, logged as "Failed to evaluate assignment rule conditions for experiment {}, rule {}", and only that rule is skipped. Traversal continues: rules [r1: in [[2],[1]] → 1, r2: in [[1],[2]] → 2] with arr=[1] give RuleAction{variant=2}. Within one rule's conditions the failure is still whole: or(in-NPE, true) → rule skipped. 1.9.0's evaluateRules is identical. The statement as written is accurate for audiences and does not misstate rules. Optionally add: "(for an assignment rule, that rule is skipped and the next one is tried)".

Pre-existing (not this delta)

  • javascript-sdk's in keeps searching after a non-equal list/object candidate (compare null, === 0 false). The Java stop-at-first NPE therefore diverges from JS in both 1.9.0 and 2.0.0. This commit documents it honestly rather than introducing it. Track it separately if parity is wanted.

Version and release notes

The edit is inside the unreleased 2.0.0 section, and released sections are untouched. The added lines are at most 121 columns with no trailing whitespace.

Verification limits / provenance: Spotless NOT RUN (the formatter download is offline), so it needs CI on c748329. No JS run in this pass: the JS in behaviour comes from prior gates and source reading. Steps 1-3 and 5-7 (except the build) were not rerun because the delta is docs plus a test, with no production change.


Evidence log (head c748329)

  • Head: git rev-parse HEAD = c748329; git status --short clean before and after. Delta: git log --oneline 6d52f41..HEAD = 1 commit; git show c748329 --stat = CHANGELOG.md (+6/-3), ABsmartlyClientTest.java (+13), ExprEvaluatorTest.java (-1, the comment only).
  • Step 1 (trees): NOT RUN anew. The baselines are unchanged from the 6d52f41 gate (1.9.0 jar, v1.9.0, 07807b5).
  • Step 2 (compat): NOT RUN: no main-source change in the delta (git show c748329 --stat). Behaviour probe for the claim: Probe.java compiled against core-api/build/classes/java/main (head) and against core-api-1.9.0.jar plus slf4j-api-1.7.36 (results above). git diff v1.9.0 HEAD -- AudienceMatcher.java: only the import, package and visibility changed.
  • Step 3 (parity): the rule path was probed with RuleProbe.java (package com.absmartly.sdk, head core-api.jar): evaluateRules gives variant 2, the rule with or(NPE,true) gives null, the audience with or(NPE,true) gives false, and not(NPE) gives false. JS not run (see limits).
  • Step 4 (tests/mutants): worktree /tmp/tmp.rmsncoBfZz/wt at HEAD; ./gradlew :core-api:test --offline -PskipR8Check per mutant; failing tests read from build/test-results/test/*.xml. M1 gave 770 run / 1 failed (the new test only). M2 gave 3 failed. Reverted with git checkout -- . and the worktree's status is clean.
  • Step 5 (perf): NOT RUN: no production code changed.
  • Step 6 (forward-compat): NOT RUN: no decoder change.
  • Step 7 (build): JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew cleanTest build -x spotlessCheck -PskipR8Check --offline gives BUILD SUCCESSFUL; the test lane has 770 tests, 0 failures, 0 errors, 0 skipped, and the new test is present in the XML. ./gradlew :core-api:testJdk25 --rerun -PskipR8Check --offline gives BUILD SUCCESSFUL with 770 tests and 0 failures/errors, the new test included. Spotless NOT RUN (offline).
  • Step 8 (docs): the CHANGELOG lines 48-51 diff was read. Long lines: git diff 6d52f41 HEAD -U0 | grep '^+[^+]' | expand -t4 | awk 'length>121' gives no output. Trailing whitespace: grep -P '^\+.*[ \t]+$' gives no output. MIGRATING/README have no in caveat (grep gives no hits), which is consistent with the delta.
Reviewer report and evidence log (ae14e89)

APPROVE at ae14e89: the one-commit delta since c748329 changes only CHANGELOG.md, and it closes both wording P3s from the c748329 gate. The final paragraph (CHANGELOG.md:44-55) matches InOperator, ExprEvaluator.compare and AudienceMatcher.evaluate/evaluateRules on head and in 1.9.0. One residual P3 remains: the closing "only when" sentence still has an edge with a true candidate. Both test lanes pass 770/770. A JDK 25 transport-timing test flaked once and then passed 9 times in a row; it is unrelated to this delta.

Re-reviewed ae14e89 (1 commit since c748329; 2 commits since the pushed head 6d52f41, which Jervasion approved in review 5992932170). Baselines are unchanged from the earlier gates: published core-api-1.9.0 (~/.m2/repository/com/absmartly/sdk/core-api/1.9.0/core-api-1.9.0.jar), tag v1.9.0, merge base 07807b5. Only this delta counts as a finding.

Verified fixed

  • P3 Expose HttpVersionPolicy in DefaultHTTPClientConfig #1 (boolean candidates): closed. CHANGELOG.md:50 now says "stops at the first non-boolean candidate that differs from it". Probe on head: in [false,[1]] with arr=List.of(1) gives true, so the search passes the boolean candidate. in [[2],[1]] gives an NPE (the stop). in [[1],[2]] gives true.
  • P3 Minor amendment to ExprEvaluatorTest.compareNulls to compare right-hand side nulls as well #2 (assignment rules): closed. CHANGELOG.md:51 now says "in an assignment rule, that rule is skipped and the next one is tried". This matches AudienceMatcher.evaluateRules (AudienceMatcher.java:220-230): it catches RuntimeException and StackOverflowError per rule, logs, and lets the for loop continue. The rule-traversal probe in the c748329 gate (r1 NPE then r2 match gives variant 2) is unchanged, because no code changed.

Accuracy of CHANGELOG.md:44-55 against the code

  • "compares a list or map attribute with a list or object value by content, whatever the class": ExprEvaluator.java:152-156 (List/List or Map/Map uses equals). 1.9.0 needed exact ArrayList/LinkedHashMap, so the 1.9.0 probe gives an NPE for [[1],[2]] and [false,[1]], while head gives true. Accurate.
  • "in compares it with each candidate the same way": InOperator.java:12-16 calls compare(item, needle). Accurate.
  • "stops at the first non-boolean candidate that differs": compare returns null for a List/Map, Number, String or null candidate against a differing list attribute. InOperator.java:13 then unboxes == 0 and throws an NPE. A Boolean candidate returns non-null (booleanConvert(list) is true). Accurate.
  • "The whole audience filter then fails and is logged and treated as a mismatch": AudienceMatcher.java:119-121. The NPE escapes the combinators (gate c748329: or(NPE,true) gives false). Accurate.
  • "As in 1.x": the 1.9.0 jar shows the same NPE stop behaviour; InOperator, combinators and BinaryOperator are identical (gate c748329). Accurate.
  • "Numbers inside lists and maps still compare by Java type": List.equals uses element equals, so 1L does not equal 1. Accurate (unchanged claim).

P3 / notes

  1. P3: a true candidate still breaks "only when the first non-boolean candidate equals it" (CHANGELOG.md:51-52). compare(Boolean.TRUE, list) is TRUE.compareTo(booleanConvert(list)=true), which is 0. So a true candidate matches any non-null list or map attribute: on head, in [true,[9]] with arr=List.of(1) gives true, though the first non-boolean candidate [9] differs. 1.9.0 gives the same, so this is not a behaviour change. The backend is unlikely to send a true literal among list candidates, so this is wording only and does not block. If you want it exact: "...stops at the first non-boolean candidate that differs from it (a true candidate matches any list or map attribute)". Otherwise leave it.
  2. Note (pre-existing, not this delta): JdkHttpTransportTest.timedOutDownloadIsCancelled (JdkHttpTransportTest.java:796) flaked once on the JDK 25 lane ("the server stops writing": finished.await(3s) was false). The test comes from d8d3efc. It then passed on a full JDK 25 rerun, 8 class-only reruns and another full rerun (0 failures in 9 runs, load average about 0.6-1.1). It is likely timing-sensitive under a concurrent Gradle run, since the first failure ran right after the JDK 11 cleanTest build in the same shell. Watch it on CI. Not a finding of this delta.

Pre-existing (not this delta)

  • javascript-sdk's in keeps searching past a non-equal list/object candidate. The Java stop-at-first NPE diverges from JS in both 1.9.0 and 2.0.0. The CHANGELOG now documents this precisely. Track it separately if parity is wanted.

Version and release notes

The edit is inside the unreleased 2.0.0 "Changed" section. Released sections are untouched. The longest line in 44-55 is 119 columns, with no trailing whitespace.

Verification limits / provenance: Spotless NOT RUN (the formatter download is offline), so it needs CI on ae14e89. JS was not run (JS in behaviour comes from earlier gates). Mutants were not rerun: there is no code or test change since c748329, whose gate measured M1/M2 as killed. Steps 1-3, 5 and 6 were not rerun because the delta is CHANGELOG-only.


Evidence log (head ae14e89)

  • Head: git rev-parse HEAD = ae14e89. git status --short was clean at the start and the end.
  • Delta: git diff --stat c748329 HEAD gives CHANGELOG.md only (+5/-4). git diff --stat 6d52f41 HEAD gives CHANGELOG.md (+7/-3), ABsmartlyClientTest.java (+13) and ExprEvaluatorTest.java (-1).
  • Step 1 (trees): NOT RUN anew; baselines as in the earlier gates (1.9.0 jar, v1.9.0, merge base 07807b5 = git merge-base origin/main HEAD).
  • Step 2 (compat): NOT RUN: no source change. Claim probe: P.java (reflection over JsonExpr.evaluateBooleanExpr, the in operator with var arr = List.of(1)), compiled in a mktemp dir and run against core-api/build/classes/java/main (head) and the 1.9.0 jar, with plain slf4j-api-1.7.36 from modules-2:
    • head: [true,[9]] gives true, [true] true, [false,[1]] true, [[2],[1]] NPE, [[1],[2]] true.
    • 1.9.0: [true,[9]] gives true, [true] true, [false,[1]] NPE, [[2],[1]] NPE, [[1],[2]] NPE.
    • The probe dir was removed afterwards.
  • Step 3 (parity): NOT RUN (no code change); code read for InOperator, ExprEvaluator.compare, BinaryOperator, JsonExpr and AudienceMatcher.evaluate/evaluateRules at head.
  • Step 4 (tests/mutants): No new state in the fix-commit audit: ae14e89 is docs only. Mutants were not rerun (gate c748329: M1 InOperator null-continue killed only by anInSearchForAListAttributeStopsAtTheFirstDifferentCandidate; M2 by-content branch disabled, 3 killed).
  • Step 5 (perf): NOT RUN: no production change.
  • Step 6 (forward-compat): NOT RUN: no decoder change.
  • Step 7 (build):
    • JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew cleanTest build -x spotlessCheck -PskipR8Check --offline gave BUILD SUCCESSFUL. The test XML shows 770 tests, 0 failures, 0 errors, 0 skipped, and the new test is present. (An initial build without cleanTest was up to date.)
    • ./gradlew :core-api:testJdk25 --rerun -PskipR8Check --offline run 1 gave BUILD FAILED: 770 tests, 1 failure (JdkHttpTransportTest.timedOutDownloadIsCancelled, JdkHttpTransportTest.java:796).
    • Rerun 2 gave BUILD SUCCESSFUL. Then 8 loops of --tests com.absmartly.sdk.JdkHttpTransportTest all exited 0 (45 tests, 0 failures). A final full rerun gave BUILD SUCCESSFUL with 770 tests and 0 failures/errors. JDK 25.0.4.1.
    • Spotless NOT RUN (offline).
  • Step 8 (docs): The CHANGELOG.md:44-55 diff was read and checked line by line (above). sed -n 44,55p | awk length gives max 119. Trailing-whitespace grep gives no output. The change is in the unreleased 2.0.0 section.
Reviewer report and evidence log (bb86022)

APPROVE at bb86022: the 3-commit delta since the pushed head 6d52f41 (Jervasion-approved, review 5992932170) changes only CHANGELOG.md and tests. The final in paragraph (CHANGELOG.md:44-56) is exactly accurate against head and against 1.9.0, including the true-candidate edge left open by the ae14e89 gate. The widened timedOutDownloadIsCancelled still kills the "no sent.cancel(true)" mutant (JdkHttpTransport.java:313) on JDK 25 and JDK 21. Under CPU load its stop-after-timeout margin is about 40x (worst 194 ms against an 8 s budget). Both lanes pass 770/770. No P1, P2 or P3 findings.

Re-reviewed bb86022 (1 commit since gate ae14e89, 3 since pushed head 6d52f41). Baselines are unchanged from earlier gates: published core-api-1.9.0 (~/.m2/repository/com/absmartly/sdk/core-api/1.9.0/core-api-1.9.0.jar), tag v1.9.0, merge base 07807b5. Only this delta counts as a finding. There are no production source changes (git diff --stat 6d52f41 HEAD -- '*/src/main/*' is empty).

Verified fixed

  • ae14e89 gate P3 (true candidate): closed. CHANGELOG.md:52-53 now reads "...only when the first non-boolean candidate equals it, or when a true candidate comes before that one (true matches any list or map attribute)." Probe on head and 1.9.0: in [true,[9]] with arr=List.of(1) is true; in [true] with arr=Map.of("a",1) is true; in [true] with arr=List.of() is true; in [[9],true] is NPE, so a true after the first differing candidate is never reached. That matches "comes before that one".
  • ae14e89 gate note (JDK 25 flake): addressed by bb86022. Measurements are below.

Accuracy of CHANGELOG.md:44-56 (line by line, at bb86022)

  • "compares a list or map attribute with a list or object value by content, whatever the class": ExprEvaluator.java:152-156 (List/List or Map/Map, then lhs.equals(rhs)). Accurate.
  • "In 1.x a list attribute matched only if exactly ArrayList / map only if exactly LinkedHashMap": the v1.9.0 compare has only the lhs.getClass()==rhs.getClass() branch, and JSON literals deserialize to ArrayList/LinkedHashMap. Probe on 1.9.0 with JSON-shaped literals: in [[1]] gives true for an ArrayList attribute and NPE for List.of / Arrays.asList; in [{a:1},{b:2}] gives NPE for a HashMap attribute. Accurate.
  • "List.of, Arrays.asList or HashMap now matches an equal ... in eq": EqualsOperator returns compare(...)==0, and the by-content branch covers it. Accurate.
  • "in compares it with each candidate the same way": InOperator.java:12-13 compare(item, needle). Accurate.
  • "As in 1.x, an in search ... stops at the first non-boolean candidate that differs": InOperator.java:13 unboxes a null Integer, which throws an NPE. compare returns null for Number, String, null, List and Map candidates against a differing list or map. Boolean candidates return non-null via booleanConvert(list)=true. v1.9.0 InOperator is identical. Probe on head and 1.9.0: [false,[9],[1]] NPE, ["x",[1]] NPE, [1,[1]] NPE, [false,[1]] true on head. Accurate.
  • "The whole audience filter then fails and is logged and treated as a mismatch": AudienceMatcher.java:117-121, catching RuntimeException, log.warn and Result(false). The jsonexpr package has no catch that would absorb the NPE in a combinator (grep: only MatchOperator and number/index parsing). Accurate.
  • "in an assignment rule, that rule is skipped and the next one is tried": AudienceMatcher.java:220-230, a per-rule try/catch inside the for loop. Accurate.
  • "true matches any list or map attribute": compare(TRUE, x) is TRUE.compareTo(booleanConvert(x)), and booleanConvert of any non-null List or Map is true. That holds even for an empty list (probe). Accurate. false gives -1, non-null, so the search continues, which matches "non-boolean".
  • "Numbers inside lists and maps still compare by Java type: 1L does not equal 1": List.equals compares elements with equals, and JsonValues.snapshotValue copies containers without converting the numbers. Probe: in [[1]] with arr=List.of(1L) gives NPE (no match). Accurate.
  • Format: the longest line in 44-56 is 119 columns, with no trailing whitespace. The text is in the unreleased 2.0.0 "Changed" section, and released sections are untouched.

Tests (fix-commit audit)

  • c748329 adds ABsmartlyClientTest.anInSearchForAListAttributeStopsAtTheFirstDifferentCandidate through the real client factory and the strict audience. The c748329 gate showed M1 (InOperator: treat a null compare as "continue") killed only by this test. The test passes on both lanes.
  • c748329 drops one restating comment in ExprEvaluatorTest. The assertions are unchanged.
  • bb86022 JdkHttpTransportTest.timedOutDownloadIsCancelled (JdkHttpTransportTest.java:778, 796-798): 100 chunks x 100 ms (about 10 s in full), await 8 s, written < 100. The test adds no new production state, so nothing else needs setting or clearing.
    • Mutant "no sent.cancel(true)" (JdkHttpTransport.java:313 commented out): JDK 25 FAILS ("the server stops writing", 8.68 s). JDK 21 FAILS (same assertion). JDK 11 passes, which is expected because the assertion is gated to feature() >= 16, as the test comment documents. 1 mutant, 2/2 JDK 16+ lanes killed. When instrumented without the 8 s cap, the mutant runs all 100 chunks and the server stops 9.6 s after the timeout, so 8 s is well below the uncancelled duration.
    • Flake margin, measured on unmutated head with the test instrumented in a scratch worktree (JDK 25): idle, 3/3 runs: timeout at 510 ms, server stops 155-157 ms after the timeout, 6 chunks. Under load (8 busy-loop processes on 4 cores, load average up to 13.3), 10/10 runs: timeout 515-596 ms, server stops 99-194 ms after the timeout, 1-4 chunks. Worst observed is 194 ms against an 8000 ms budget. Mutant and real behaviour are separated by about 9.4 s.
    • Leftover risk: the test is still wall-clock based (about 1.8 s of headroom between the 8 s budget and the about 9.6 s mutant runtime, and about 7.8 s of headroom on the pass side). That is acceptable and not a finding.

P3 / notes

  • None for this delta.

Pre-existing (not this delta)

  • javascript-sdk's in keeps searching past a non-equal list or object candidate. Java stops with an NPE in both 1.9.0 and 2.0.0. The divergence is now documented precisely. Track it separately if parity is wanted.

Version and release notes

The edit is inside the unreleased 2.0.0 "Changed" section. Version and X-Agent are unchanged by this delta.

Verification limits / provenance: Spotless NOT RUN (the formatter download is offline), so it needs CI on bb86022. JS was not run (JS in behaviour comes from earlier gates). Steps 1-3, 5 and 6 were not rerun because there is no production change. JDK 21 lane is local only, done by switching the toolchain of a scratch testJdk25 task. CI's matrix may differ.


Evidence log (head bb86022)

  • Head: git rev-parse HEAD = bb86022, both at the start and at the end. git status --short was clean at the start and the end.
  • Delta: git diff --stat 6d52f41 HEAD: CHANGELOG.md (+8/-3), ABsmartlyClientTest.java (+13), JdkHttpTransportTest.java (+4/-3), ExprEvaluatorTest.java (-1). There are no src/main changes.
  • Step 1 (trees): NOT RUN anew; baselines as in earlier gates (1.9.0 jar, v1.9.0, merge base 07807b5).
  • Step 2 (compat): NOT RUN for API (no source change). Claim probe P.java, in a mktemp scratch dir and removed afterwards: reflection on JsonExpr.evaluateBooleanExpr with {"in":[{"value":<JSON-shaped ArrayList/LinkedHashMap literal>},{"var":"arr"}]}. Run on JDK 11 against core-api/build/classes/java/main (head, slf4j 2.0.16) and the 1.9.0 jar (slf4j 1.7.36). Results, as head | 1.9.0:
    • [[1],[2]] with List.of(1): true | NPE
    • [[2],[1]] with List.of(1): NPE | NPE
    • [true,[9]] with List.of(1): true | true
    • [false,[1]] with List.of(1): true | NPE
    • [false,[9],[1]]: NPE | NPE
    • [[9],true]: NPE | NPE
    • ["x",[1]]: NPE | NPE
    • [1,[1]]: NPE | NPE
    • [true] with Map.of(a,1): true | true
    • [{a:1},{b:2}] with HashMap: true | NPE
    • [{b:2},{a:1}] with HashMap: NPE | NPE
    • [[1]] with List.of(1L): NPE | NPE
    • [[1]] with Arrays.asList(1): true | NPE
    • [[1]] with ArrayList(1): true | true
    • [true,[9]] with ArrayList: true | true
    • [true] with List.of(): true | true
    • [false] with List.of(): false | false
  • Step 3 (parity): NOT RUN (no code change). Code read at head: InOperator.java:8-27, ExprEvaluator.compare:131-163, booleanConvert, EqualsOperator, AudienceMatcher.java:112-131 and 182-234, JsonValues.snapshotValue. v1.9.0 compare, InOperator and AudienceMatcher catch blocks were read via git show v1.9.0:....
  • Step 4 (tests/mutants): Scratch worktree git worktree add --detach $S/wt HEAD (bb86022), removed with git worktree remove --force and pruned afterwards.
    • M-cancel (JdkHttpTransport.java:313 sent.cancel(true) commented out), --tests ...timedOutDownloadIsCancelled:
      • JDK 25 testJdk25: exit 1, "the server stops writing", time 8.681 s.
      • JDK 21 (scratch build.gradle JavaLanguageVersion.of(21); toolchain at /usr/lib/jvm/java-21-openjdk-arm64): exit 1, same assertion.
      • JDK 11 test: exit 0 (gated, expected).
      • Result: KILLED on both JDK 16+ lanes.
    • Unmutated JDK 21 run of JdkHttpTransportTest: 45 tests, 0 failures.
    • Timing instrumentation (scratch test only, printing timeout ms, stop-after-timeout ms and chunks):
      • idle JDK 25, 3 runs: 510/157/6, 510/155/6, 510/157/6.
      • loaded (8 while : busy loops, 4 cores, load average 4.5 to 13.3), 10 runs: stop-after-timeout 114, 194, 139, 136, 170, 103, 191, 99, 138, 163 ms; chunks 1-4; all exit 0.
      • mutant with uncapped wait: 100 chunks, stopped 9601 ms after the timeout.
    • Fix-commit audit: c748329, ae14e89 and bb86022 add no production state, caches or public names. The tests only.
  • Step 5 (perf): NOT RUN: no production change.
  • Step 6 (forward-compat): NOT RUN: no decoder change.
  • Step 7 (build):
    • JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew cleanTest build -x spotlessCheck -PskipR8Check --offline gave BUILD SUCCESSFUL (exit 0). test XML: 770 tests, 0 failures, 0 errors, 0 skipped. Both the new in test and timedOutDownloadIsCancelled are present.
    • testJdk25 was UP-TO-DATE in that run, so it was forced: ./gradlew :core-api:testJdk25 --rerun -PskipR8Check --offline gave BUILD SUCCESSFUL. XML: 770 tests, 0 failures, 0 errors, 0 skipped (JDK 25 toolchain at /usr/lib/jvm/java-25-openjdk-arm64).
    • Spotless: NOT RUN (offline). It needs CI on bb86022.
  • Step 8 (docs): CHANGELOG.md:44-56 was checked clause by clause (above). Max line 119 columns, 0 trailing-whitespace lines, in the unreleased 2.0.0 Changed section.

@jervasion-absmartly
jervasion-absmartly dismissed their stale review November 20, 2026 13:40

New commits were added after this approval. Jervasion will reassess the updated head.

Takes main's #24 follow-ups (restating test comments removed). The 1.x Client agent Javadoc
change does not apply: 2.x removed getAgent/getAgentName/getAgentVersion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Final independent sdk-review on a92bfee: APPROVE, 0 P1/P2/P3.

This head merges main into next/major. After bb86022 was pushed, main gained #24 (1.x follow-ups), which made the PR CONFLICTING, so CI could not run on bb86022.

Resolution:

  • 2.x code is kept: getAgent* stays removed, and the 2.x test types stay.
  • Main's removals of 21 restating comments are taken.
  • No behaviour changed.

Results:

  • The merge base is now 9b2414b, which is origin/main.
  • 770 tests pass on JDK 11 and on JDK 25.

The gate on bb86022, the content just before the merge, is in the comment above.

Reviewer report and evidence log (a92bfee)

APPROVE at a92bfee: this is a merge of main 9b2414b (PR #24: f460899 and c066ba9) into bb86022. The resolution is correct and complete. Main's comment removals are all taken. The only main change dropped is the 1.x Client agent Javadoc example bump, which has nothing to apply to in 2.x because 2.x removed getAgent, getAgentName and getAgentVersion (MIGRATING.md:278). The merge changes no production behaviour. The build passes, with 770/770 on JDK 11 and 770/770 on JDK 25. No P1, P2 or P3 findings.

Re-reviewed a92bfee (1 merge commit since gate bb86022, which was APPROVE). Baselines are the published core-api-1.9.0 / tag v1.9.0 (unchanged from earlier gates). The merge base moved from 07807b5 to 9b2414b (= origin/main). Only this delta counts as a finding.

Merge resolution

  • What main brought in. git diff 07807b5 9b2414b touches 5 files, +2/-23:
    • Client.java changes only the Javadoc examples, "1.7.0" to "1.9.0", on getAgentVersion and getAgent.
    • Context.java removes one comment.
    • Three test files remove restating comments.
  • What landed on next/major. git diff bb86022 HEAD is 4 files, 0 additions and 21 deletions. Its removed lines are line-for-line identical to main's removals in Context.java and the three test files. The one difference is an expected rename: main removed "Configurable ContextData…" and 2.x removed its own renamed "Configurable ContextPayload…" (LocalHttpServerIntegrationTest.java:63).
  • Client.java. git show --remerge-diff HEAD shows the conflict was resolved to the 2.x side, with no agent getters. In 2.x those getters are removed and documented as removed in MIGRATING.md:278. That is correct, and nothing in the main change needs carrying over.
  • The three test conflicts. Each keeps the 2.x types (TestContextConfig, ContextPayload) and drops the comment as main did. There are no leftover conflict markers (git grep '<<<<<<<\|>>>>>>>' HEAD is empty).
  • Stale strings. git grep finds no "e.g. 1.x" agent version examples left in the 2.x Java sources. The only agent string is absmartly-java-sdk/2.0.0 in docs/plans/2.0.0.md:161, which matches build.gradle:16 VERSION = "2.0.0".

PR diff vs main

  • git merge-base origin/main HEAD = 9b2414b = origin/main. git diff origin/main...HEAD is 199 files, +9440/-7132, which is the same 2.0.0 change set as before. The merge adds no main-era change to it.
  • The CHANGELOG diff against main only adds the ## 2.0.0 (unreleased) section. Released sections are untouched, and main changed no CHANGELOG, README or MIGRATING lines in 07807b5..9b2414b (0 diff lines).

Parity with 1.x

  • The merge's only src/main change is a removed comment in Context.java (around line 2774). Main's 07807b5..9b2414b changes no behaviour (Javadoc and comments only). So the 1.x parity established by earlier gates still holds, and nothing in the 1.x line changed that 2.x needs to follow.

Tests needed

  • None. The merge adds no new state, flags, caches or entry points, so there is nothing for a mutation probe to target. Fix-commit audit: 0 items.

P3 / notes

  • None.

Pre-existing (not this delta)

  • The javascript-sdk in divergence noted in the bb86022 gate is unchanged.

Version and release notes

VERSION 2.0.0, X-Agent absmartly-java-sdk/2.0.0, and CHANGELOG ## 2.0.0 (unreleased) all agree, and the merge does not change them.

Verification limits / provenance:

  • Spotless: NOT RUN (the formatter download is offline). It needs CI on a92bfee after the push. The PR was CONFLICTING, so bb86022 never got CI. Main 9b2414b CI run 44732612763 passed.
  • R8 check: skipped (-PskipR8Check), as the brief specifies.
  • Steps 2, 3, 5 and 6 were not rerun with probes, because there is no production code change. They rest on the code diff above.

Evidence log (head a92bfee)

  • Head: git rev-parse HEAD = a92bfee, parents bb86022 and 9b2414b. Working tree clean before and after.
  • Step 1 (trees):
    • Release 1.9.0 is unchanged from earlier gates.
    • Merge base: git merge-base origin/main HEAD = 9b2414b, and git rev-parse origin/main = 9b2414b.
    • Main delta: git log 07807b5..9b2414b = 9b2414b, c066ba9, f460899.
    • gh pr view 27: headRefOid is still bb86022 (a92bfee is not pushed) and mergeable is CONFLICTING. Pushing a92bfee should resolve that.
  • Step 2 (compat):
    • git diff bb86022 HEAD --stat: 4 files, 21 deletions, all comments. No public API change.
    • git show --remerge-diff HEAD: Client.java conflict resolved to the 2.x side (no agent getters). The 3 test conflicts take the 2.x code without the comments.
    • diff of the removed lines (main 07807b5..9b2414b, excluding Client.java, vs bb86022..HEAD): the only delta is the ContextData to ContextPayload comment text.
  • Step 3 (parity): NOT RUN as probes, because there is no behaviour change. The main delta is Javadoc and comments only (git diff 07807b5 9b2414b).
  • Step 4 (tests): The full suite on a clean scratch worktree of a92bfee (/tmp/tmp.4mi1aAXIY4/head, removed afterwards) gives these counts from the JUnit XML:
    • core-api:test (JDK 11): 770 tests, 0 failures, 0 errors, 0 skipped.
    • core-api:testJdk25: 770 tests, 0 failures, 0 errors, 0 skipped.
    • Mutants: none run (no new logic; fix-commit audit has 0 items).
  • Step 5 (perf): NOT RUN: no production change.
  • Step 6 (forward-compat): NOT RUN: no decoder change.
  • Step 7 (build): JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew build -x spotlessCheck -PskipR8Check :core-api:testJdk25 --offline gave BUILD SUCCESSFUL in 37s, 21 tasks executed, exit 0. The log is at /tmp/a92-build.log.
    • Spotless: NOT RUN (offline). It needs CI on a92bfee.
    • CI: none on a92bfee yet (gh run list --commit a92bfee is empty). Main 9b2414b run 44732612763 passed.
  • Step 8 (docs): git diff 07807b5 9b2414b -- CHANGELOG.md README.md MIGRATING.md is empty. The 2.0.0 CHANGELOG section is intact, and MIGRATING.md:278 lists the agent getters as removed. Stale-string grep is clean.
  • Verdict: APPROVE (no P1, P2 or P3 findings).

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with suggestions

The changes since the earlier approval are ready to merge. The merge from main removes comments without changing SDK behavior. The new audience test distinguishes the two in candidate orders, and the download test still catches a missing cancellation.

Next step: None — ready to merge.

Suggestions (optional)

  • In CHANGELOG.md, say that a true candidate matches whenever the search reaches it. A list of candidates containing only true also matches; no non-boolean candidate is required. No operator change is needed.

What I checked

  • ✅ Exact-head CI: build and test-jdk21 passed, covering the JDK 11/21/25 lanes, formatting, R8, and the installed example.
  • ✅ Local build and full core suites passed: 770 tests each on JDK 11 and JDK 25, with no failures or skips.
  • ✅ Both changed tests failed under independent negative controls: continuing past an incomparable audience candidate and removing HTTP response cancellation.
  • ✅ The merge preserves the 2.x Client API and test types. The only production-source edit since approval deletes a comment.
Review details

Head: a92bfee15de4bd6ab3195befe1ae6bd9491e826c. Base and merge-base: 9b2414bf40ee5b51b0f690d099b7c4e6ce7a5187. Post-approval baseline: 6d52f41d4337244712392d6e83ad7d0875fa716f. Compared the full post-approval delta, including bb86022..a92bfee and the incoming main changes. The 1.x Javadoc examples were attached to getters that 2.x removed, so dropping those examples does not lose an applicable contract. The delta changes docs and tests for the Java 2.0 SDK, not runtime behavior for Java or downstream Kotlin/Scala/Android consumers. No new rollout, cross-SDK repin, or publication requirement was introduced. The companion cross-SDK run and Android ART were not rerun for this delta.

Convergence summary — review round 9

  • Unresolved original blockers: 0
  • Remediation regressions: 0
  • Independent PR-change findings: 0 blocking
  • Acceptance criteria still open: none
  • Human adjudication requested: no

Validation: JAVA_HOME="$JAVA_HOME_11" ./gradlew build -x spotlessCheck -PskipR8Check --console=plain passed; exact-head Actions covered the omitted Spotless and R8 gates. The exact-head CodeRabbit check was skipped and is not counted as passing validation. The local JUnit XML for test and testJdk25 each reports 770 tests, 0 failures, 0 errors, 0 skipped. In a detached scratch tree, JDK 25 :core-api:testJdk25 --tests '*ABsmartlyClientTest.anInSearchForAListAttributeStopsAtTheFirstDifferentCandidate' --tests '*JdkHttpTransportTest.timedOutDownloadIsCancelled' -x spotlessCheck --console=plain failed both unchanged tests as expected: null-safe comparison continued to the second candidate and served variant 1 instead of 0; removing only sent.cancel(true) left the loopback server writing past the eight-second test bound. JDK 11 intentionally asserts the timeout, not socket cancellation. git diff --check 6d52f41 HEAD passed; the whole-PR check still notes an unchanged blank line at EOF in example/build.gradle, already present at the approved commit.

Passes (non-blocking): run: core runtime/API/data (verified comment-only production delta and traced the audience and HTTP paths); dedicated error handling and error messages (specialist completed; traced audience mismatch, rule skip and timeout/cancellation); tests/CI/packaging (audience test, real HTTP cancellation and full build); cross-cutting simplicity; comment hygiene; diff composition | not run: deployment/operations/observability (no deployment, release or log-emission changes), shared frontend (no frontend source), separate behaviour-bearing data/policy pass (no loaded configuration, policy or fixture changes; inline test inputs covered by test pass).

Comment hygiene (non-blocking): 1 comment / 15 code lines, ratio ~1:15, none flagged.

threshold T=5; restatements counted: no (10 × C < E). The test comment explains the timing separation between cancellation and natural completion.

Diff composition (non-blocking): every file is required for the change; none flagged. The pinned introduced-content helper enumerated 381 writes (379 unique blobs) from merge-base to head, including intermediate versions and 10 writes in the post-approval delta excluding incoming main history; path and content scan found no credential or unrelated artifact.

Simplifications (non-blocking): none.

…n among only booleans

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Final independent sdk-review on 4044c72: APPROVE, 0 P1/P2/P3.

Delta since a92bfee (Jervasion-approved in review 5994451478): one docs-only commit. It implements that review's optional suggestion: in CHANGELOG.md, a true candidate matches whenever the in search reaches it, even in a list of only booleans.

Checks:

  • Each clause was verified against InOperator, ExprEvaluator and AudienceMatcher.
  • 19 probe cases on the 1.9.0 jar and the head jar, for both list and map attributes, covering the audience-filter and assignment-rule paths, all agree with the text.
  • 770 tests pass on JDK 11 and on JDK 25.
Reviewer report and evidence log (4044c72)

APPROVE at 4044c72: this is a docs-only commit. It rewrites one CHANGELOG paragraph (CHANGELOG.md:49-55), and every clause of the new text matches InOperator, ExprEvaluator.compare/booleanConvert and AudienceMatcher. The probes on head and on the published 1.9.0 jar confirm it, the build passes, and 770/770 tests pass on JDK 11 and on JDK 25. No P1, P2 or P3 findings.

Re-reviewed 4044c72 (1 commit since the pushed head a92bfee, which Jervasion approved in review 5994451478). The baselines are carried over from earlier gates: Maven Central core-api 1.9.0 (offline ~/.m2 jar, sha256 90ef04a2…3321) → merge base 9b2414b (= origin/main per the a92bfee gate) → head. Only this commit's delta is in scope.

Delta

  • git diff a92bfee 4044c72 --name-only gives only CHANGELOG.md. There is one hunk, +5/-5, inside ## 2.0.0 (unreleased) › Changed. No released section is touched.
  • The commit implements Jervasion's optional suggestion: a true candidate matches whenever the search reaches it, even in a list of only booleans.

Clause-by-clause verification (head source)

  1. "an in search over a list or map attribute stops at the first non-boolean candidate that differs from it". This holds.
    • InOperator.java:13 runs evaluator.compare(item, needle) == 0 on the boxed Integer.
    • ExprEvaluator.compare (ExprEvaluator.java:130-162) returns null for a non-equal list/list or map/map pair (l.152-156), for a number, string or null candidate against a list or map, and for a class mismatch.
    • Unboxing that null throws a NullPointerException, which ends the loop.
    • The direct JsonExpr probe gives NPE for [[2],true], ["s",true] and [null,true].
  2. "The whole audience filter then fails and is logged and treated as a mismatch". This holds: AudienceMatcher.java:119-121 catches the RuntimeException, logs warn, and returns Result(false). The probe gives audience=false for [[2],true].
  3. "in an assignment rule, that rule is skipped and the next one is tried". This holds: AudienceMatcher.java:224-226 catches, logs and continues the loop. In the probe, [[2],true] resolves to the fallback rule variant=2, not null.
  4. "A true candidate matches any list or map attribute whenever the search reaches it, even in a list of only booleans". This holds.
    • For a Boolean lhs, compare uses booleanConvert(rhs), which returns x != null (true) for a list or map (ExprEvaluator.java:70, 147-150), so true.compareTo(true) == 0.
    • A false candidate compares as -1, does not throw, and does not match, so the search continues.
    • In the probe, [true], [false,true], [true,[2]] and map [true]/[false,true]/[true,{"a":2}] all match.
  5. "So a list attribute matches in in when, before any differing non-boolean candidate, the search reaches either true or a candidate equal to it". This holds as a summary of clauses 1-4.
    • [[1],true], [false,[1]] and [[1]] match. [[2],true] fails.
    • [false] and [false,false] return false without an exception.
  6. The unchanged tail is still accurate. The 1.x contrast holds: on 1.9.0, List.of(1) versus the [1] literal does not match, because 1.9.0 required the exact class. On head it does. "Numbers inside lists... by Java type" is still true because head l.154 uses List.equals.

Probe table (attribute x; condition {"in":[{"value":<cands>},{"var":"x"}]}; audience = evaluate(...).get(), rule = evaluateRules with r1 assign 1 on the condition + unconditional fallback assign 2)

attr candidates 1.9.0 audience/rule head audience/rule
List.of(1) [true] true / 1 true / 1
List.of(1) [false] false / 2 false / 2
List.of(1) [false,true] true / 1 true / 1
List.of(1) [[1],true] false / 2 true / 1
List.of(1) [[2],true] false / 2 false / 2
List.of(1) [true,[2]] true / 1 true / 1
List.of(1) [false,[1]] false / 2 true / 1
List.of(1) [[1]] false / 2 true / 1
List.of(1) ["s",true] false / 2 false / 2
List.of(1) [5,true] false / 2 false / 2
List.of(1) [null,true] false / 2 false / 2
List.of(1) [false,false] false / 2 false / 2
Map.of("a",1) [true] true / 1 true / 1
Map.of("a",1) [false,true] true / 1 true / 1
Map.of("a",1) [{"a":1}] false / 2 true / 1
Map.of("a",1) [{"a":2},true] false / 2 false / 2
Map.of("a",1) [true,{"a":2}] true / 1 true / 1
Map.of("a",1) [false,{"a":1}] false / 2 true / 1
Map.of("a",1) [false] false / 2 false / 2
  • Every row agrees with the new CHANGELOG text on both jars.
  • The only release-to-head differences (bold) are equal-content list and map candidates. That is the documented "compares by content, whatever the attribute's class" change in the same paragraph.
  • The boolean and stop-at-first-differing behaviour is identical to 1.9.0, as the text's "As in 1.x" says.

Tests needed

None. The delta is docs-only and adds no production code. The behaviour the text describes was already pinned by the test added in c748329/bb86022, and this commit does not change it. 0 mutations run, because there is no code delta.

P3 / notes

  • None.

Version and release notes

The heading ## 2.0.0 (unreleased) is unchanged. build.gradle VERSION 2.0.0 is unchanged. The entry stays under Changed, which is the right section for an assignment-affecting change.

Pre-existing on main (not this PR)

  • Carried from earlier gates: CHANGELOG ## 1.9.0 (unreleased) while 1.9.0 is on Maven Central (a release gate on main, not this PR).

Verification limits / provenance:

  • Spotless: NOT RUN, because the formatter download is offline. It needs CI on this head; no run id exists yet because the head is not pushed.
  • The 1.9.0 jar is the offline ~/.m2 copy, the same as in earlier gates.
  • The probes call the package-private evaluateRules from a class in package com.absmartly.sdk on the class path. That is not a customer API, but it is the production rule path that Context uses.

Evidence log (head 4044c727ab7dec64a9add921dff0a9ac932b9f9b)

Step Command(s) Tree Result Verdict
0 head git rev-parse HEAD repo 4044c72 matches the brief
1 trees Baselines carried from the a92bfee gate (1.9.0 jar sha256 90ef04a2…3321; merge base 9b2414b). git diff a92bfee 4044c72 --stat a92bfee→4044c72 CHANGELOG.md only, +5/-5, 1 hunk docs-only
2 compat NOT RUN afresh: no source change (only CHANGELOG.md). Behaviour probe in the table above, 1.9.0 jar vs head shadow jar, JDK 11 1.9.0, 4044c72 19 cases. The only differences are equal-content list/map rows, and they are documented OK
3 parity Clause-by-clause read of InOperator.java:9-26, ExprEvaluator.java:61-71,130-162, AudienceMatcher.java:112-131,182-234. Direct JsonExpr probe 4044c72 [[2],true], ["s",true], [null,true] → NPE; [false,false] → false text accurate
4 tests JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=$HOME/.gradle ./gradlew build -x spotlessCheck -PskipR8Check --offline in a fresh worktree of 4044c72. It ran :core-api:test and :core-api:testJdk25. Then ./gradlew :core-api:testJdk25 (up to date) worktree 4044c72 BUILD SUCCESSFUL, exit 0. JUnit XML: test 770 tests / 0 fail / 0 err / 0 skip; testJdk25 770 / 0 / 0 / 0. Mutations: 0 (no code delta). Fix-commit audit: adds no state pass
5 perf NOT RUN: no code change n/a n/a n/a
6 forward-compat NOT RUN: no decoder change n/a n/a n/a
7 build/CI Same build as step 4. Spotless NOT RUN (offline formatter); needs CI on this head 4044c72 jar built (core-api.jar) pass except Spotless NOT RUN
8 docs git show 4044c72; read CHANGELOG.md:42-55 4044c72 inside the unreleased 2.0.0 section; no released section touched; claims verified in step 3 OK
cleanup git worktree remove of the scratch worktree; git status --short repo empty; HEAD 4044c72 tree untouched

@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Jervasion's optional suggestion from review 5994451478 is implemented in 4044c72. The CHANGELOG now says a true candidate matches any list or map attribute whenever the in search reaches it, even in a list of only booleans.

The summary sentence now reads: a list attribute matches in in when, before any differing non-boolean candidate, the search reaches either true or a candidate equal to it. That avoids implying a non-boolean candidate is required. No operator change. The independent gate checked it with 19 probe cases on 1.9.0 and on head, covering list and map attributes and both the audience and rule paths.

@jervasion-absmartly
jervasion-absmartly dismissed their stale review November 20, 2026 14:49

New commits were added after this approval. Jervasion will reassess the updated head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CI failed

The changelog now correctly explains that a true candidate matches a list or map attribute whenever the in search reaches it. No code or test changed, and I found no issue with the edit. Approval is withheld because the exact-head test-jdk21 job failed in GitHub Actions, even though all 770 tests passed locally on JDK 21.

Next step: Rerun test-jdk21 on this commit. If it fails again, use the Actions log to identify the failing test or runner step before merging.

What I checked

  • ✅ The only change since the earlier approval is one paragraph in CHANGELOG.md. Twelve direct evaluator cases confirmed the documented list and map behavior, including boolean-only candidate lists.
  • ✅ The exact-head build job passed, including the JDK 11/25 build and tests, formatting, R8, and the installed example.
  • ✅ The local JDK 21 suite passed: 770 tests, no failures or skips.
  • ❌ Exact-head test-jdk21 failed at the test step with exit code 1. The available annotation did not identify a failing test, and I could not retrieve the hosted log. The cause is unverified.
Review details

Head: 4044c727ab7dec64a9add921dff0a9ac932b9f9b. Base and merge-base: 9b2414bf40ee5b51b0f690d099b7c4e6ce7a5187. Post-approval baseline: a92bfee15de4bd6ab3195befe1ae6bd9491e826c. The author addressed the earlier optional documentation suggestion. No SDK behavior, API, workflow, rollout, or downstream integration changed.

Convergence summary — review round 10

  • Unresolved original blockers: 0
  • Remediation regressions: 0
  • Independent PR-change findings: 0
  • Acceptance criteria still open: none for the change; exact-head hosted JDK 21 validation has not passed.
  • Human adjudication requested: no

Validation: git diff --check a92bfee HEAD passed. A JDK 11 JShell probe against exact-head compiled classes exercised [true], [false,true], [false], and equal/differing candidates before and after booleans for list and map attributes. Source tracing confirmed that AudienceMatcher translates the comparison exception into an audience mismatch or skips the current assignment rule. JAVA_HOME="$JAVA_HOME_21" ./gradlew :core-api:test -PskipJdk25 --console=plain passed on OpenJDK 21.0.13.0.3; JUnit XML reports 770/0/0/0 tests/failures/errors/skips. Actions run 44757084082: build job 136359542404 passed; test-jdk21 job 136359541958 failed. Job log downloads were inaccessible from this environment and the run has no attached artifacts. A local pass does not establish what failed on the hosted runner.

Passes (non-blocking): run: documentation correctness (checked membership and the existing mismatch/rule-skip paths), test/CI diagnostics (exact-head job evidence and local JDK 21 test run), cross-cutting simplicity, comment hygiene, diff composition | not run: separate runtime/API/security/data or error specialist (only changelog prose changed; no executable or failure-handling change), deployment/operations/observability (no deployment, release instructions or emission changes), shared frontend (no frontend source), behaviour-bearing data/policy (no loaded configuration, policy or fixtures changed).

Comment hygiene (non-blocking): 0 comment / 0 code lines, ratio n/a, none flagged.

threshold T=5; restatements counted: yes (10 × C ≥ E; no source comments added).

Diff composition (non-blocking): every file is required for the change; none flagged. The pinned helper enumerated 382 content writes (380 unique blobs) from merge-base to head. The only write since approval is the changelog paragraph; the path and content audit found no unrelated artifact or credential.

Simplifications (non-blocking): none.

@joalves

joalves commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Final independent sdk-review on a30de65: APPROVE, 0 P1/P2/P3.

Fixes the JDK 21 CI race identified in review 5995138194. Initial SubmissionPublisher subscription delivery now finishes inline before the test enables rejection; subsequent stream delivery must schedule a task and encounter rejection. SDK stages still use the cached pool. Full build: 770 tests each on JDK 11/25. Focused repetitions and two negative controls verified rejection coverage.

Independent report and evidence

APPROVE at a30de6558456db4aebc6893936c0c93f4dddcdcb: the test-only fix removes the initial-consumer race and preserves a real rejected delivery while SDK stages still run on the cached pool. No P1/P2/P3 findings in the reviewed delta.

Re-reviewed one commit since remote 4044c727ab7dec64a9add921dff0a9ac932b9f9b. Independently established published Maven Central core-api 1.9.0 → main/merge base 9b2414bf40ee5b51b0f690d099b7c4e6ce7a5187 → head. Only 4044c72→a30de65 is a finding scope. No prior report results reused.

Must fix

None. P1: 0; P2: 0; P3: 0.

Verified fixed

/workspace/repos/java-sdk/core-api/src/test/java/com/absmartly/sdk/ABsmartlyClientTest.java:1231–1240 now executes initial SubmissionPublisher tasks inline. onSubscribe requests unlimited demand and returns; its ConsumerTask finishes before subscribe returns and before saturation is enabled. No initial active consumer remains to drain later events without another scheduling attempt. Saturated stream tasks throw RejectedExecutionException, while all other executor tasks still use the cached pool.

The test asserts READY, null failure, treatment 1 and zero subscribers after rejected delivery. Class-level 30-second SEPARATE_THREAD timeout bounds it; finally shuts down the pool. No observed deadlock or timeout. Two focused negative controls were killed on both JDK 11 and 25, establishing that neither rejection propagation nor bypassed rejection can silently pass.

Tests needed (implementation correct)

None identified. 2 focused controls / 2 killed / 0 survived, each on both runtimes. This is not the skill's standard 8–12 full-suite mutation campaign, explicitly excluded by the user's bounded request.

Compatibility / parity / forward compatibility

No production/API/build/dependency/wire/decoder delta from 4044c72. No new broad release-to-2.0 certification claimed. Downloaded published 1.9.0 sources and matched all 77 tracked tag Java files byte-for-byte; only extra artifact source is generated internal/SdkVersion.java.

Performance

NOT RUN: no production delta, no performance/allocation claim.

Version and release notes

VERSION 2.0.0 and docs/CHANGELOG unchanged. No customer-visible behaviour introduced by this test hardening. Broader 2.0 migration predates this commit and is not re-audited here.

Pre-existing (not this delta)

Broader 2.0 branch API/platform/packaging changes predate the test-only fix; they are not attributed to a30de65. This bounded review does not independently certify those changes.

Verification limits / provenance: Requested full build passed on exact head; 770 tests each on JDK 11 and 25, no failures/errors/skips. Three additional invocations passed; one accidentally reran the full JDK 11 suite due Gradle option binding, recorded below. Target passed 4 times per runtime including full build. Spotless and R8 intentionally excluded by requested command. Exact-head CI has no runs; PR #27 remote still 4044c72. APPROVE is this local delta gate, not a claim all CI/release gates passed. No commits/pushes/GitHub comments. Source clean.

Report destination blocker: Writing /workspace/repos/java-sdk/.git/sdk-review/a30de6558456db4aebc6893936c0c93f4dddcdcb.md was refused by worktree isolation: “Edit the worktree copy of this file instead of the shared-checkout path.” No bypass attempted. Completed report is at /tmp/sdk-review-a30de65.pI1GP5/sdk-review-a30de65.md; caller with access to original checkout must copy it to requested destination.


Evidence log

  • Head: a30de65.
  • Independent reviewer; sdk-review skill invoked, all four reference files read.
  • Started/finished UTC: 2026-11-20T16:26:38Z / 2026-11-20T16:35:35Z.
  • Worktree: /workspace/repos/java-sdk/.claude/worktrees/agent-ae27d2e93b31f41e9.
  • Scratch evidence: /tmp/sdk-review-a30de65.pI1GP5.

1. Trees

  • git rev-parse HEAD initially 9b2414b (fresh agent-created worktree); git switch --detach a30de6558456db4aebc6893936c0c93f4dddcdcb selected exact requested head in own isolated worktree.
  • git merge-base origin/main HEAD = 9b2414b.
  • git log --oneline 4044c72..HEAD: one commit a30de65; git diff --stat 4044c72 HEAD: one test file, +9/-3. git diff 4044c72 HEAD inspected completely.
  • curl -fsSL --max-time 20 https://repo.maven.apache.org/maven2/com/absmartly/sdk/core-api/maven-metadata.xml: exit 0, latest/release 1.9.0, updated 20261116222859.
  • curl -fsSL --max-time 20 https://repo.maven.apache.org/maven2/com/absmartly/sdk/core-api/1.9.0/core-api-1.9.0-sources.jar -o /tmp/sdk-review-a30de65.pI1GP5/core-api-1.9.0-sources.jar: exit 0. sha256sum: d66acf944d111f43869cd6add86a70d17e5921018a9c71c59900f979b84c676f.
  • git tag --sort=-version:refname: v1.9.0 latest. git rev-parse v1.9.0: tag object e1229d03ca0f7b533854d1f964e29429252f6ed2.
  • git archive --format=tar --output=/tmp/sdk-review-a30de65.pI1GP5/release-tag.tar v1.9.0 core-api/src/main/java: release tag source; archive commit 853feb3. Python tarfile/zipfile byte comparison: 77 tracked Java files, 0 missing, 0 mismatches; extra artifact Java only generated internal/SdkVersion.java.
  • Read PR body via gh pr list --repo absmartly/java-sdk --state open --json number,title,headRefName,headRefOid,body: owner-directed 2.0 rewrite; PR java-sdk 2.0.0: idiomatic API #27 still remote 4044c72.
  • Read build.gradle VERSION=2.0.0. X-Agent/version-generation/CHANGELOG unchanged by delta. Full release/API audit of existing 2.0 changes and discontinued java6 family NOT RUN (bounded scope).
  • Verdict: exact trees/delta established freshly.

2. Backwards compatibility

  • git diff --name-only 4044c72 HEAD -- core-api/src/main core-api/src/jdk11 build.gradle core-api/build.gradle README.md CHANGELOG.md .github: empty. Complete diff also confirms only test source.
  • Read Context.java construction/Ready completion, ABsmartlyClient executor wiring, EventDispatcher delivery and EventStream rejection catch at exact head.
  • NOT RUN: API dumps, external release/main/head consumers, old binary consumer, released-suite transplant, no-rule UID/wire sweep and error/null/logging matrix; zero production delta and explicit bounded test-only request. No new public fields/hooks/entry points.
  • Verdict: no introduced runtime compatibility delta, not comprehensive 1.9→2.0 compatibility certification.

3. Parity

  • Read contracts/checklist/past-findings including lifecycle, executor ownership, worker assertions, fixture bypass and bounded waits.
  • Relevant stream rejection isolated while SDK tasks keep working, measured in step 4.
  • NOT RUN: JS vectors, numeric table, cross-sdk census; evaluator/assignment/header/wire source unchanged.
  • Verdict: no parity delta.

4. Tests and mutation

Tree: exact a30de65.

Full build

Command exactly requested:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=/home/agent/.gradle ./gradlew build -x spotlessCheck -PskipR8Check :core-api:testJdk25
Log full-build.log. Exit 0; BUILD SUCCESSFUL in 34s, 21 actionable tasks executed. Actual jar/example package build and verifyShadedJar passed.

Python ElementTree sums over JUnit TEST-*.xml:

  • core-api:test: 53 suites, 770 tests, 0 failures, 0 errors, 0 skipped; sum XML suite time 13.1s; task logger 14.5s.
  • core-api:testJdk25: 53 suites, 770 tests, 0 failures, 0 errors, 0 skipped; sum XML suite time 10.952s; task logger 11.6s.
    cp -a core-api/build/test-results /tmp/sdk-review-a30de65.pI1GP5/full-test-results preserved full XML.

Three additional invocations

All use JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=/home/agent/.gradle.

  1. ./gradlew :core-api:test :core-api:testJdk25 --tests com.absmartly.sdk.ABsmartlyClientTest.rejectedStreamDeliveryDoesNotFailALoadedContext --rerun-tasks -PskipR8Check → exit 0, 18s. Log focused-1.log. IMPORTANT: trailing filter applied only to second task; JDK 11 ran 770 tests (14.7s), JDK 25 ran 1 target (696ms). This unintentionally repeated a full test lane, not another package build; no further unfiltered suite runs.
  2. ./gradlew :core-api:test --tests com.absmartly.sdk.ABsmartlyClientTest.rejectedStreamDeliveryDoesNotFailALoadedContext :core-api:testJdk25 --tests com.absmartly.sdk.ABsmartlyClientTest.rejectedStreamDeliveryDoesNotFailALoadedContext --rerun-tasks -PskipR8Check → exit 0, 4s. Log focused-2.log; 1 target passed each lane (1.2s / 607ms).
  3. Same correctly filtered command → exit 0, 4s. Log focused-3.log; 1 target passed each lane (1.3s / 632ms). Final XML: 1 test / 0 failures / 0 errors / 0 skips each; suite times .483s/.166s.
    Target total including full build: 4 passes per runtime / 8 target passes; no timeout or deadlock. Bounded evidence, not statistical stress guarantee.

Negative controls

Tar copy excluding .git/.gradle/build into scratch probe-tree, never reviewed source. Each command:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 GRADLE_USER_HOME=/home/agent/.gradle /tmp/sdk-review-a30de65.pI1GP5/probe-tree/gradlew -p /tmp/sdk-review-a30de65.pI1GP5/probe-tree :core-api:test --tests com.absmartly.sdk.ABsmartlyClientTest.rejectedStreamDeliveryDoesNotFailALoadedContext :core-api:testJdk25 --tests com.absmartly.sdk.ABsmartlyClientTest.rejectedStreamDeliveryDoesNotFailALoadedContext --continue -PskipR8Check

Mutant Outcome JDK 11 Outcome JDK 25 Result
EventStream.java:48–54 catch rethrows rejection 1 test/1 failure: test:1267 expected null failure but RejectedExecutionException:saturated 1 test/1 failure: test:1268 expected treatment 1 but 0 killed
ABsmartlyClientTest.java:1232–1233 saturated stream command runs inline/returns instead of rejecting 1 test/1 failure: expected subscriber count 0 but 1 same failure killed

Controls Gradle exit 1, BUILD FAILED in 5s/4s respectively, no timeout. Logs mutant-propagate.log / mutant-no-rejection.log; XML mutant-propagate-results / mutant-no-rejection-results. Production scratch restored between controls. Totals 2 focused mutants / 2 killed / 0 survived, four runtime/control executions. Mutant copy and its tar removed after evidence captured.

Standard 8–12 full-suite mutants NOT RUN: explicit bounded request; no rule/decoder production change. No survivor finding.

Fix-commit audit: a30de65 adds only test executor control flow; no production flags/cache/API. Initial stream task finishes inline; AtomicBoolean saturation set only after subscribe returns and before newContext. Remaining SDK work still cached-pool-backed. No prior initial consumer remains to bypass rejected scheduling. Caller-thread assertions observe READY/failure/treatment/removed subscriber, no worker assertions swallowed. Class-level @timeout=30s SEPARATE_THREAD; pool finally shutdownNow. Verdict: race fixed, meaningful rejection/no observed deadlock.

5. Performance

NOT RUN: timing/allocations, zero production delta. No ns/op claim or attribution of pre-existing costs.

6. Forward compatibility

NOT RUN: unknown/missing/null/reordered payload and malformed rules probes; zero decoder/model/rule delta. No broad fresh certification claimed.

7. Build / CI / packaging

  • Actual package/shaded jar/example build/verifyShadedJar passed in step 4; no publish/upload attempted.
  • Spotless NOT RUN (-x spotlessCheck); R8 NOT RUN (-PskipR8Check), explicitly requested exclusions. git diff --check 4044c72 HEAD exit 0, no output; not a formatter substitute.
  • JDK25 full suite/repetitions/controls passed or expected failures as recorded; JDK21 CI lane NOT RUN locally, bounded scope. No toolchain/floor change.
  • gh run list --repo absmartly/java-sdk --commit a30de6558456db4aebc6893936c0c93f4dddcdcb --limit 5 --json databaseId,headSha,status,conclusion,url → []. No exact-head run id. Prompt report rather than prolonged waiting as user requested.
  • gh pr list --repo absmartly/java-sdk --state open --json number,title,headRefOid --jq '.[] | [.number,.title,.headRefOid]': PR java-sdk 2.0.0: idiomatic API #27 still 4044c72.
  • Workflow/floors/dependency/pins unchanged. Full publish dry-run/consumer install/pin audit NOT RUN on pre-existing 2.0 rewrite.
  • Verdict: requested bounded build passed; omitted CI/release gates explicitly unverified, not silently green.

8. Docs / CHANGELOG

  • Complete diff 4044c72→head touches only test file; no docs/CHANGELOG/version/agent changes. Read VERSION=2.0.0 and PR body scope.
  • NOT RUN: broad migration-note/published API audit or stale-version sweep, outside test-only follow-up.
  • Verdict: no new customer-visible delta requiring version/docs changes.

Findings and cleanup

P1=0; P2=0; P3=0. Verdict APPROVE for bounded delta.
git rev-parse HEAD at completion = requested full SHA; git status --porcelain=v1 empty; git diff --check 4044c72 HEAD empty. Mutant copy removed. No commit/push/GitHub comments/reviews. Source clean, only ignored build outputs and scratch evidence created.

Report write to original .git/sdk-review destination was blocked by worktree isolation; this scratch report preserves all evidence for caller to place at authorized destination. No workaround around denied shared-checkout writes attempted.

@jervasion-absmartly jervasion-absmartly left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved

The stream rejection test now finishes subscriber setup before turning on rejection, so its initial delivery task can no longer drain a later event without hitting the rejection path. No SDK runtime code changed, and the JDK 21 job that failed on the previous head now passes.

Next step: None — ready to merge.

What I checked

  • ✅ Exact-head GitHub Actions: build and test-jdk21 passed, including formatting, packaging, the R8 probe, and the installed example smoke test.
  • ✅ All 770 core tests passed locally on each of JDK 11, 21, and 25. On JDK 21, the revised test failed when I made the SDK propagate the simulated rejection instead of handling it.
  • ✅ The changelog now correctly describes a true candidate matching whenever the in search reaches it, including when all candidates are booleans.
Review details

Head: a30de6558456db4aebc6893936c0c93f4dddcdcb. Base and merge-base: 9b2414bf40ee5b51b0f690d099b7c4e6ce7a5187. Post-approval responsibility baseline: a92bfee15de4bd6ab3195befe1ae6bd9491e826c. This round covers the two intervening commits, including the test follow-up to round 10. The earlier job annotation exposed only an exit code; the subscription race is supported by the code and the author's analysis, not independently established as the historical job's cause.

The Java 2.0 migration targets Java 11+ and downstream Kotlin, Scala, and Android wrappers. This delta changes neither production behavior nor build configuration. The companion conformance results and merge/repin order are documented in the PR; Android ART and the companion suite were not rerun for this test-only runtime delta.

Convergence summary — review round 11

  • Unresolved original blockers: 0
  • Remediation regressions: 0
  • Independent PR-change findings: 0
  • Acceptance criteria still open: none
  • Human adjudication requested: no

Validation: ./gradlew :core-api:test :core-api:testJdk25 --console=plain ran on JDK 11, and ./gradlew :core-api:test -PskipJdk25 --console=plain -q ran on JDK 21. Each lane ran 770 tests without failures or skips. ./gradlew build :example:installDist -x spotlessCheck -PskipR8Check --console=plain -q passed on JDK 11; the installed example reached the expected ContextLoadException against its placeholder endpoint, not a class-loading failure. Local full build setup could not resolve download.eclipse.org for Spotless; exact-head Actions job 136424544068 passed the full gate including Spotless and R8. Hosted JDK 21 job 136424544436 passed. CodeRabbit was skipped and is not counted as validation. git diff --check a92bfee HEAD passed.

Negative control: In a separate detached worktree I changed only EventStream.submit() to rethrow its caught RuntimeException, then ran JDK 21 :core-api:test -PskipJdk25 --tests '*ABsmartlyClientTest.rejectedStreamDeliveryDoesNotFailALoadedContext'. The unchanged test failed because context.failure() held RejectedExecutionException: saturated. The JDK can schedule rejection on READY or EXPOSURE depending on continuation timing; the test verifies lifecycle isolation and loss of the rejected subscriber, not the identity of the first event.

Passes (non-blocking): run: test/CI/packaging (changed executor setup and exact-head gates); dedicated error handling and messages (specialist completed; offer rejection, subscriber loss, and context lifecycle); documentation correctness (list/map membership and mismatch/rule skip); cross-cutting simplicity, comment hygiene, and diff composition | not run: separate core runtime/API/security/data (no production source change; existing behavior traced for the test and docs), deployment/operations/observability (no workflow, deployment or emitted-message change), shared frontend (no frontend source), behaviour-bearing data/policy (no loaded configuration or fixtures changed).

Comment hygiene (non-blocking): 2 comment / 7 code lines, ratio ~1:3.5, none flagged.

threshold T=5; restatements counted: yes (10 × C ≥ E). The two-line comment records why an already-running consumer can bypass the rejection the test is trying to induce.

Diff composition (non-blocking): every file is required for the change; none flagged. The pinned introduced-content helper found two post-approval writes (the test and changelog) and 383 writes / 381 unique blobs in the cumulative range. No credential-bearing content or unrelated artifact was identified.

Simplifications (non-blocking): none introduced in this delta.

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.

2 participants