Repository navigation
fix(install): persist the local-bundle pending record only on commit - #4505
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits intoNov 20, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits into
Daniel Meppiel (danielmeppiel) merged 3 commits into
Conversation
The parked-executables record for apm approve --pending was written right after the approval key was computed, before policy preflight, the integrity check and deployment, so a failed bundle install left apm_modules/.local-bundle-pending.json behind. Stage it as a PendingRecordStage and commit it with the bundle lockfile write (or at the success point when nothing is locked). Fixes #4492 apm-spec-waiver: local bundle pending-record write timing only; no normative requirement change Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 20:33
Co-authored-by: Copilot App <[email protected]>
Collaborator
Author
|
Red on the parent, from guarded local runs (
Green with the fix at |
…mmit Keep #4490's record shape (key plus declared types, approve by recorded key); add #4505's commit-only persistence as BundleRecordStage. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
merged commit Nov 20, 2026
b41929f
into
train/0.37-final-2
3 checks passed
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-bundle-pending-commit
branch
November 20, 2026 21:31
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…4485, #4294, #4315, #4505 Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
apm install <bundle>wrote the parked-executables record (apm_modules/.local-bundle-pending.json, read byapm approve --pending) as soon as it had computed the approval key. That happened before policy preflight, the bundle integrity check and deployment, so a failed bundle install left the record behind. The lifecycle integrity cellsbundle-files|bundle-install|lock-edited / missing-hashfailed I7 on this ("failed install changed durable files").Fix:
_stage_parked_bundle_executablesnow returns aPendingRecordStage. The handler commits it together with the bundle's lockfile write, which is the bundle install's commit point, or at the success point when the install records no lockfile. A failed install never commits, so it writes nothing new. Approval semantics and the bundle format are unchanged.Before: a failed
apm install <tampered bundle>leftapm_modules/.local-bundle-pending.json.After: a failed install leaves the project byte-identical; a successful install still records the parked executables, and
apm approve --pendinglists them.Issue and approved scope
Issue: Fixes #4492
Human scope-approval comment: apm-scope:v1 record by Daniel Meppiel (@danielmeppiel) on #4492.
Does this PR complete the issue, or what remains? It completes the approved scope. Out of scope: approval semantics and the bundle format.
Type of change
Testing
Local runs used
files/local-test.sh(-n 2), with apm 0.37.0 (32990f2):pytest tests/integration/test_local_bundle_hooks_lifecycle.py::test_approve_pending_lists_parked_bundle_executablesassert not True: the pending record exists after the failed install)pytest -n 2on the 10test_integrity.py::test_integrity_row[I|*|bundle-install|*]cells (bundle-files, approval-pins, path-containment, policy-hash-pin)pytest -n 2 tests/unit/commands/test_approve_deny.py tests/unit/install/test_install_local_bundle.pypytest tests/quality/test_lifecycle_bug_ledger.pyuvx [email protected] check/format --checkon touched files;scripts/check_complexity_ratchet.py --base-ref origin/train/0.37-final-2;lint-architecture-boundaries.shSpec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regeneratedapm-spec-waiver:line.)