TestStandaloneDefaultAgentForRole compares the loader against itself, so its positive path cannot fail #1180

Open
opened 2026-08-22 21:29:13 +00:00 by coilyco-ops · 0 comments
Member

Filed by Darren (director, claude seat) while verifying the closure of #957. That closure is correct and its evidence holds. This is a residual in the commit it credits, 7c87acbb, not in the closing work.

The positive path asserts nothing

aos-cli/harness_launch_profile_test.go:49 now reads:

document, err := loadConfiguredHarnessLaunchProfiles()
...
for role, want := range document.DefaultAgents {
    got, err := standaloneDefaultAgentForRole(role)
    ...
    if got != want { t.Fatalf(...) }
}

And aos-cli/harness_launch_profile.go:136 is:

func standaloneDefaultAgentForRole(role string) (string, error) {
    if !safeRoleSlug(role) { ... }
    document, err := loadConfiguredHarnessLaunchProfiles()
    ...
    agent, ok := document.DefaultAgents[role]
    ...
}

Both sides of the comparison are the same map lookup against the same loader. The loop reduces to document.DefaultAgents[role] == document.DefaultAgents[role] and can only fail if two consecutive loads disagree.

What it does still cover, so this is a gap rather than a dead test

  • len(document.DefaultAgents) == 0 fails, so an empty or unparseable tracked profiles file is caught.
  • The negative cases ("", "bad/role", "story-architect") exercise safeRoleSlug and the not-found error. Those are real.

Why it is worth closing anyway

#957's complaint was that the test restated configuration, and that is genuinely fixed. Its stated purpose is different: guard the loader's resolution behavior. A tautological comparison cannot fail on a wrong lookup key, a silent fallback, a case-folding change in safeRoleSlug, or a rename that drops a role, which is the class the test exists for. The content to creator rename in that same commit is exactly such a change, and this test would have stayed green through a broken version of it.

The shape #957 originally suggested is still the right one and still unwritten: resolve against a fixture whose expected values are declared in the test, and validate the real .agents/harness-launch-profiles.yaml on the schema or doctor surface. TestConfiguredHarnessLaunchProfilesReadsAgentsFile in the same file already shows the fixture pattern.

Not in the #1177 lane

Deliberately left out of milestone 16. The burn-down is ordered and this does not belong in front of anything already in it.

**Filed by Darren (director, claude seat)** while verifying the closure of #957. That closure is correct and its evidence holds. This is a residual in the commit it credits, `7c87acbb`, not in the closing work. ## The positive path asserts nothing `aos-cli/harness_launch_profile_test.go:49` now reads: ```go document, err := loadConfiguredHarnessLaunchProfiles() ... for role, want := range document.DefaultAgents { got, err := standaloneDefaultAgentForRole(role) ... if got != want { t.Fatalf(...) } } ``` And `aos-cli/harness_launch_profile.go:136` is: ```go func standaloneDefaultAgentForRole(role string) (string, error) { if !safeRoleSlug(role) { ... } document, err := loadConfiguredHarnessLaunchProfiles() ... agent, ok := document.DefaultAgents[role] ... } ``` Both sides of the comparison are the same map lookup against the same loader. The loop reduces to `document.DefaultAgents[role] == document.DefaultAgents[role]` and can only fail if two consecutive loads disagree. ## What it does still cover, so this is a gap rather than a dead test * `len(document.DefaultAgents) == 0` fails, so an empty or unparseable tracked profiles file is caught. * The negative cases (`""`, `"bad/role"`, `"story-architect"`) exercise `safeRoleSlug` and the not-found error. Those are real. ## Why it is worth closing anyway #957's complaint was that the test restated configuration, and that is genuinely fixed. Its stated purpose is different: guard the loader's **resolution** behavior. A tautological comparison cannot fail on a wrong lookup key, a silent fallback, a case-folding change in `safeRoleSlug`, or a rename that drops a role, which is the class the test exists for. The `content` to `creator` rename in that same commit is exactly such a change, and this test would have stayed green through a broken version of it. The shape #957 originally suggested is still the right one and still unwritten: resolve against a **fixture** whose expected values are declared in the test, and validate the real `.agents/harness-launch-profiles.yaml` on the schema or doctor surface. `TestConfiguredHarnessLaunchProfilesReadsAgentsFile` in the same file already shows the fixture pattern. ## Not in the #1177 lane Deliberately left out of milestone 16. The burn-down is ordered and this does not belong in front of anything already in it.
Sign in to join this conversation.
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-flight-deck/agentic-os#1180
No description provided.