# Knowledge retrieval contract

Retrieval uses progressive disclosure:

1. **Catalog search** — IDs, types, tags, authority, provenance, and compact descriptions.
2. **Metadata selection** — hashes, recommended agents, project scope, sensitivity, and token estimate.
3. **Content materialization** — full content only for entries that survive policy, scope, relevance, and budget checks.

The same source ID is materialized at most once per context manifest. Text hashes use UTF-8 with line endings normalized to LF so catalog verification is stable across supported operating systems. Mandatory K0/K2 content is budgeted before optional K1/K3/K4 content. K3/K4 requires an exact project binding, and K4 remains quote-only evidence. A missing catalog entry, hash mismatch, or unresolved mandatory source fails closed without returning a partial manifest.

`discoveryOnly` means that no bounded query profile consumes the entry. It does not remove an explicit legacy agent-card file dependency from packaging; that dependency remains installed until the card migrates to catalog retrieval.
