fleetd #415: split coverage() feature-state wording by pattern fallback semantics #423
Reference in New Issue
Block a user
Delete Branch "worker/415-coverage-wording-2cbf9c-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket #415
CompletionResolver.coverage()measured pattern coverage (how many profiles set a key), but its empty-case wording (off (...)) read as feature state. That is false forerrorPattern: a profile with no configurederrorPatternstill runs backend-error classification against the built-inBACKEND_ERRORpattern (CompletionResolver.java:84), so "off" was wrong for that key. ForexhaustedPatternthere is no fallback, so "off" is correct there.Fix
Added
CompletionResolver.UnsetMeaning(OFF/BUILT_IN_DEFAULT) as a required parameter tocoverage()— no defaulted overload, so a third pattern key added later cannot compile without stating what unset means for it (per the ticket's acceptance criteria: prefer a required parameter over a defaulted one).Fleetd.javanow passes:UnsetMeaning.OFFforexhaustedPattern(CB-578 stage A — no fallback exists)UnsetMeaning.BUILT_IN_DEFAULTforerrorPattern(fleetd #201 Unit 5 — falls back to the built-in compatibility pattern)New wording:
OFF→off (no profile has an <key> configured; profiles: [...])(unchanged)BUILT_IN_DEFAULT→built-in default for all profiles (no profile customises <key>; profiles: [...])partial/fullunchanged for both keysTests
CompletionResolverTestcases to pass the newUnsetMeaningparameter.coverageNamesTheConfigKeyItsCallerMeansRatherThanAlwaysSayingExhaustedPattern, which had pinned the old, wrongerrorPatternwording ("off") — it now asserts the corrected built-in-default wording.coverageDistinguishesOffFromBuiltInDefaultForTheSameEmptyInput, which feeds the same empty-coverage shape through both keys and asserts the two resulting lines are different (per the ticket: "a test that only checks a line was emitted would pass today — that is not acceptable").Mutation proof (done and reverted before this push)
errorPattern/BUILT_IN_DEFAULTcase fall back to the oldoffwording):CompletionResolverTest.coverageNamesTheConfigKeyItsCallerMeansRatherThanAlwaysSayingExhaustedPatternandcoverageDistinguishesOffFromBuiltInDefaultForTheSameEmptyInputboth failed withAssertionFailedError: expected: <built-in default for all profiles (...)> but was: <off (...)>.exhaustedPattern/OFFcase use the built-in wording too):CompletionResolverTest.coverageIsOffWhenNoProfileHasAPatternConfiguredandcoverageDistinguishesOffFromBuiltInDefaultForTheSameEmptyInputboth failed with the mirrored assertion error.Build
mvn clean installfrom the worktree root'sfleetd/directory:0 compile errors, 0 test failures/errors.
Also noted, not fixed (per ticket #407 / #415 instructions)
FleetHealthMonitor.coverage(boolean, boolean)(fleetd/src/main/java/dev/ltms/fleet/health/FleetHealthMonitor.java:377) is logged at startup the same way, and I found no test anywhere underfleetd/src/testthat calls it directly — deleting its body would very likely leave the suite green.