Skip to content

fix: load edited 0.4.2-0.7.0 Profiles - #63

Merged
igrigorik merged 1 commit into
mainfrom
fix/legacy-profile-upgrade-recovery
Sep 13, 2026
Merged

fix: load edited 0.4.2-0.7.0 Profiles#63
igrigorik merged 1 commit into
mainfrom
fix/legacy-profile-upgrade-recovery

Conversation

@igrigorik

Copy link
Copy Markdown
Contributor

Why

ucp-cli 0.4.2 through 0.7.0 generated a 2026-04-08 Profile whose dev.ucp.shopping entry still declared 2026-01-23. Untouched copies become managed aliases during the 0.9 upgrade, but edited copies correctly remain DIY and therefore reached strict snapshot validation, which rejected them before dispatch.

This is a follow-up to #60: the CLI should absorb the exact representation it generated without discarding a user's custom capabilities, scoped headers, Profile name, hosted URL, or release pin.

What changed

  • Recognize only the exact dev.ucp.shopping value generated by ucp-cli 0.4.2–0.7.0 under a 2026-04-08 Profile.
  • Normalize that entry to 2026-04-08 in a copy when materializing a local DIY Profile; source files remain byte-identical.
  • Preserve the named DIY singleton, custom capabilities, Profile-scoped headers, active Business, and hosted URL.
  • Keep loadAgentProfile and live hosted reads strict, so Doctor still reports malformed bytes that an independent Business may reject.
  • Leave every near miss and additional dev.ucp.* mismatch on the existing fail-closed path.
  • Make generic mismatch guidance inspect the selected Profile safely and distinguish user-controlled URLs from Shopify release-default URLs.

Upgrade behavior

Stored Profile 0.9 behavior
Untouched Profile generated by 0.4.2–0.7.0 Becomes a named managed alias with every installed rendering
Edited Profile containing the exact generated entry Remains DIY and pinned to 2026-04-08; normalized only in memory
Any altered entry or additional dev.ucp.* mismatch Fails with AGENT_PROFILE_VERSION_MISMATCH
Raw malformed document at a custom hosted URL Local materialization succeeds, but Doctor reports strict hosted validation failure

Deliberate boundaries

This does not rewrite profile.json, headers.json, or hosted documents; switch the Profile to managed; tolerate arbitrary mixed versions; or hide hosted-document failures. A local adapter cannot guarantee that an independent Business will accept malformed bytes served at the advertised URL.

Validation

  • pnpm gen:schemas && git diff --exit-code src/core/generated/
  • pnpm typecheck
  • pnpm lint
  • pnpm test — 973 passed
  • pnpm test:integration — 34 passed, 1 expected live test skipped
  • Commit hook — 973 unit tests passed
  • Two independent seam verifiers returned SHIP; five targeted mutations were killed

ucp-cli 0.4.2 through 0.7.0 generated 2026-04-08 Profiles with
the shopping service entry still set to 2026-01-23. Edited copies
remain DIY, so strict snapshot validation rejected them before dispatch.

Normalize only that exact generated entry when materializing a DIY
Profile. Preserve custom capabilities, scoped headers, URL, active name,
and source bytes while leaving near misses and additional dev.ucp.*
mismatches on the strict validation path.

Keep hosted Profile reads strict so Doctor still reports bytes that an
independent Business may reject. Make generic mismatch guidance name the
selected Profile and distinguish user-owned URLs from Shopify release
defaults.
@igrigorik
igrigorik merged commit 659abbd into main Sep 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant