feat: make managed Profile negotiation the default - #60
Merged
Conversation
Change Profile resolution from requiring an initialized local Profile to using a managed Profile by default. This improves CLI ergonomics: catalog, cart, checkout, and order commands work immediately while preserving exact release negotiation and explicit DIY Profiles for customization. Derive one managed rendering from every installed RELEASES entry. Discover the Business offer first, select the newest exact release shared by both sides, and advertise only that rendering's URL. Compatibility remains an exact release intersection; selected document, endpoint, and operation failures surface directly instead of triggering an implicit downgrade. Establish one runtime Profile contract: - managed Profiles expose all installed release renderings - DIY Profiles retain one exact authored document and release - Profile body and URL provenance resolve independently, so a URL override never replaces a named DIY Profile's capabilities or services - explicit missing, corrupt, or inconsistent selections fail closed rather than unexpectedly changing identity Keep Profile authoring intentional. `profile init` creates an exact DIY snapshot, activates it only with `--activate`, preserves owned URLs during forced regeneration when possible, and validates the complete runtime Profile before changing active state. Profile names resolve through per-call arguments, environment, persisted selection, then the managed default; Profile URL overrides follow their own precedence chain. Recognize untouched Profiles generated by earlier releases as named managed aliases. Preserve their names, active selection, defaults, headers, and historical files while adding classification metadata best-effort. Once metadata marks an alias managed, current runtime resolution no longer depends on its historical profile.json; edited, custom-hosted, and explicitly DIY Profiles remain authored snapshots. Keep MCP routing isolated from operator-global state by ignoring Profile and Business values in active.yaml while continuing to honor explicit tool arguments and environment variables. Partition persisted Business discovery by canonical full Profile URL and verify each cache envelope owns the requested URL. Read legacy origin-keyed entries only when the primary entry is absent or invalid, never when a valid primary entry merely expired. Continue to honor Business Cache-Control and the separate tools/list TTL. Make Profile commands and Doctor reflect the same effective runtime state. Expose the managed selection through list, show, and use --managed; keep inactive Profile scans read-only; audit every managed rendering with bounded parallel probes; and preserve authoritative recovery CTAs through Doctor output. Attach schema-error provenance so only operation-input failures recommend --input-schema. Align the README, agent skill, setup reference, and release notes with the new default while keeping DIY authoring, precedence, persistent headers, and release pinning in the advanced references. Keep version stability explicit rather than persisting hidden resource-to-rendering affinity or silently walking older releases. Workflows that must remain on one release can create a DIY pin before the resource and pass it explicitly on every subsequent operation. Validated with schema regeneration, typecheck, lint, 962 unit tests, and 33 compiled integration tests with one expected live test skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Profile resolution now defaults to a managed Profile. This improves CLI ergonomics: catalog, cart, checkout, and order commands work immediately while preserving exact UCP release negotiation and intentional DIY Profiles for customization.
The new Profile contract
Managed by default
DIY when requested
ucp profile initcreates a Profile pinned to one exact release and activates it only with--activate.profile.json, including when a Profile URL override is present.Existing Profiles remain safe
Untouched Profiles generated by earlier releases are recognized as named managed aliases. Their names, active selection, defaults, headers, and historical files remain intact; classification adds metadata best-effort without rewriting
profile.jsonorheaders.json.Edited, custom-hosted, and explicitly DIY Profiles remain authored snapshots. Once an untouched alias is marked managed, current runtime resolution no longer depends on its historical
profile.json.Consistent routing and diagnostics
active.yaml, while explicit tool arguments and environment variables continue to work.--input-schema.Deliberate boundaries
This does not add automatic release walking or hidden resource-to-rendering affinity. A workflow that must remain on one release can create a DIY pin before creating the resource and pass that Profile explicitly on later operations.
Documentation and release
The README and agent skill describe the ordinary shopping path without Profile setup. Intentional authoring, precedence, persistent headers, and release pinning live in the advanced setup and reference docs. The included changeset requests a minor release.
Validation
pnpm gen:schemas && git diff --exit-code src/core/generated/pnpm typecheckpnpm lintpnpm test— 962 passedpnpm test:integration— 33 passed, 1 expected live test skippedpnpm test:full— 995 passed, 1 expected live test skipped