Skip to content

bug: LoadAndResolve silently skips policy resolution when no catalogs loaded #199

Description

@yvonnedevlinrh

Description

internal/pipeline/pipeline.go contains a vestigial guard that silently skips policy resolution when policies exist but no catalogs or guidance were loaded:

for id, policy := range loaded.Policies {
    if len(loaded.Catalogs) > 0 || len(loaded.Guidance) > 0 {
        rp, err := requirement.ResolvePolicy(*policy, loaded)
        ...
    }
}

This results in LoadResult.Resolved being an empty map even though policies were loaded. The function's doc comment promises it "resolves all policies against the merged set" — an unconditional statement.

Context

This guard was carried forward verbatim from internal/mcp/server.go during the domain extraction in #176. It is a pre-existing behavior, not a regression.
requirement.ResolvePolicy handles this case correctly on its own — it returns a clear error when a policy has unresolvable imports, or a valid empty ResolvedPolicy when the policy has no imports. The guard suppresses this useful error reporting.

Expected behavior

LoadAndResolve should attempt resolution for all policies and let ResolvePolicy handle error cases. The guard should be removed.

Notes

This is a behavior change and should not be combined with the refactoring PR (#176) per Principle III (Incremental Improvement).

Metadata

Metadata

Labels

bugSomething isn't workingllm_assistedIssue triaged or authored with LLM assistance

Type

Fields

Priority

High

Effort

Low

Projects

Status
Done ✔️

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions