fleetd #442: pin startup report calls #445

Merged
ltms merged 2 commits from worker/442-pin-startup-report-calls-ad9c1b-15 into main 2026-09-10 11:30:31 +02:00
Member

Implements #442 with FleetdStartupReportTest. It invokes real Fleetd.main using an @TempDir config. The config triggers all four reports, then fails bind validation before any socket or port side effect. I kept four separate calls because the requested test can pin all four without changing production code.

Mutation evidence (each call was absent before its run):

  • reportGitHostShape(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report the git host shape.
  • reportMemberTrustModel(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report the member trust model.
  • reportMemberCredentialsGap(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report an absent memberCredentials policy.
  • reportExhaustedPatternGap(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report profiles without exhaustedPattern. This run also had 10 unrelated LeadCoordLoopTest NoClassDefFound errors; the restored run passed.

Restored full command: mvn -f /Users/dai.ha/LTMS/.bridged-worktrees/615687-15/fleetd/pom.xml clean install
[INFO] Tests run: 1573, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS

Candidate only, not changed or tested: reportRequiredSecrets(cfg) appears to have the same unpinned startup-caller shape.

Implements #442 with FleetdStartupReportTest. It invokes real Fleetd.main using an @TempDir config. The config triggers all four reports, then fails bind validation before any socket or port side effect. I kept four separate calls because the requested test can pin all four without changing production code. Mutation evidence (each call was absent before its run): - reportGitHostShape(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report the git host shape. - reportMemberTrustModel(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report the member trust model. - reportMemberCredentialsGap(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report an absent memberCredentials policy. - reportExhaustedPatternGap(cfg): FleetdStartupReportTest.mainReportsEveryStartupGapBeforeValidationAborts(Path) failed: Fleetd.main must report profiles without exhaustedPattern. This run also had 10 unrelated LeadCoordLoopTest NoClassDefFound errors; the restored run passed. Restored full command: mvn -f /Users/dai.ha/LTMS/.bridged-worktrees/615687-15/fleetd/pom.xml clean install [INFO] Tests run: 1573, Failures: 0, Errors: 0, Skipped: 0 [INFO] BUILD SUCCESS Candidate only, not changed or tested: reportRequiredSecrets(cfg) appears to have the same unpinned startup-caller shape.
agent added 1 commit 2026-09-10 09:41:43 +02:00
fleetd #442: pin startup report calls
CI / contract (pull_request) Successful in 1m15s
CI / build (pull_request) Successful in 1m36s
e70263062c
ltms added 1 commit 2026-09-10 11:30:00 +02:00
fleetd #442: drop the unused java.util.List import
CI / contract (pull_request) Successful in 47s
CI / build (pull_request) Successful in 2m8s
b1f34c2e6b
The new test never names List — only ListAppender, which has its own
import. An unused import is an IDE warning, and this repo treats
warnings as gates. No behaviour change: FleetdStartupReportTest still
runs 1 test, 0 failures, BUILD SUCCESS, 0 compile errors.
Owner

Merging. Credit where it belongs: the worker wrote this test. Its backend died mid-turn ("Our servers are currently overloaded") and its worktree was later reaped with the member, so it never reported back. But it had committed and pushed first, and e702630 carries the whole 80-line test. The evidence below is mine, not the worker's — the tree it tested no longer exists, so I re-ran everything against the tree that will actually be merged.

How I verified it. I made a detached worktree at the pushed branch, merged current origin/main into it, and repeated the battery there.

  • Merge of current main: exit 0, 0 conflicts.
  • Full build of the merged tree: Tests run: 1574, Failures: 0, Errors: 0, Skipped: 0, BUILD SUCCESS, 0 compile errors.
  • CONTROL (unmutated, the new test alone): green. Without this the four reds below would prove nothing.
  • Then one mutation per report call, deleting it from Fleetd.main, each with the deletion proven applied (occurrence count driven to 0) and then restored:
Deleted from main() Result Killed by
reportGitHostShape(cfg) KILLED mainReportsEveryStartupGapBeforeValidationAborts
reportMemberTrustModel(cfg) KILLED same
reportMemberCredentialsGap(cfg) KILLED same
reportExhaustedPatternGap(cfg) KILLED same

All four go red, so the test pins each call on its own, not just the group.

One change of mine on top (b1f34c2): the test imported java.util.List and never used it — it only names ListAppender, which has its own import. An unused import is an IDE warning and this repo gates on warnings. After removing it: Tests run: 1, Failures: 0, BUILD SUCCESS, 0 compile errors, no warning on the file. Nothing else changed, so the four kills above still describe this exact test logic.

Why the seam works. The fixture writes a config with a non-loopback bind.host, so cfg.validateAll() at Fleetd.java:161 throws before main can open the herdr socket or bind a port. All four reports run above it (:131, :132, :137, :141), so their log lines are already in the appender when the throw arrives. The config lives in a @TempDir, so no real .claude.json or any other host file is touched.

What was NOT covered before this. Each report* method had its own unit test, but each was referenced by exactly one test file and none of them asserted that main still calls it. validateAll is referenced by 4 test files; the reports had no such backstop. Deleting a call from main was a green-build change until now.

Merging. **Credit where it belongs: the worker wrote this test.** Its backend died mid-turn ("Our servers are currently overloaded") and its worktree was later reaped with the member, so it never reported back. But it had committed and pushed first, and `e702630` carries the whole 80-line test. **The evidence below is mine, not the worker's** — the tree it tested no longer exists, so I re-ran everything against the tree that will actually be merged. **How I verified it.** I made a detached worktree at the pushed branch, merged current `origin/main` into it, and repeated the battery there. - Merge of current `main`: exit 0, **0 conflicts**. - Full build of the merged tree: `Tests run: 1574, Failures: 0, Errors: 0, Skipped: 0`, `BUILD SUCCESS`, 0 compile errors. - **CONTROL** (unmutated, the new test alone): green. Without this the four reds below would prove nothing. - Then one mutation per report call, deleting it from `Fleetd.main`, each with the deletion **proven applied** (occurrence count driven to 0) and then restored: | Deleted from `main()` | Result | Killed by | |---|---|---| | `reportGitHostShape(cfg)` | **KILLED** | `mainReportsEveryStartupGapBeforeValidationAborts` | | `reportMemberTrustModel(cfg)` | **KILLED** | same | | `reportMemberCredentialsGap(cfg)` | **KILLED** | same | | `reportExhaustedPatternGap(cfg)` | **KILLED** | same | All four go red, so the test pins each call on its own, not just the group. **One change of mine on top** (`b1f34c2`): the test imported `java.util.List` and never used it — it only names `ListAppender`, which has its own import. An unused import is an IDE warning and this repo gates on warnings. After removing it: `Tests run: 1, Failures: 0`, `BUILD SUCCESS`, 0 compile errors, no warning on the file. Nothing else changed, so the four kills above still describe this exact test logic. **Why the seam works.** The fixture writes a config with a non-loopback `bind.host`, so `cfg.validateAll()` at `Fleetd.java:161` throws before `main` can open the herdr socket or bind a port. All four reports run above it (`:131`, `:132`, `:137`, `:141`), so their log lines are already in the appender when the throw arrives. The config lives in a `@TempDir`, so no real `.claude.json` or any other host file is touched. **What was NOT covered before this.** Each `report*` method had its own unit test, but each was referenced by exactly one test file and none of them asserted that `main` still calls it. `validateAll` is referenced by 4 test files; the reports had no such backstop. Deleting a call from `main` was a green-build change until now.
ltms merged commit 82fae94c55 into main 2026-09-10 11:30:31 +02:00
ltms deleted branch worker/442-pin-startup-report-calls-ad9c1b-15 2026-09-10 11:30:31 +02:00
Sign in to join this conversation.