Skip to content

fix(install): local bundle installs record deployment receipts (#4223) - #4302

Merged
Daniel Meppiel (danielmeppiel) merged 9 commits into
mainfrom
danielmeppiel-4223-bundle-receipts
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 9 commits into
mainfrom
danielmeppiel-4223-bundle-receipts

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Local bundle installs (apm install <bundle>) wrote files with no local deployment receipt, and a bundle can't be rendered from a locked source. Under req-lk-024, lockfile-driven cleanup and skill path migration therefore kept stale bundle files instead of deleting them.

Slice 1 (this commit): the bundle handler records a receipt for every file it deployed, through the receipt owner (core/deployment_ledger.record_bundle_receipts). Dry runs record nothing.

Next slices: installed-CLI lifecycle tests (the agent_skills auto-migration pair and a bundle reinstall that drops a file), plus docs.

Issue and approved scope

Issue: Fixes #4223

Human scope-approval comment: #4223 was filed and assigned through the 0.37 Stream H lead (intake by the PM and steward).

Does this PR complete the issue, or what remains? It will, once the tests land.

Type of change

  • Bug fix

Testing

  • Static gates only so far (ruff). Lifecycle tests are next.

Changelog

  • To be added with the tests.

Spec conformance (OpenAPM v0.1)

  • N/A -- implements req-lk-024 evidence for an existing path.

A bundle file has no locked source to render, so a local receipt is its
only deletion evidence (req-lk-024). The bundle handler now records
receipts for every file it deployed through the receipt owner.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 20, 2026
#4223)

Installed-CLI lifecycle case: a packed bundle installed with
--legacy-skill-paths records receipts; installing the converged layout
removes the unedited legacy copy and its lock claim, and keeps an edited
one. Bug-ledger row and changelog line.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Receipt handling can expose pre-existing adopted user files to deletion and leaves incorrectly owned, unbound receipts that can block later bundle replacements.

2 open issues
What changed in this PR

This PR addresses #4223 by recording local bundle deployment receipts, giving lockfile-driven cleanup evidence to remove unchanged bundle files that cannot be re-rendered from locked sources.

Changes:

  • Adds receipt recording through the deployment ledger, excluding dry runs.
  • Adds lifecycle coverage for skill-path migration, including preservation of user-edited files.
  • Records the regression coverage and user-visible fix in the bug ledger and changelog.
File Description
tests/​integration/​test_local_bundle_hooks_lifecycle.py Tests bundle skill migration for unchanged and edited legacy copies.
tests/​fixtures/​lifecycle_bug_ledger.json Links #4223 to regression tests and ownership properties.
src/​apm_cli/​install/​local_bundle_handler.py Calls receipt recording after bundle deployment.
src/​apm_cli/​core/​deployment_ledger.py Adds the bundle receipt-recording helper.
CHANGELOG.md Documents receipt-backed cleanup of legacy skill copies.

Review effort: Balanced

Comment thread src/apm_cli/core/deployment_ledger.py Resolved
…e local-bundle claim (#4223)

Review fold: adopted identical hook scripts are no longer receipted (the
hook integrator's take_rendered_writes names real writes), receipts use
the canonical local-bundle owner, and they are recorded after the lock
holds the bundle claims so each binds to the committed claim signature.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ndle-receipts

# Conflicts:
#	CHANGELOG.md
#	tests/fixtures/lifecycle_bug_ledger.json
…ndle-receipts

# Conflicts:
#	CHANGELOG.md
#	tests/fixtures/lifecycle_bug_ledger.json
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
…itation (#4223)

record_bundle_receipts returns early with nothing written (a dry run
writes nothing), so the handler calls it unconditionally. The generator
citation follows DeploymentLedgerCodec's new line.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit bb61570 into main Nov 21, 2026
46 of 56 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-4223-bundle-receipts branch November 21, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local bundle installs record deployment receipts for the files they deploy

2 participants