fleetd #612 Unit B1: CompletionResolver behavioural test (replaces source-text guard) #627

Merged
ltms merged 1 commits from worker/612-b1-completion-457459-1 into worker/fleetd-612-unita-87807e-1 2026-09-22 07:14:26 +02:00
Member

fleetd #612 step 2, Unit B1 — CompletionResolver wiring.

Base branch: worker/fleetd-612-unita-87807e-1 (per brief; NOT main).

What changed

Replaced FleetdCompletionResolverWiringTest.java (4 source-text tests reading
Fleetd.java's literal source and asserting the CompletionResolver
construction call still named the right arguments) with
FleetdCompletionResolverAssemblyTest.java (2 behavioural tests), deleting the
old file in this same commit.

Unit A (FleetdAssembly.assembleAndStart) moved that construction call out of
Fleetd.main, breaking the old tests on a harmless relocation — they proved
spelling, never behaviour.

Deleted test -> what it pinned -> replacement

  • worktreeBranchLookupIsStillPassedAtTheCallSite (8th ctor arg) ->
    assembledResolverReportsTheMembersWorktreeAndBranchInAFallbackReport: a
    real git-worktree-provisioned MemberSession's branch must appear in a
    noReportMessage fallback (fleetd #241).
  • backendErrorArgumentsAreStillNamedAtTheCallSite,
    backendErrorPatternsComesFromTheFactory,
    backendErrorSinkComesFromTheFactory (5th/6th args) ->
    assembledResolverClassifiesAndCoolsOffOnAConfiguredBackendErrorPattern: a
    configured errorPattern the built-in fallback never matches must classify
    as FAILED (not COMPLETION), transition the session to BACKEND_ERROR, and
    cool the credential off after two distinct targets within the window
    (fleetd #201 Unit 5).

Both tests drive the real FleetdAssembly.assembleAndStart(...) and read
FleetdRuntime.completion() — the exact CompletionResolver instance
production uses — through its public onDelivered/resolveBeforePostAction
API, with a controllable ResourcePorts nanoClock standing in for real
sleeps. No test reads any .java source text.

Mutation proof (acceptance criterion 2)

Each behaviour was mutated at its real call site in FleetdAssembly.java,
confirmed RED with the new test alone, reverted (with a touch to defeat
Maven's stale-mtime skip), and confirmed GREEN again:

  1. 8th arg -> _ -> null: RED — AssertionFailedError on the missing
    branch= text in the fallback report.
  2. 5th arg (backendErrorPatterns) -> BackendErrorPatternLookup.legacy():
    RED — expected: <FAILED> but was: <COMPLETION>.
  3. 6th arg (backendErrorSink) -> BackendErrorSink.none(): RED —
    AssertionFailedError on sessions staying SPAWNING instead of
    transitioning to BACKEND_ERROR.

FleetdAssembly.java is unchanged in the final commit (verified via
git diff --stat, empty).

Build

Full mvn -o test: Tests run: 1878, Failures: 5, Errors: 0, Skipped: 0,
BUILD FAILURE
— down from the lead-measured baseline of 9 (4 deleted here).
The remaining 5 belong to other in-flight workers on this same ticket and were
not touched: FleetdBackendQuarantineWiringTest,
FleetdConnectionIdentityConstructionTest, FleetdFleetAppConstructionTest,
FleetdLeadRolloverWiringTest, FleetdLeadSeatWiringTest.

Out of scope (spotted, not fixed)

Same source-text-test shape exists in the 5 guard files above, already
tracked as other workers' scope on this ticket.

fleetd #612 step 2, Unit B1 — CompletionResolver wiring. Base branch: worker/fleetd-612-unita-87807e-1 (per brief; NOT main). ## What changed Replaced `FleetdCompletionResolverWiringTest.java` (4 source-text tests reading `Fleetd.java`'s literal source and asserting the `CompletionResolver` construction call still named the right arguments) with `FleetdCompletionResolverAssemblyTest.java` (2 behavioural tests), deleting the old file in this same commit. Unit A (`FleetdAssembly.assembleAndStart`) moved that construction call out of `Fleetd.main`, breaking the old tests on a harmless relocation — they proved spelling, never behaviour. ### Deleted test -> what it pinned -> replacement - `worktreeBranchLookupIsStillPassedAtTheCallSite` (8th ctor arg) -> `assembledResolverReportsTheMembersWorktreeAndBranchInAFallbackReport`: a real git-worktree-provisioned `MemberSession`'s branch must appear in a `noReportMessage` fallback (fleetd #241). - `backendErrorArgumentsAreStillNamedAtTheCallSite`, `backendErrorPatternsComesFromTheFactory`, `backendErrorSinkComesFromTheFactory` (5th/6th args) -> `assembledResolverClassifiesAndCoolsOffOnAConfiguredBackendErrorPattern`: a configured `errorPattern` the built-in fallback never matches must classify as FAILED (not COMPLETION), transition the session to BACKEND_ERROR, and cool the credential off after two distinct targets within the window (fleetd #201 Unit 5). Both tests drive the real `FleetdAssembly.assembleAndStart(...)` and read `FleetdRuntime.completion()` — the exact `CompletionResolver` instance production uses — through its public `onDelivered`/`resolveBeforePostAction` API, with a controllable `ResourcePorts` nanoClock standing in for real sleeps. No test reads any `.java` source text. ## Mutation proof (acceptance criterion 2) Each behaviour was mutated at its real call site in `FleetdAssembly.java`, confirmed RED with the new test alone, reverted (with a `touch` to defeat Maven's stale-mtime skip), and confirmed GREEN again: 1. 8th arg -> `_ -> null`: RED — `AssertionFailedError` on the missing `branch=` text in the fallback report. 2. 5th arg (`backendErrorPatterns`) -> `BackendErrorPatternLookup.legacy()`: RED — `expected: <FAILED> but was: <COMPLETION>`. 3. 6th arg (`backendErrorSink`) -> `BackendErrorSink.none()`: RED — `AssertionFailedError` on sessions staying `SPAWNING` instead of transitioning to `BACKEND_ERROR`. `FleetdAssembly.java` is unchanged in the final commit (verified via `git diff --stat`, empty). ## Build Full `mvn -o test`: **Tests run: 1878, Failures: 5, Errors: 0, Skipped: 0, BUILD FAILURE** — down from the lead-measured baseline of 9 (4 deleted here). The remaining 5 belong to other in-flight workers on this same ticket and were not touched: `FleetdBackendQuarantineWiringTest`, `FleetdConnectionIdentityConstructionTest`, `FleetdFleetAppConstructionTest`, `FleetdLeadRolloverWiringTest`, `FleetdLeadSeatWiringTest`. ## Out of scope (spotted, not fixed) Same source-text-test shape exists in the 5 guard files above, already tracked as other workers' scope on this ticket.
agent added 1 commit 2026-09-22 07:11:04 +02:00
FleetdCompletionResolverWiringTest read Fleetd.java's literal source text and
asserted the CompletionResolver construction call still named the right
arguments — proof of spelling, not behaviour. Unit A (FleetdAssembly) moved
that call site out of Fleetd.main, breaking all four of its tests on a
harmless relocation.

FleetdCompletionResolverAssemblyTest replaces it, driving the real
FleetdAssembly.assembleAndStart(...) and reading FleetdRuntime.completion() —
the exact CompletionResolver instance production uses — through its public
onDelivered/resolveBeforePostAction API, with a controllable ResourcePorts
nanoClock in place of real sleeps.

Deleted test -> what it pinned -> replacement:
- worktreeBranchLookupIsStillPassedAtTheCallSite (8th constructor arg) ->
  assembledResolverReportsTheMembersWorktreeAndBranchInAFallbackReport: a
  real git-worktree-provisioned MemberSession's branch must appear in a
  noReportMessage fallback (fleetd #241).
- backendErrorArgumentsAreStillNamedAtTheCallSite,
  backendErrorPatternsComesFromTheFactory, backendErrorSinkComesFromTheFactory
  (5th/6th args) -> assembledResolverClassifiesAndCoolsOffOnAConfiguredBackendErrorPattern:
  a configured errorPattern the built-in fallback never matches must classify
  as FAILED (not COMPLETION), transition the session to BACKEND_ERROR, and
  cool the credential off after two distinct targets within the window
  (fleetd #201 Unit 5).

Both behaviours were proven red today by mutating FleetdAssembly.java's real
call site to its inert variant (_ -> null; BackendErrorPatternLookup.legacy();
BackendErrorSink.none()), confirming the new test failed with the expected
message, then reverting (touching the file to defeat Maven's stale-mtime
skip) and confirming green again. FleetdAssembly.java itself is unchanged in
this commit.

Full suite: Tests run: 1878, Failures: 5 (down from the baseline 9 — the
remaining 5 are the other in-flight workers' own guard files:
FleetdBackendQuarantineWiringTest, FleetdConnectionIdentityConstructionTest,
FleetdFleetAppConstructionTest, FleetdLeadRolloverWiringTest,
FleetdLeadSeatWiringTest), Errors: 0, Skipped: 0.
ltms merged commit b6147a39f6 into worker/fleetd-612-unita-87807e-1 2026-09-22 07:14:26 +02:00
Sign in to join this conversation.