Skip to content

test(lifecycle): re-install over unchanged apm.yml and lock still enforces moved gates - #4768

Merged
Daniel Meppiel (danielmeppiel) merged 6 commits into
mainfrom
ql-w1-perf-l5-cells
Nov 22, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 6 commits into
mainfrom
ql-w1-perf-l5-cells

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Two real-CLI lifecycle cells guard the planned install fast path (PERF L5: a no-op or --frozen short-circuit keyed on unchanged project files). Each runs a SECOND apm install whose apm.yml and apm.lock.yaml are 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:

  1. test_reinstall_enforces_changed_org_policy: p-exec's hook is approved and deployed under the allow org policy. Only the org policy behind the git remote then moves to exec-deny-all. The re-install must retire the hook and announce the deny, and apm audit --ci must fail.
  2. 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

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

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 and tests.quality.taxonomy --changed are 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

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…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]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 22, 2026
Copilot AI balanced review requested due to automatic review settings November 22, 2026 16:23

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.

🟢 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.yml and apm.lock.yaml remain 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

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

The denial assertion can pass solely on the always-visible policy banner, so it must check a package-specific hook denial message to detect a missing announcement.

1 open issue

Review effort: Balanced

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.

🟢 Approval recommended

No active review issues were identified for the added reinstall lifecycle regression tests.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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]>

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.

🟢 Approval recommended

There are no active review issues blocking the added re-install lifecycle regression tests.

No open issues 🎉

Review effort: Balanced

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.

🟢 Approval recommended

No active review issues block approval of the added regression coverage for external policy and approval changes during reinstall.

No open issues 🎉

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 940b273 into main Nov 22, 2026
87 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the ql-w1-perf-l5-cells branch November 22, 2026 22:53
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
…rain 6; regenerate

Takes main's #4768 credit keys for the MCP ownership-sibling rows and keeps W3b's dry-run inline credit. Ledger 2/4/2406 (#4759 fixed).

Co-authored-by: Copilot App <[email protected]>
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.

2 participants