Repository navigation
test(lifecycle): re-install over unchanged apm.yml and lock still enforces moved gates - #4768
Merged
Merged
Conversation
…nforces moved gates Two real-CLI cells for the no-op / --frozen install fast path: a second apm install with apm.yml and apm.lock.yaml byte-identical to the previous run must still (1) enforce an org policy tightened behind the git remote (the approved hook is retired, the deny is announced, audit --ci fails) and (2) retire a hook whose approval was withdrawn from the user approval store. Byte assertions on both files pin the precondition so a fast path keyed on them cannot skip enforcement. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 22, 2026 16:23
…ce it converges Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the added re-install lifecycle tests covering policy and approval changes.
No open issues 🎉
What changed in this PR
Adds real-CLI lifecycle regression tests to protect the planned install fast path from skipping policy and approval checks when project inputs are unchanged.
Changes:
- Covers hook retirement after an organization policy tightens or a user approval is removed.
- Asserts
apm.ymlandapm.lock.yamlremain byte-identical before re-installation. - Checks retirement messages and audit results before and after policy enforcement.
| File | Description |
|---|---|
tests/lifecycle/scenarios/test_reinstall_gates.py |
Adds two re-install scenarios covering external policy and approval changes. |
Review effort: Balanced
…s, not the policy banner Co-authored-by: Copilot App <[email protected]>
They are the L5 fast-path bar's evidence (a policy-only change and an out-of-band approval removal under byte-identical apm.yml and lock), so PR CI must run them, not only the main-only nightly. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 22, 2026
#4768 fixed #4759, so pair|SRC=inline-mcp|DEPLOYED=unowned is required (known 10 -> 9). known_cell_issue_states regenerated. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 22, 2026
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
Two real-CLI lifecycle cells guard the planned install fast path (PERF L5: a no-op or
--frozenshort-circuit keyed on unchanged project files). Each runs a SECONDapm installwhoseapm.ymlandapm.lock.yamlare byte-identical to the end of the previous run. The change lives outside the project files, so a fast path keyed on those two files must not skip it:test_reinstall_enforces_changed_org_policy: p-exec's hook is approved and deployed under thealloworg policy. Only the org policy behind the git remote then moves toexec-deny-all. The re-install must retire the hook and announce the deny, andapm audit --cimust fail.test_reinstall_retires_executable_after_out_of_band_approval_removal: p-exec is approved through the user approval store (apm approve --user, so the grant is never in apm.yml or the lock) and its hook deploys. The grant is then removed from the user config. The re-install must retire the hook and announce it.Both assert the input bytes are unchanged between runs, so a future fast path can't satisfy these cells by changing what it reads.
Standalone: it doesn't touch the obligations ledger.
Issue and approved scope
Issue: Refs (PERF L5 fast-path tracking issue; number pending from the Q&L lead)
Human scope-approval comment: requested by the Q&L lead for PERF L5 (regent/CEO priority); the link follows with the issue number.
Does not complete the PERF work; it only lands the guard cells first, so the fast path builds against them.
Type of change
Testing
CI and Integration (label
full-integration) are the run of record, per the lead; the host is saturated. Local:[email protected] check/format, the assertion-quality ratchet andtests.quality.taxonomy --changedare clean. If either cell fails on main, that is a product bug: it will be filed and the cell kept as a strict known cell.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regenerated