CB-632 unit 3: rename the example config file and prefer fleetd.yaml at startup #146

Closed
agent wants to merge 0 commits from worker/cb-632-config-retry-8e0efa-7 into main
Member

Ticket CB-632 unit 3 (gitea fleet/fleetd#145).

  • git mv bridged.example.yaml -> fleetd.example.yaml (the bridged/ directory itself is untouched; the jar stays bridged.jar via finalName).
  • Fleetd.main: with no argument it now prefers fleetd.yaml in the working directory and falls back to bridged.yaml when the new name does not exist. The chosen file is logged at INFO. An explicit argument is used exactly as given, with no fallback. The selection logic was extracted into a package-private static method Fleetd.chooseDefaultConfigFile(Path dir) so it is testable without starting the daemon.
  • New test FleetdDefaultConfigFileTest covers all three cases: only fleetd.yaml -> fleetd.yaml, only bridged.yaml -> bridged.yaml, both present -> fleetd.yaml wins.
  • Text references to bridged.example.yaml updated to fleetd.example.yaml (FleetConfigTest, FleetConfig javadoc/comments, Fleetd startup message, .gitignore comment). FleetConfigTest loads the file by path, so those two tests had to move with the rename.

Both config names still work; BRIDGED_* env vars, bridge_* MCP tool names, CLAUDE.md, wiki/, deploy/, scripts/ and README.md were not touched.

Build: cd bridged && mvn clean install — BUILD SUCCESS. Surefire XML totals: 52 test classes, Tests run: 881, Failures: 0, Errors: 0, Skipped: 0 (baseline 51 classes / 878 tests + 3 new).

Ticket CB-632 unit 3 (gitea fleet/fleetd#145). - git mv bridged.example.yaml -> fleetd.example.yaml (the bridged/ directory itself is untouched; the jar stays bridged.jar via finalName). - Fleetd.main: with no argument it now prefers fleetd.yaml in the working directory and falls back to bridged.yaml when the new name does not exist. The chosen file is logged at INFO. An explicit argument is used exactly as given, with no fallback. The selection logic was extracted into a package-private static method Fleetd.chooseDefaultConfigFile(Path dir) so it is testable without starting the daemon. - New test FleetdDefaultConfigFileTest covers all three cases: only fleetd.yaml -> fleetd.yaml, only bridged.yaml -> bridged.yaml, both present -> fleetd.yaml wins. - Text references to bridged.example.yaml updated to fleetd.example.yaml (FleetConfigTest, FleetConfig javadoc/comments, Fleetd startup message, .gitignore comment). FleetConfigTest loads the file by path, so those two tests had to move with the rename. Both config names still work; BRIDGED_* env vars, bridge_* MCP tool names, CLAUDE.md, wiki/, deploy/, scripts/ and README.md were not touched. Build: cd bridged && mvn clean install — BUILD SUCCESS. Surefire XML totals: 52 test classes, Tests run: 881, Failures: 0, Errors: 0, Skipped: 0 (baseline 51 classes / 878 tests + 3 new).
agent added 6 commits 2026-08-23 06:53:19 +02:00
Part of #145 (CB-632), under epic #125.

The product is called fleet and the daemon is called fleetd, but the code
still said bridge everywhere. This renames the Java half:

  package dev.ltms.bridged -> dev.ltms.fleet
  Bridged        -> Fleetd          (the main class)
  BridgedConfig  -> FleetConfig
  BridgeMcp      -> FleetMcp
  BridgedApp     -> FleetApp
  BridgedMetrics -> FleetMetrics

The package root is dev.ltms.fleet, not dev.ltms.fleetd. The trailing d
means daemon, which names a process, not a namespace.

What this commit deliberately does NOT change:

  - The module directory stays bridged/, and <finalName> stays bridged.
    The installed launchd plist names bridged/target/bridged.jar and its
    KeepAlive is armed, so renaming the jar on its own strands a restart.
    Both change at the cutover, together with the plist, in one step.
  - The bridge_* MCP tool aliases. CB-622 shipped both names on purpose.
    One test names a local variable viaBridge because it holds the result
    of the deprecated call; the rename collided with it and the compiler
    caught it. That variable is back.
  - BRIDGED_* env var names, and bridged.yaml. Both are operator
    contracts and need a read-both shim, which is a later unit.

Two things a plain search-and-replace would have missed:

  - logback.xml and logback-test.xml name the package twice, once as a
    turboFilter class= attribute. The compiler never checks those.
  - BSD sed does not support \b. The word-boundary expression matched
    nothing and said nothing, while the other ten in the same command
    worked. Checked the leftovers instead of trusting the exit code.

Verified: mvn clean install green, 51 test classes, 878 tests, 0 failures
-- the same count as before the rename.
mcp/BridgeMcp is now mcp/FleetMcp. This line is in the project addendum,
not the canonical block, so the wiki template is untouched -- the sync
check still returns True.

Part of #145.
Part of #145 (CB-632). Documentation only, plus one internal literal.

Unit 1 renamed the package and classes, which left every doc describing
classes that no longer exist. This fixes the prose across README.md,
docs/ and bridged/docs/ -- 18 files.

Renamed: dev.ltms.bridged -> dev.ltms.fleet, the five class names, and
"bridged" where it names the daemon as a product rather than a path.

Also renamed two literals, because a doc that disagrees with the code is
worse than one that is out of date:

  - bridged-local-noauth -> fleetd-local-noauth. A placeholder apiKey
    OpenCodeLauncher sends when a profile resolves no token, to a local
    endpoint that does not check it. No test asserts the old string.
  - the vnd.ltms.bridged.* media type in the M4 design doc. It appears
    in no Java file, so nothing implements it yet.

Deliberately NOT renamed, because each is still literally true today and
changes only at the cutover:

  - paths: bridged/, bridged.yaml, bridged.example.yaml, bridged.jar,
    .bridged-worktrees, deploy/dev.ltms.bridged.plist,
    scripts/redeploy-bridged.sh, bridged-launchd-wrapper.sh
  - bridged_* metric names -- renaming these after the monitoring is
    wired would break dashboard continuity, so they move before it is
  - bridge_* MCP tool names, which answer alongside fleet_* on purpose
  - BRIDGED_* environment variables, read by a file outside this repo

Method note: perl, not sed. BSD sed has no \b and no lookaround, and a
word-boundary expression there fails silently. The prose replace uses
(?<![\w./-])bridged(?![\w./-]) so it cannot touch a path or an
identifier, then every remaining hit was read by hand.

Verified: mvn clean install green, 51 classes, 878 tests, 0 failures.
CB-632 unit 3: point text references at fleetd.example.yaml
CI / contract (pull_request) Successful in 1m17s
CI / build (pull_request) Successful in 1m36s
6e7fc12f89
Owner

Merged to main at e38eac1 (fast-forward; 6e7fc12 is an ancestor of main). Closing the PR because the commits already landed.

I verified the work myself before merging, and re-ran the build from a clean tree rather than trusting the report: cd bridged && mvn clean install, then read target/surefire-reports/*.xml directly — 53 test classes, 884 tests, 0 failures, 0 errors, 0 skipped. The extra class over the PR's 52/881 is my own MetricNamesTest, which was committed after this branch was cut.

Two gaps I fixed on top, in e38eac1:

  1. bridged/.gitignore still ignored only bridged.yaml. The PR updated the comment above it to say "copy from fleetd.example.yaml", so an operator who follows that comment ends up with a live fleetd.yaml holding tokens that git offers to commit. Both names are ignored now, because Fleetd.chooseDefaultConfigFile accepts both until the cutover. The PR flagged the file as still ignoring the old name only — thanks, that was the right call to report rather than fix out of scope.
  2. Three design docs still pointed at bridged.example.yaml, a file that no longer exists under that name: docs/CB-301-ext-Worktree-Provisioning.md, docs/CB-402-OpenCode-Adapter.md, docs/M4-Fleet-Health.md.

The rest reads clean. chooseDefaultConfigFile is the right seam — it is testable without starting the daemon, and the three cases cover all of it because an explicit argument never goes through it.

Merged to `main` at `e38eac1` (fast-forward; `6e7fc12` is an ancestor of `main`). Closing the PR because the commits already landed. I verified the work myself before merging, and re-ran the build from a clean tree rather than trusting the report: `cd bridged && mvn clean install`, then read `target/surefire-reports/*.xml` directly — **53 test classes, 884 tests, 0 failures, 0 errors, 0 skipped**. The extra class over the PR's 52/881 is my own `MetricNamesTest`, which was committed after this branch was cut. Two gaps I fixed on top, in `e38eac1`: 1. **`bridged/.gitignore` still ignored only `bridged.yaml`.** The PR updated the comment above it to say "copy from `fleetd.example.yaml`", so an operator who follows that comment ends up with a live `fleetd.yaml` holding tokens that git offers to commit. Both names are ignored now, because `Fleetd.chooseDefaultConfigFile` accepts both until the cutover. The PR flagged the file as still ignoring the old name only — thanks, that was the right call to report rather than fix out of scope. 2. **Three design docs still pointed at `bridged.example.yaml`**, a file that no longer exists under that name: `docs/CB-301-ext-Worktree-Provisioning.md`, `docs/CB-402-OpenCode-Adapter.md`, `docs/M4-Fleet-Health.md`. The rest reads clean. `chooseDefaultConfigFile` is the right seam — it is testable without starting the daemon, and the three cases cover all of it because an explicit argument never goes through it.
ltms closed this pull request 2026-08-23 07:01:04 +02:00
Some checks are pending
CI / contract (pull_request) Successful in 1m17s
CI / build (pull_request) Successful in 1m36s

Pull request closed

Sign in to join this conversation.