Skip to content

fix(cli): harden install lifecycle ownership - #491

Merged
Ducksss merged 2 commits into
devfrom
codex/fix-cli-lifecycle
Aug 17, 2026
Merged

Ducksss merged 2 commits into
devfrom
codex/fix-cli-lifecycle

Conversation

@Ducksss

@Ducksss Ducksss commented Aug 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • persist normalized install-time file hashes in state v3 and ship legacy baselines so diff and update compare against the version and file set that was actually installed
  • serialize mutating CLI commands with an in-process state queue and a cross-process project lock, including race-free stale-lock reclamation
  • make remove ownership-aware and fail closed for local edits, unknown legacy baselines, unrecorded leftovers, and unresolved shared ownership; keep destructive overrides explicit through --force
  • preserve shared files retired by one component while another still owns them, inherit existing owners' baselines instead of blessing consumer edits, and synchronize baselines after legitimate shared rewrites
  • preserve an in-progress catalog search atomically when the multi-component selection updates URL state
  • update lifecycle documentation, packaged assets, regression fixtures, generated blog diagrams, and Next.js agent guidance

Why

The previous lifecycle logic reconstructed the old side of a comparison from the current registry. That could hide source changes across releases and leave files removed by a newer manifest behind. Mutating commands could also race on the same project, while removal could delete files without proving that they were still registry-owned and unmodified.

A second review also found that a later component could adopt an edited shared file as its clean baseline, that an update could delete a retired file still owned by a sibling component, and that simultaneous stale-lock reclaimers could remove a newly acquired live lock. The catalog's URL synchronization could also lose an in-progress search when selection state was written first.

Together, those gaps risked lost local edits, stale installed source, corrupted install state, or non-shareable catalog state.

Impact

Existing v1/v2 state migrates in memory to v3. New successful installs snapshot normalized SHA-256 hashes for every shipped file. Known pre-v3 releases use packaged baselines; unknown or ambiguous ownership fails safely. Shared ownership remains consistent across installs and updates, concurrent mutations are rejected or serialized, and idempotent removal behavior is preserved.

Validation

  • pnpm test:release using pinned pnpm 10.24.0 and Bun 1.3.14
    • lint, formatting, source build, TypeScript, registry validation, and production build passed
    • 536 integration tests passed, 1 skipped
    • 483 Playwright tests passed
    • 492 pages built
  • pnpm test:pack
  • git diff --check

@vercel

vercel Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
payload-components Ready Ready Preview Aug 17, 2026 6:40pm
payload-components-97bf Ready Ready Preview Aug 17, 2026 6:40pm

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 260bda76-9b4d-4374-9370-0515ae6ff2c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ducksss
Ducksss marked this pull request as ready for review August 17, 2026 18:13
Copilot AI lite review requested due to automatic review settings August 17, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch was successfully deployed

2 active deployments
Preview – payload-components-97bf — 055690eb Deployed Aug 17, 2026 by vercel[bot]
Preview – payload-components — 055690eb Deployed Aug 17, 2026 by vercel[bot]
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.

2 participants