Skip to content

fix: make state purge receipt-owned - #647

Merged
ScriptedAlchemy merged 9 commits into
mainfrom
fix/state-root-ownership
Sep 5, 2026
Merged

fix: make state purge receipt-owned#647
ScriptedAlchemy merged 9 commits into
mainfrom
fix/state-root-ownership

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • separate per-server runtime state locations from receipt records and deletion ownership
  • record derived roots as owned by construction; mark only explicit roots created by this installation
  • retain shared, pre-existing, foreign-marker, canonical-drifted, and unproven roots with reasons
  • carry ownership through keep-data remnants and report per-server ownership in Doctor
  • mirror ownership, rollback, old-receipt, and marker-only behavior in generated install.mjs
  • consume MCP documents through the authoritative artifact-manifest projection from current main

Closes #644
Related: #592
Follow-up to #642

Validation

  • pnpm build
  • pnpm typecheck
  • pnpm lint
  • pnpm test:unit — 4,235 passed, 6 skipped (4,241 total)
  • focused install/uninstall/Doctor/generated-installer Rstest — 162 passed
  • pnpm docs:site:build — locale parity, diagnostic coverage, site build, and link checks passed

Deslop

Deslop: GPT-5.6 Sol, 0 edits after the final full-diff pass.

Self-review

Reviewer: Claude Fable 5.1 Thinking High.

Initial passes found no merge blockers. Fixed every actionable finding: marker-only roots uninstall cleanly; keep-data plan/apply receipt output matches; non-writable declared roots record unproven without failing install; partial marker acquisition rolls back; byte-identical remnant reinstalls refresh receipts; reader/writer server-name handling matches; generated uninstall honors old stateRoot receipts; Doctor checks every effective root for legacy overlap; and EN/ZH installation guides state receipt-proven deletion.

After merging current main, conflicts in state-root.ts, receipt.ts, and doctor.ts were resolved by preserving main authoritative artifact-manifest lookup and layering multi-server ownership on it. Fixture tests now write authoritative manifests. Full gates and 162 focused tests passed on the merged base. The final review found no Critical findings and marked the branch safe for auto-merge. Its marker-literal hygiene warning was fixed by centralizing stateOwnershipMarkerFile in core/types.ts; the same reviewer confirmed exact HEAD 622a7ca13a has no cycle, generated-source change, or behavior regression.

Dispositions for remaining non-blocking notes:

  • Existing declared roots retained after receipt upgrade: intentional fail-closed behavior required by Make state purge receipt-owned and server-aware #644 and documented; users delete historical unproven overrides manually.
  • Derived receipt hardening: deferred; deletion still requires a real directory, no symlink, and canonical-path equality under the existing user-level receipt trust model.
  • Strict future receipt parsing: retained as the repository existing fail-closed reader policy.
  • Concurrent marker-creation reason label, generated in-tree state/ duplicate reporting, and public remnant Doctor wording: cosmetic, no deletion difference; deferred.
  • Concurrent writes during marker-only cleanup: non-recursive rmdir fails closed; no recursive deletion or data loss.
  • Cross-receipt shared-root scanning: intentionally not added; Option A assigns ownership to the installation identity that created the marker, while later installations record the marker as foreign.
  • Previous-version derived-state orphaning: pre-existing upgrade behavior outside Make state purge receipt-owned and server-aware #644.

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 622a7ca

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

This PR includes changesets to release 1 package
Name Type
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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2026

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

commit: 622a7ca

@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/state-root-ownership branch from 5df94a6 to d6391d3 Compare September 5, 2026 20:22
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.

Make state purge receipt-owned and server-aware

1 participant