Composition checked authProfileId against the module-global installed
registry, the V3 executor used its injected registry, and the V2 client
resolved against the raw REST_AUTH_PROFILES record (or an injected raw
record) that was never installed. A BEARER_HEADER profile with
`credentials: "same-origin"` is refused by installation but resolved
fine.
- resolveRestSecurityProfiles / validateRestProfileBindings take
`RestAuthProfileSource` (installed registry or raw record) and default
to INSTALLED_REST_AUTH_PROFILES. A raw record is installed (validated)
before lookup; lookups go through the registry, and the CSRF record
lookup uses Object.hasOwn.
- composeContractContributions takes the registry as an optional
second parameter (default INSTALLED_REST_AUTH_PROFILES).
- src/adapters/http/client.ts: only the V2 resolve call site (and its
import) now falls back to INSTALLED_REST_AUTH_PROFILES.
Verified: 3 new cases in tests/unit/rest-profile-contract.test.ts were
RED before (incoherent raw record accepted, installed registry not
resolvable, composition ignored the given registry); gates green except
the known removal-fixture test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>