Skip to content

test(lifecycle): key every strict security cell to an open issue - #4461

Merged
Daniel Meppiel (danielmeppiel) merged 714 commits into
mainfrom
danielmeppiel-s-pending-rekey
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 714 commits into
mainfrom
danielmeppiel-s-pending-rekey

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Test-only. Every strict expected-failure reason in the lifecycle security tables and the spec conformance suite now names the open issue that tracks its defect, instead of an issue-less placeholder. No cell is relaxed, skipped or removed, and witnesses and CONFORMANCE are regenerated.

Cells Issue
dry-run preview of gate removal (bin, hook, lsp, mcp) #4454
dry-run preview of policy outcome #4455
update after a definition change (hook) #4444
update on a policy-denied dependency (hook, lsp, mcp) #4445
uninstall rebuild on gated surfaces (hook, mcp, native) #4446
offline use of cached policy #4456
org policy for user-scope installs (hook, mcp) #4457
update and install exit agreement under policy #4458
bundle reinstall retires a hook whose approval no longer matches #4216
policy cache content verified against the pin #4218
update restores the recorded marketplace provenance #4228
spec req-sc-005 host-class scope #4324
spec req-sc-006 default contract #4286

Issue and approved scope

Issue: Refs #4092

Human scope-approval comment: release hygiene requested by the 0.37 release PM and steward.

Does this PR complete the issue, or what remains? Hygiene only; each issue above tracks its own fix.

Type of change

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

Testing

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

python -m tests.lifecycle.witnesses --write tests/lifecycle/security tests/lifecycle/journeys/test_journeys.py: 924 required, 167 known failing. CONFORMANCE regenerated. Ruff clean.

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.

…--ci, install, --frozen and update

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

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
…le lacks deletion evidence (#3701)

Co-authored-by: Copilot App <[email protected]>
…dius slice, lazy CLI imports, linter cache, shard file lists, mutation floors, receipts gate)

Co-authored-by: Copilot App <[email protected]>
The output oracle's known cells for #4241, #4249, #4267, #4196 and #4243
no longer fail, and the strict #4257 xfail on the p-lsp git cells passes:
the defects are fixed on this branch.

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

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

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
…ns; name every credential tried

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

# Conflicts:
#	src/apm_cli/core/auth.py
#	src/apm_cli/marketplace/version_pins.py
#	tests/fixtures/lifecycle_bug_ledger.json
…oject and user scope

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…er match without a local receipt; cleanup retains files the install kept

Co-authored-by: Copilot App <[email protected]>
The pre-download frozen MCP check stays silent (the hydrated check and the
MCP phase report parked servers); the commit gate does not repeat the org
policy discovery notice. An install refuses a symlinked lockfile only
when it adds or removes a dependency or updates refs, so an unchanged
install still reads through it.

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]>
Register update's provenance re-verification write as a commit site of the
lockfile write authority, and name the install-writes-lockfile decision in
one helper the preflight guard reads.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…touched (#4318)

apm update refreshes apm.yml dependencies only. With a local bundle
installed it now names the bundle (from its hook ownership markers and
compile staging slugs, else its file count) and gives the runnable next
step: apm install <newer-bundle-file>. The lifecycle generator's strict
cell rule|U8|update-leaves-a-local-bundle-untouched becomes required.

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

`apm install --frozen --global` now checks each locked native plugin root
against its recorded fingerprint in the frozen hash verification, before any
write. A mismatch exits 1 naming the plugin, the expected and observed
digests and `apm install --global`, as `apm audit --ci` reports it; nothing
is written. A plain install that restores a changed root prints a [!] line.

The lifecycle I1 oracle treats a path under a native_plugin root as recorded
only when the same lock records that root, the observation is user scope and
the tree carries the record's fingerprint. Four gate cells become required;
six org-policy cells stay strict under #3703.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…; strict known cell for step 5

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…n, not a fixed column count (#4409)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…er match without a local receipt; cleanup retains files the install kept

Co-authored-by: Copilot App <[email protected]>
…--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]>
A parked local bundle's record (#4221) lives under apm_modules/; prune now
reads a directory without packages as empty. The needle for the bundle
approval-key guard follows the key's helper, and the strict cells for
#4169 and #4214 are removed now that both hold.

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
generated_obligations.json drifted when journey known cells were dropped
without --write. Regenerate it and add a test that runs the witnesses
check, so a stale file fails CI.

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

# Conflicts:
#	src/apm_cli/install/service.py
#	tests/fixtures/lifecycle_bug_ledger.json
…robe cannot read the config (#4390)

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

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
At user scope the install gate discovers org policy from APM_HOME, never
from the HOME repository's remote (#4087). The frozen stale-decision check
and the retired-hook naming discovered from the deploy root (HOME), so a
HOME remote's org-deny made --frozen refuse a hook the gate still deployed
(GATE user spine). Both now discover from manifest_root, as the gate does.
E01 step 4's check count follows exec-status-current.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…; one row re-keyed to #4443

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

# Conflicts:
#	tests/quality/generated_obligations.json
… on a terminal and honors NO_COLOR

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

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
#	tests/utils/lifecycle_evidence.py
…fusals as [x] errors

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

# Conflicts:
#	src/apm_cli/commands/update.py
#	tests/lifecycle/generator/rules.py
…acts module

tests/quality/test_generated_obligations.py is not in any CI job's file
list; test_promise_obligations.py runs in Architecture Ratchet Contracts.

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

# Conflicts:
#	tests/lifecycle/machines/test_m_source.py
#	tests/lifecycle/security/gate_slices/bin.py
Replaces the remaining issue-less strict reasons with the open issue that
tracks each defect. No cell is relaxed, skipped or removed.

Co-authored-by: Copilot App <[email protected]>
…ble next step

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

# Conflicts:
#	tests/quality/generated_obligations.json
Copilot AI balanced review requested due to automatic review settings November 20, 2026 18:25
…nt promise ids

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

# Conflicts:
#	tests/quality/generated_obligations.json

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

Security-test xfails are tied to closed or mismatched issues, and some assertions conflict with documented policy behavior.

5 open issues
What changed in this PR

This test-only maintenance PR replaces placeholder expected-failure reasons with tracking issue references, making known security failures easier to trace across APM’s lifecycle and spec-conformance tests.

Changes:

  • Adds issue references to gate, policy, integrity, provenance and spec-conformance failures.
  • Removes obsolete placeholder helpers and updates reason-format comments.
  • Refreshes generated lifecycle obligation mappings and journey witnesses.
File Description
tests/​spec_conformance/​test_security_behavior_reqs.py Adds trackers for host-class and registry-contract failures.
tests/​quality/​generated_obligations.json Refreshes tracked failures and required journey witnesses.
tests/​lifecycle/​security/​test_policy_outcomes.py Keys cached-policy, dry-run and update failures to issues.
tests/​lifecycle/​security/​test_origin_and_credentials.py Links provenance failure to #4228 and removes placeholder helpers.
tests/​lifecycle/​security/​test_integrity.py Links bundle and policy-pin failures to issues.
tests/​lifecycle/​security/​gate_slices/​native.py Adds an uninstall-rebuild issue reference.
tests/​lifecycle/​security/​gate_slices/​mcp.py Keys MCP gate failures to tracking issues.
tests/​lifecycle/​security/​gate_slices/​lsp.py Adds dry-run and policy-denial trackers.
tests/​lifecycle/​security/​gate_slices/​hook.py Keys hook gate failures to tracking issues.
tests/​lifecycle/​security/​gate_slices/​bin.py Links dry-run removal failure to #4454.
tests/​lifecycle/​security/​gate_slices/​__init__.py Updates the documented gate failure-reason format.
tests/​lifecycle/​security/​egress_slices/​__init__.py Updates the documented egress failure-reason format.

Review effort: Balanced

Comment on lines +19 to +21
_UPDATE_REDEFINED = "#4444 update and install agreement on gated surfaces after a definition change"
_UPDATE_DEP_DENY = "#4445 update and install agreement on a policy-denied dependency"
_UNINSTALL_SIBLING = "#4446 uninstall rebuild agreement on gated surfaces"
_DENY_BY_SPEC = "#4189 deny by install spec and installed identity"
_XFAIL["G|marketplace-install|local-deny|hook"] = _DENY_BY_SPEC
_USER_ORG = "S-pending (neutral issue to follow): org policy for user-scope installs"
_USER_ORG = "#4457 org policy for user-scope installs"
_UNINSTALL_SIBLING = (
"S-pending (neutral issue to follow): uninstall rebuild agreement on gated surfaces"
)
_UNINSTALL_SIBLING = "#4446 uninstall rebuild agreement on gated surfaces"
_SHORTCIRCUIT = (
"S-pending (neutral issue to follow): update and install exit agreement under policy"
)
_SHORTCIRCUIT = "#4458 update and install exit agreement under policy"

@pytest.mark.req("req-sc-005")
@pytest.mark.xfail(strict=True, reason="S-pending")
@pytest.mark.xfail(strict=True, reason="#4324 opt-in strict host-class credential scope")
…ng-rekey

# Conflicts:
#	tests/lifecycle/security/gate_slices/bin.py
#	tests/lifecycle/security/gate_slices/hook.py
#	tests/lifecycle/security/gate_slices/mcp.py
#	tests/lifecycle/security/gate_slices/native.py
#	tests/quality/generated_obligations.json
#	tests/spec_conformance/test_security_behavior_reqs.py
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit e057a62 into main Nov 21, 2026
3 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-s-pending-rekey 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.

2 participants