Skip to content

fix(install): policy-blocked install names a runnable next step - #4418

Merged
Daniel Meppiel (danielmeppiel) merged 678 commits into
mainfrom
danielmeppiel-frozen-policy-next-step
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 678 commits into
mainfrom
danielmeppiel-frozen-policy-next-step

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

When org policy denies a dependency, apm install --frozen ended with:

[x] Install blocked by org policy -- see violations above

The line gave no next step. It now reads:

[x] Install blocked by org policy -- see violations above. Remove or replace the blocked dependencies in apm.yml (run 'apm policy status' to see the active policy), then re-run the install.
File Change
src/apm_cli/install/phases/policy_gate.py The policy gate's PolicyViolationError message appends the runnable next step. The prefix is unchanged, so existing troubleshooting anchors still match.
docs/src/content/docs/troubleshooting/common-errors.md, troubleshooting/index.md Quote the new line.
tests/lifecycle/security/gate_slices/native.py, tests/quality/generated_obligations.json The native gate rows leave the #4154 marks (Refs #4154). The 17 rows that pass on this head become required witnesses. The 8 that still fail are keyed to open issues, one per exact failure (list below). _NOT_APPROVABLE and the issue-less _UNINSTALL_SIBLING reason are removed. _PLUGIN_UNLOCKED and the `G

Failing before (I3: "install --frozen exited 1 without a remediation"), passing after:

  • G|audit-ci|policy-dep-deny|hook, G|audit-ci|policy-dep-deny|lsp, G|audit-ci|policy-dep-deny|mcp
  • G|audit-ci|policy-dep-deny|native.

Native rows now required (pass on head 5b9c304): G|{install,frozen,audit-ci}|{definition-changed,local-deny,org-deny,policy-dep-deny,revoke-approval}|native (except G|audit-ci|definition-changed|native), plus G|update|{local-deny,org-deny,revoke-approval}|native.

Native rows still failing, re-keyed (from runs on heads 5b9c304 and 0d87573; the train-2 merge kept them unchanged):

audit --ci and install --frozen already agreed on the verdict; only the next step was missing.

No owner id touched.

Issue and approved scope

Fixes #4404
Refs #4154

Human scope-approval comment: posted on #4404 by the PM.

Does this PR complete the issue? Yes.

Type of change

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

Testing

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

Verification (own venv):

  • pytest tests/lifecycle/security/test_gate_removal.py -k "audit-ci and policy-dep-deny" (APM_E2E_TESTS=1): 4 passed. On main: 3 failed and 1 xfailed.
  • pytest tests/lifecycle/security/test_gate_removal.py -k "native and not native-plugin": 21 passed, 9 xfailed.
  • python -m tests.lifecycle.witnesses: the native rows match. Remaining drift is pre-existing journey (J|...) entries on main and is not part of this PR.
  • pytest tests/unit -k "policy_gate or policy and install": 297 passed.
  • pytest tests/quality/test_lifecycle_bug_ledger.py tests/quality/test_promise_obligations.py tests/quality/test_gate_cell_obligations.py: 34 passed.
  • python -m tests.lifecycle.generator --check: up to date.
  • Lint mirror (ruff check, format --check, pylint R0801, lint-auth-signals): green.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

Co-authored-by: Copilot [email protected]

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	scripts/architecture_linter/checks/install_trust_integrity.py
#	src/apm_cli/install/services.py
#	tests/fixtures/lifecycle_bug_ledger.json
… so --skill '*' reaches APM

Co-authored-by: Copilot App <[email protected]>
… later (req-lk-002)

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	src/apm_cli/deps/lockfile.py
#	tests/fixtures/lifecycle_bug_ledger.json
When apm deny or org policy tightening changes the executables gate's
decision for a locked package, install --frozen and audit --ci now exit 1
naming the package with its recorded and current status and the repair.
Both route through the exec_gate staleness owner apm update uses
(stale_exec_decisions; lock_exec_decisions_stale delegates to it), and
never re-derive trust. Covers merged-config targets (claude settings.json)
where no recorded file goes missing. Frozen never writes the lock; deny
still wins. The frozen guard requires the owner, with mutation cases.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	src/apm_cli/deps/lockfile.py
#	tests/fixtures/lifecycle_bug_ledger.json
Install reference (frozen mode), baseline-checks reference
(exec-status-current), and the deny retirement note.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
A dependency denied by org policy ended apm install --frozen with
"Install blocked by org policy -- see violations above" and no next
step. The refusal now says to remove or replace the blocked dependencies
in apm.yml, points at apm policy status, and says to re-run the install.
The troubleshooting pages quote the new line. The native audit-ci
policy-dep-deny gate row, whose last failure was this missing step, loses
its strict #4154 mark.

Fixes #4404

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
A nested copy staged before its parent no longer occupies the parent's
backup path; both staging orders roll back byte for byte.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Five Ev() citations in tests/lifecycle/generator/rules.py pointed at lines that moved (three already stale on main, two shifted by train merges); obligations regenerated with python -m tests.lifecycle.generator.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 20, 2026
Copilot AI balanced review requested due to automatic review settings November 20, 2026 16:38
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
…ozen-verified-copy-4389

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ential tried (#4322)

- A requested package that validation rejects withdraws the ref pins it
  staged, so a partly successful install records pins only for the
  plugins it installs (extends #4194).
- AuthResolver records each secondary credential source sent (gh auth
  token, git credential helper, ADO chain steps) and the not-found
  diagnostic names every source tried, in order, never values (extends
  #4174).

Item 3 (cleanup scan cost) landed in #4284 (66032cf).

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	src/apm_cli/install/local_bundle_handler.py
#	src/apm_cli/integration/mcp_integrator_install.py
#	tests/fixtures/lifecycle_bug_ledger.json
#	tests/lifecycle/generator/rules.py
#	tests/quality/lifecycle_obligations.json
#	tests/unit/core/test_auth_phase3.py
…ead of re-recording it

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
… cell

Each user-scope negative cell now runs a project-scope install from the
same HOME checkout, which the published policy blocks, so the negatives
cannot pass vacuously. An installed-CLI cell asserts the user manifest's
pre-install script runs once with no project script reported as skipped.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
…ries keys validated under both contracts

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
cli.py defined its lazy _check_and_notify_updates wrapper, so tests that
patch apm_cli.cli._check_and_notify_updates patched an owner they import
(AQ004). The wrapper now lives in apm_cli/update_notice.py; cli.py imports
it under the same name, so the patch target and startup budget are kept.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
#	tests/lifecycle/scenarios/test_concurrency.py
…dius slice, lazy CLI imports, linter cache, shard file lists, mutation floors, receipts gate)

Co-authored-by: Copilot App <[email protected]>
… probe, not owner patches (#4407)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The row cited an issue-less pending reason; it fails the same I4 as the
other uninstall-rebuild native rows, tracked by #4446.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
… so --skill '*' reaches APM

Co-authored-by: Copilot App <[email protected]>
…names unhashed rows

Under require_hashes both readers refuse and name the row; by default both
accept it alike. The dependency-content-hashes audit check names the rows.

apm-spec-waiver: aligns which local package copy install, --frozen, update and audit --ci read; req-lk-015 refusal and diagnostic unchanged

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…rity-4356' into danielmeppiel-frozen-verified-copy-4389
… against its pin before use

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	scripts/architecture_linter/checks/install_deployment_analyzers.py
#	tests/fixtures/lifecycle_bug_ledger.json
…--ci, install, --frozen and update

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/integration/test_trust_integrity_consistency_lifecycle.py
…pies that match the lock

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	src/apm_cli/commands/install.py
#	src/apm_cli/install/phases/resolve.py
#	tests/fixtures/lifecycle_bug_ledger.json
#	tests/lifecycle/generator/rules.py
#	tests/quality/lifecycle_obligations.json
#	tests/utils/lifecycle_evidence.py
native.py keeps every strict cell still failing on the merged tree: the
re-keyed #4444/#4445/#4446/#4447 rows and the train #3703 native-plugin
rows; the #4154 and #4225 cells whose fixes are in are dropped (35 native
rows: 23 pass, 12 strict xfail).

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Comment thread src/apm_cli/policy/discovery.py Dismissed
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
…ent owner now covers

Required now: G|update|definition-changed|hook, G|update|policy-dep-deny|{hook,lsp,mcp},
G|uninstall-prune-rebuild|definition-changed|mcp and
G|uninstall-prune-rebuild|org-enables-gate|native. Verified with --runxfail on
#4418 merged with this branch; the update and uninstall rows fail there without it.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit a5dd98f into main Nov 21, 2026
36 of 49 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-frozen-policy-next-step 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apm install --frozen blocked by org policy gives no next step

3 participants