Repository navigation
Policy and manifest parse owner: vendor keys, pin verification, hash prefix - #4259
Merged
Daniel Meppiel (danielmeppiel) merged 17 commits intoNov 20, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 17 commits into
Daniel Meppiel (danielmeppiel) merged 17 commits into
Conversation
…ner (#4084) Register policy/outcome_routing.py as the policy-outcome-routing owner with a closed outcome set. audit --ci, approve, update and MCP admission take the routed decision instead of local outcome lists; an outcome outside the set blocks. Adds the install-deployment-policy-outcome-routing guard and an installed-CLI parity test across every outcome. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Trust and integrity consistency hardening (#4079): - apm audit --ci drift replay reads org policy through the trust-reader outcome owner (resolve_trust_policy / route_discovery_outcome), so a policy outcome that stops install also stops the replay (req-pl-010). - The lifecycle script policy gate suppresses scripts, with a warning, when org policy cannot be resolved, including inheritance chain errors (req-pl-003, req-pl-010). - Guards: install-deployment-trust-policy-outcome covers the audit replay reader; new contracts-tooling-lifecycle-policy-errors guard with its mutation case. - Regression tests on the installed CLI and a lifecycle bug ledger row. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…tcomes Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Type-check every policy field before membership, hashing or iteration; load_policy turns any remaining shape error into a validation error so it routes as malformed. Adds the install-deployment-policy-field-types guard. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…4084, #4140) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…the type Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
apm-spec-waiver: owner consolidation; existing req-pl-003 and req-pl-010 policy outcome semantics now applied by every policy reader, no new normative behaviour Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…eported policy Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
marked this pull request as ready for review
November 20, 2026 11:46
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 11:46
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Blocking policy decisions can leave approval-store changes behind after rejection and still allow MCP server admission, undermining policy enforcement.
2 open issues
What changed in this PR
This draft carries the policy-outcome consolidation from #4151 as groundwork for the planned manifest and cached-policy hardening. The reviewed changes centralize policy decisions across commands and improve handling of malformed policy fields.
Changes:
- Introduces a shared routing decision for all 11 policy-discovery outcomes.
- Routes policy readers through that owner and suppresses lifecycle scripts on unexpected policy errors.
- Adds lifecycle regressions, architecture guards, mutation coverage, and documentation.
| File | Description |
|---|---|
tests/unit/test_audit_policy_command.py |
Updates fixtures to use explicit discovery outcomes. |
tests/unit/scripts/test_architecture_runner.py |
Registers new guards in the expected inventory. |
tests/unit/policy/test_parser.py |
Updates expected type-validation diagnostics. |
tests/unit/copilot_plugins/test_pr2705_folds.py |
Uses a typed absent-policy result. |
tests/unit/commands/test_approve_deny.py |
Tests routed warnings and blocking approvals. |
tests/quality/complexity_baseline.json |
Removes the parser's complexity exemption. |
tests/integration/test_trust_integrity_consistency_lifecycle.py |
Adds audit replay and script-suppression regressions. |
tests/integration/test_policy_outcome_routing_lifecycle.py |
Adds installed-CLI outcome parity and malformed-field tests. |
tests/integration/test_architecture_owner_rule_mutations.py |
Adds mutations for routing and parser guards. |
tests/fixtures/lifecycle_bug_ledger.json |
Records policy-routing regression coverage. |
src/apm_cli/security/trust.py |
Uses shared policy classification for MCP admission. |
src/apm_cli/policy/parser.py |
Centralizes field-type validation and wraps construction errors. |
src/apm_cli/policy/outcome_routing.py |
Defines the closed outcome set and shared routing decisions. |
src/apm_cli/policy/install_preflight.py |
Updates routing-owner terminology in a comment. |
src/apm_cli/policy/discovery.py |
Documents outcomes and classifies plaintext URL rejection. |
src/apm_cli/install/phases/policy_gate.py |
Updates comments to reference the routing owner. |
src/apm_cli/core/lifecycle_scripts.py |
Suppresses scripts after unexpected policy errors. |
src/apm_cli/commands/update.py |
Uses shared classification for executable reconciliation. |
src/apm_cli/commands/policy.py |
Handles blocking outcomes in policy explanations. |
src/apm_cli/commands/audit.py |
Routes CI checks and drift replay through shared decisions. |
src/apm_cli/commands/approve.py |
Uses routed policy loading and reports blocks. |
scripts/architecture_linter/checks/install_trust_integrity.py |
Updates permitted discovery callers and trust readers. |
scripts/architecture_linter/checks/install_policy_plugin_and_approval.py |
Requires approval to use the routing helper. |
scripts/architecture_linter/checks/install_policy_outcome_routing.py |
Adds outcome-routing and field-type guards. |
scripts/architecture_linter/checks/install_deployment_analyzers.py |
Registers the new policy guards. |
scripts/architecture_linter/checks/contracts_lifecycle_script_gate.py |
Guards script suppression on policy errors. |
packages/apm-guide/.apm/skills/apm-usage/governance.md |
Documents outcome handling and malformed fields. |
docs/src/content/docs/reference/cli/policy.md |
Lists all discovery outcomes. |
docs/src/content/docs/reference/cli/lifecycle.md |
Expands policy-related script suppression notes. |
docs/src/content/docs/reference/cli/approve.md |
Documents blocking policy outcomes. |
CHANGELOG.md |
Records routing and parser fixes from #4151. |
.apm/architecture/owners/install-deployment.json |
Expands policy-routing ownership and guard references. |
.apm/architecture/owners/contracts-tooling.json |
Links lifecycle ownership to the policy-error guard. |
Review effort: Balanced
| A blocking outcome raises :class:`PolicyViolationError`; an outcome that | ||
| leaves no usable policy is reported and yields an empty policy. | ||
| """ | ||
| policy = resolve_trust_policy(project_root, logger=logger) |
Comment on lines
+315
to
+317
| policy = route.policy | ||
| if policy is None and (route.blocks or route.unresolved): | ||
| admission.policy_unavailable = route.outcome |
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-h-a-policy-parse-followup
branch
November 20, 2026 12:02
This was referenced Nov 20, 2026
Closed
5 of 10 tasks
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
H-A follow-up to #4151 (depends on #4151; this branch carries #4151's commits until it lands, then merges main). Manifest and policy parse-owner fixes, part of the 0.37 trust and integrity consistency hardening:
registries.<name>key validation: a mistyped key is rejected and anx-vendor key is accepted, under both manifest contracts.Work in progress (draft).
Issue and approved scope
Fixes #4286 -- scope record: #4286 (comment)
Fixes #4252 -- scope record: #4252 (comment)
Fixes #4218 -- scope record: #4218 (comment)
Type of change
Testing
Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)