Skip to content

feat(install)!: refuse forced uninstall data purge without a store receipt (AB7009) - #853

Merged
ScriptedAlchemy merged 6 commits into
mainfrom
decision/purge-requires-receipt
Sep 25, 2026
Merged

ScriptedAlchemy merged 6 commits into
mainfrom
decision/purge-requires-receipt

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Owner decision, following up the #841 review, which left the no-receipt purge as a separate product decision. agent-bundle uninstall claude|codex --force --purge-data --confirm-purge on a host-registered copy with no store receipt (forced-missing) used to delete the web-data root and Claude's plugins/data/<id>/ anyway. Now it is refused with AB7009 before any host verb runs, and --plan refuses the same way. --force without --purge-data still uninstalls through the host CLI and keeps the data. The refusal applies even when no data exists: it fails closed and is easy to predict. Without --confirm-purge, AB7008 still comes first.

  • packages/agent-bundle/src/install/uninstall.ts: the refusal is in the receipt === undefined branch of uninstallPublicCli.
  • Unaffected: a Cursor local copy without a receipt is already foreign (AB7007, even with --force), a Cursor marketplace holds no data, and Amp refuses without a receipt even with --force. The emitted standalone install.mjs only uninstalls Cursor copies and requires a receipt in local mode, so it has no no-receipt purge path. Only its generated Claude/Codex README text changed.
  • Docs: docs/diagnostics.md (managed-uninstall prose and the AB7009 row) and the en and zh versions of website/docs/*/reference/cli.mdx and website/docs/*/guide/distribution/installation.mdx.
  • Tests: uninstall.test.ts (Claude and Codex) asserts AB7009 for the forced purge and its plan, that only plugin list --json ran, and that the web-data and plugins/data files survive. It then runs a plain --force uninstall and checks the data is kept. The host-install proof (tests/support/host-install.ts, used by the integration and packed proofs) asserts AB7009 for --force --purge-data --confirm-purge without a receipt.
  • .changeset/refuse-unreceipted-purge.md (minor, agent-bundle).

Local gate

On b672f50, which contains current origin/main cf82ffe:

  • pnpm build: pass
  • pnpm typecheck: pass
  • pnpm lint: pass
  • pnpm test:unit: pass (4,324 tests, 0 failed)

On 9b216cb. The only change after it is the #844 merge from main, which touches src/rstest only and doesn't overlap the install code:

  • rstest --config rstest.integration.config.ts packages/agent-bundle/tests/host-install-proof.test.ts packages/agent-bundle/tests/dev-host-install.test.ts: pass (21 passed, 0 skipped)
  • pnpm test:packed packages/agent-bundle/tests/packed-host-install-proof.test.ts packages/agent-bundle/tests/packed-install-bin.test.ts: pass (8 passed, 0 skipped)
  • pnpm docs:site:build: pass (language parity OK, 0 broken links)

Review

Independent change-risk review (Claude Opus 5.5) found no material issues. It confirmed:

  • The refusal runs before any mutation, and plan mode matches the run.
  • No other uninstall path purges without a receipt: the dangling-marketplace path needs a receipt, Amp and Cursor already refuse, and the dev host-install manager never passes purgeData.

Two low notes:

  • The generated Codex README didn't mention the refusal. Fixed in be11d6b.
  • The refusal also fires when there is no data to delete. Kept on purpose: it fails closed, and the docs describe it as unconditional.

Codex bot threads:

  • P1, missing changeset: already added in 6795db8. Replied and resolved.
  • P2, docs should say --force --purge-data --confirm-purge, since the shorter form is AB7008: fixed in 9b216cb. Replied and resolved.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b672f50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Minor
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T04:17:01.917256Z 1b122a9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b122a9026

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/install/uninstall.ts
Comment thread website/docs/en/reference/cli.mdx Outdated
@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@853
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@853
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@853
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@853

commit: 9b216cb

@ScriptedAlchemy
ScriptedAlchemy merged commit 1a77058 into main Sep 25, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 25, 2026
@ScriptedAlchemy
ScriptedAlchemy deleted the decision/purge-requires-receipt branch September 25, 2026 20:20
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