fix(config): decide the instance name on the definition's identity #708

Closed
coilyco-ops wants to merge 1 commit from fix/instance-name-reads-identity into main
Member

The guard landed in #703 compared the definition's filename against Echo's. Deep's content in a file named sirens-echo.yaml was therefore accepted and handed Echo's service name.

That is issue 702's own defect one level up: inferring a service's identity from something that is not its identity. LoadConfig calls LoadDefinition before resolving the name, so Identity was already in hand and a proxy for it was used instead.

Filed by another Angie seat that built #702 in parallel, found #703 had merged, and probed the landed version rather than arguing for its own. Its four acceptance rows are the test.

Why the filename was there, and what is kept

#703's reasoning was right about the trap it avoided — deploy names the definition absolutely and the tests relatively, and both are the same definition. Identity avoids that trap too, and without depending on a naming convention. The new rows keep the path cases and add a definition read from /tmp/fixture-1234/definition.yaml, which the filename comparison would have refused.

Verification

ward exec gate PASS on all six steps.

Mutation, the fourth acceptance row: reverting the comparison to filepath.Base fails TestAForeignDefinitionCannotWearEchosFilename, TestEchosDefinitionIsRecognisedByAnyPathAndName, and TestAnUnnamedDefinitionIsNotEcho, in a run where the package compiles.

One row is not from the issue and is the one I would most want reviewed: TestTheShippedDefinitionCarriesEchosIdentity loads agent/sirens-echo.yaml and asserts it declares Sirens Echo. Without it every other row compares a constant against a fixture I wrote, and the guard could pass its whole suite while not matching the definition that actually ships.

closes #706

The guard landed in [#703](https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/pulls/703) compared the definition's **filename** against Echo's. Deep's content in a file named `sirens-echo.yaml` was therefore accepted and handed Echo's service name. That is [issue 702](https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/702)'s own defect one level up: inferring a service's identity from something that is not its identity. `LoadConfig` calls `LoadDefinition` before resolving the name, so `Identity` was already in hand and a proxy for it was used instead. Filed by another Angie seat that built #702 in parallel, found #703 had merged, and probed the landed version rather than arguing for its own. Its four acceptance rows are the test. ## Why the filename was there, and what is kept #703's reasoning was right about the trap it avoided — deploy names the definition absolutely and the tests relatively, and both are the same definition. Identity avoids that trap too, and without depending on a naming convention. The new rows keep the path cases and add a definition read from `/tmp/fixture-1234/definition.yaml`, which the filename comparison would have refused. ## Verification `ward exec gate` PASS on all six steps. Mutation, the fourth acceptance row: reverting the comparison to `filepath.Base` fails `TestAForeignDefinitionCannotWearEchosFilename`, `TestEchosDefinitionIsRecognisedByAnyPathAndName`, and `TestAnUnnamedDefinitionIsNotEcho`, in a run where the package compiles. One row is not from the issue and is the one I would most want reviewed: `TestTheShippedDefinitionCarriesEchosIdentity` loads `agent/sirens-echo.yaml` and asserts it declares `Sirens Echo`. Without it every other row compares a constant against a fixture I wrote, and the guard could pass its whole suite while not matching the definition that actually ships. closes #706
fix(config): decide the instance name on the definition's identity
All checks were successful
ci / image-build (pull_request) Successful in 23s
ci / test (pull_request) Successful in 36s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
d90cde1e2b
The guard compared the definition's filename against Echo's. Deep's content in
a file named sirens-echo.yaml was therefore handed Echo's service name, which
is the defect 702 was about one level up: inferring a service's identity from
something that is not its identity.

LoadConfig loads the definition before resolving the name, so Identity was
already in hand and a proxy for it was being used. Filed and measured by
another seat that probed the landed version rather than arguing for its own.

Verified against that issue's four acceptance rows, including the mutation:
reverting the comparison to the filename fails three tests in a run where the
package compiles.

closes #706

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
coilyco-ops closed this pull request 2026-08-13 20:16:10 +00:00
All checks were successful
ci / image-build (pull_request) Successful in 23s
ci / test (pull_request) Successful in 36s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!708
No description provided.