fleetd #612 step 2 unit B2: behavioural replacements for the CB-185 pair #626
Reference in New Issue
Block a user
Delete Branch "worker/612-b2-cb185-176d3a-2"
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?
fleetd #612 step 2, unit B2 — the CB-185 pair.
Base branch is
worker/fleetd-612-unita-87807e-1(Unit A + A-gaps), notmain, per the lead's step 2 dispatch comment.What this does
Deletes the two source-text guards Unit A broke by moving their scraped call sites out of
Fleetd.javaintoFleetdAssembly.java, replacing each with a behavioural test driving the real assembled graph.Fleetd.javatext)FleetdConnectionIdentityConstructionTest"new PaneLocator(herdr, memberHerdr)"presentFleetdAssemblyConnectionIdentityTestPaneLocator(runtime.mcp().identity().panes()) finds a pane that exists on only the LEAD daemon, and separately one that exists on only the MEMBER daemonFleetdFleetAppConstructionTest"new FleetApp(herdr, memberHerdr, workers,"presentFleetdAssemblyFleetAppTestJavalinapp (runtime.app()) reportsGET /healthzas 503 when only the member daemon is downMutation proof (acceptance criterion 2)
Identity —
FleetdAssembly.java:443-444reverted tonew PaneLocator(memberHerdr), ran onlyFleetdAssemblyConnectionIdentityTest:Reverted,
git diff --statempty, file touched, re-ran:Tests run: 3, Failures: 0.FleetApp —
FleetdAssembly.java:518reverted tonew FleetApp(herdr, herdr, workers, ..., ran onlyFleetdAssemblyFleetAppTest:Reverted,
git diff --statempty, file touched, re-ran:Tests run: 2, Failures: 0.Why
GET /sessionsisn't pinned here tooThe deleted
FleetdFleetAppConstructionTest's javadoc also named the/sessionsmerge as a consequence. I could not drive that through the real assembly:/sessionsrequiresAuthz.Action.READ, which needsCaller.resolved()— a real positive pid from the assembly's hardcodednew LsofPeerPidLookup(). In an in-process JUnit test the HTTP client and the daemon under test are the same JVM pid, andLsofPeerPidLookupexplicitly excludes its own pid, so the resolved pid is always -1 and fleetd #317's fail-closed rule refuses the request (401 unauthenticated) before the route — and its merge — is ever reached. Verified directly (not assumed). Documented in the new test's class javadoc.FleetAppTwoDaemonTest(unchanged, still passing) remains the full behavioural proof thatFleetAppitself merges/sessionscorrectly once given two clients; this PR's/healthztest is what carries the CB-185-via-the-real-assembly claim.Production accessors added (flagged per brief — not
FleetdRuntime)I could not reach
ConnectionIdentity/PaneLocatorthroughruntime.app()/runtime.mcp()alone:identitywas a constructor-local variable insideFleetMcp, never stored as a field, and a real MCP/HTTP round trip can't exercisePaneLocatoreither, for the same in-process-same-pid reason above. I did not touchFleetdRuntime(the brief flagged three workers colliding there). Instead, two small additions:ConnectionIdentity#panes()— returns thePaneLocatorit resolves against.FleetMcp#identity()— returns theConnectionIdentityit was constructed with (now stored as a field; previously only captured by a constructor-local closure).Both are additive (new field + new getter), placed away from other constructors' argument lists, to minimize collision risk with the B1/B3 units also touching
FleetdAssembly-adjacent files.Build
Baseline on
608e449(this branch's tip before my change),mvn -o test:Tests run: 1880, Failures: 9, Errors: 0, Skipped: 0— confirmed to be the same 9 named in the brief.After this change, full
mvn -o test:Tests run: 1883, Failures: 7, Errors: 0, Skipped: 0— the 7 are exactlyFleetdCompletionResolverWiringTest(4),FleetdBackendQuarantineWiringTest,FleetdLeadRolloverWiringTest,FleetdLeadSeatWiringTest(B1's and B3's scope, untouched here).git status --porcelainis empty of mutation leftovers.Per ticket comment 17525: my second independent mutation on FleetdAssembly.java:518 survived — new FleetApp(memberHerdr, memberHerdr, ...) (dropping the LEAD client instead of the member one) left both existing FleetdAssemblyFleetAppTest cases green. That is the symmetric form of the CB-185 defect (/healthz green while the LEAD daemon is down), and the guard this PR deletes would have caught it: its positive assertion required the exact pair "new FleetApp(herdr, memberHerdr, workers,", which does not survive either daemon being dropped. Adds healthzGoesRedWhenTheLeadDaemonIsDownEvenThoughTheMemberIsUp, symmetric to the existing member-down case. Proven red today: reverting FleetdAssembly.java:518 to "new FleetApp(memberHerdr, memberHerdr, workers, ..." and running only FleetdAssemblyFleetAppTest gives Tests run: 3, Failures: 1 — the new case fails ("expected: <503> but was: <200>", body has no "member" key); the other two cases stay green. Reverted, git diff --stat empty, file touched, re-ran: Tests run: 3, Failures: 0. Full mvn -o test: Tests run: 1884, Failures: 7 (same 7 B1/B3-scope failures as before this fixup; 1884 = 1883 + 1 new case).