From 6e7fc12f89e7b4efbc371c688388fa5e3ef55afd Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Sun, 23 Aug 2026 06:51:48 +0200 Subject: [PATCH] CB-632 unit 3: point text references at fleetd.example.yaml --- bridged/.gitignore | 2 +- .../dev/ltms/fleet/config/FleetConfig.java | 6 +++--- .../dev/ltms/fleet/config/FleetConfigTest.java | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bridged/.gitignore b/bridged/.gitignore index db3a322..8fbfc48 100644 --- a/bridged/.gitignore +++ b/bridged/.gitignore @@ -2,7 +2,7 @@ target/ dependency-reduced-pom.xml -# Local runtime config (copy from bridged.example.yaml) +# Local runtime config (copy from fleetd.example.yaml) bridged.yaml # CB-505 audit trail + daemon stdout/stderr — runtime records, never source diff --git a/bridged/src/main/java/dev/ltms/fleet/config/FleetConfig.java b/bridged/src/main/java/dev/ltms/fleet/config/FleetConfig.java index b0b939d..66641c6 100644 --- a/bridged/src/main/java/dev/ltms/fleet/config/FleetConfig.java +++ b/bridged/src/main/java/dev/ltms/fleet/config/FleetConfig.java @@ -26,7 +26,7 @@ import java.util.Set; /** * {@code bridged} configuration, loaded from a YAML file (see - * {@code bridged.example.yaml}). Unknown keys are ignored so config can grow ahead + * {@code fleetd.example.yaml}). Unknown keys are ignored so config can grow ahead * of the code — but an unknown top-level key is logged as a WARN at load (CB-530), because * silently dropping a whole block is indistinguishable from honouring it. * @@ -1037,7 +1037,7 @@ public record FleetConfig( * {@link #warnUnknownTopLevelKeys}. Keep in step with the record components. * *

Package-private (not {@code private}) so a test can assert every key here is documented in - * {@code bridged.example.yaml} — the only committed description of the config schema, since + * {@code fleetd.example.yaml} — the only committed description of the config schema, since * {@code bridged.yaml} itself is gitignored. */ static final Set KNOWN_TOP_LEVEL_KEYS = Set.of( @@ -1601,7 +1601,7 @@ public record FleetConfig( // guard/lifecycle, an absent block is not a safe "feature off" default here, it is a gap. It // is deliberately not pre-populated with a Java-side name list (that would just reintroduce // the hardcoded-list defect this record replaces); the block must be configured in - // bridged.yaml to protect anything. See bridged.example.yaml's memberCredentials: comment. + // bridged.yaml to protect anything. See fleetd.example.yaml's memberCredentials: comment. MemberCredentials mc = memberCredentials != null ? memberCredentials : new MemberCredentials(null, List.of(), List.of()); return new FleetConfig(b, herdrSocket, profiles, g, worktreeRoot, l, timeout, pollMs, diff --git a/bridged/src/test/java/dev/ltms/fleet/config/FleetConfigTest.java b/bridged/src/test/java/dev/ltms/fleet/config/FleetConfigTest.java index 3d84e3e..f7ff0b4 100644 --- a/bridged/src/test/java/dev/ltms/fleet/config/FleetConfigTest.java +++ b/bridged/src/test/java/dev/ltms/fleet/config/FleetConfigTest.java @@ -1135,15 +1135,15 @@ class FleetConfigTest { } /** - * The shipped {@code bridged.example.yaml} must actually parse. Config binds through a plain + * The shipped {@code fleetd.example.yaml} must actually parse. Config binds through a plain * Jackson mapper with {@code ignoreUnknown = true}, so a misspelled key in the example is * silently dropped and the operator gets a default they did not ask for — exactly how a * {@code spawn_ready_timeout_ms} typo survived in the example until the CB-5xx wrap-up. */ @Test void shippedExampleConfigParses() { - Path example = Path.of("bridged.example.yaml"); - assertTrue(Files.exists(example), "bridged.example.yaml must ship next to the pom"); + Path example = Path.of("fleetd.example.yaml"); + assertTrue(Files.exists(example), "fleetd.example.yaml must ship next to the pom"); FleetConfig cfg = FleetConfig.load(example); assertEquals(8765, cfg.bind().port(), "example binds the documented default port"); @@ -1155,7 +1155,7 @@ class FleetConfigTest { /** * Every optional knob the example documents must bind under the exact spelling used there. - * Keep this list in step with {@code bridged.example.yaml}: a rename that updates the record + * Keep this list in step with {@code fleetd.example.yaml}: a rename that updates the record * but not the example (or vice versa) fails here instead of silently no-op'ing in production. */ @Test @@ -1239,7 +1239,7 @@ class FleetConfigTest { /** * A top-level key {@code FleetConfig} reads but that appears nowhere in - * {@code bridged.example.yaml} — live or commented — is invisible drift: {@code bridged.yaml} + * {@code fleetd.example.yaml} — live or commented — is invisible drift: {@code bridged.yaml} * is gitignored, so the example is the ONLY committed description of the config schema, and * neither {@link #shippedExampleConfigParses} (example → code: does the example still parse) * nor {@link #everyOptionalKnobDocumentedInTheExampleBinds} (a hand-maintained list of keys @@ -1251,8 +1251,8 @@ class FleetConfigTest { */ @Test void everyKnownTopLevelKeyIsDocumentedInTheExample() throws Exception { - Path example = Path.of("bridged.example.yaml"); - assertTrue(Files.exists(example), "bridged.example.yaml must ship next to the pom"); + Path example = Path.of("fleetd.example.yaml"); + assertTrue(Files.exists(example), "fleetd.example.yaml must ship next to the pom"); String text = Files.readString(example); List undocumented = FleetConfig.KNOWN_TOP_LEVEL_KEYS.stream() @@ -1261,14 +1261,14 @@ class FleetConfigTest { .toList(); assertTrue(undocumented.isEmpty(), () -> "key(s) " + undocumented - + " are read by FleetConfig but appear nowhere in bridged.example.yaml — " + + " are read by FleetConfig but appear nowhere in fleetd.example.yaml — " + "document each one there, commented out if optional. bridged.yaml is " + "gitignored, so this file is the only committed description of the config " + "schema an operator or a worker can see."); } /** - * Most of {@code bridged.example.yaml} is deliberately commented out — optional sections are + * Most of {@code fleetd.example.yaml} is deliberately commented out — optional sections are * documented as commented blocks so the shipped file stays a working minimal config. A key * documented ONLY as a comment must still count as documented; parsing the file as YAML and * reading its live key set (as an earlier attempt at this guard did) gets this wrong, because