Skip to content

test(lifecycle): fix main's T3 lifecycle reds (user-scope lock park, E01 golden, #4353/#4356 cells) - #4361

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-t3-main-red-fix
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-t3-main-red-fix

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Fixes the lifecycle reds on main from the T3 tables. Each change follows the steward's rulings.

  1. Concurrency (harness fix, not a regression). User-scope install still takes the lifecycle lock: src/apm_cli/commands/install.py:1479 passes acquire_lock=not dry_run and install/transaction.py:105 calls acquire_lifecycle_lock() for every scope. The harness parked the holder on policy discovery's git remote get-url. core/scope.py policy_discovery_uses_git_remote() now returns False for a user-scope root, so at -g the holder never parked. The barrier is now deterministic: with the engine driver, a one-shot sitecustomize wraps locking.acquire_lifecycle_lock, and the first holder parks right after it acquires the lock until the test writes a release file. The binary driver keeps the git park.
  2. Integrity I|git-content_hash|install|lock-edited (and frozen lock-edited, install/frozen disk-or-cache). Install correctly fails closed but leaves fetched bytes in apm_modules. These are strict cells on new issue apm install leaves fetched bytes in apm_modules when it fails closed on a content hash mismatch #4353.
  3. Integrity I|git-content_hash|audit-ci|disk-or-cache. audit --ci re-verifies from the locked source and exits 0, while install --frozen refuses the same edited cached copy. This is a strict cell on new issue audit --ci passes an edited cached package copy that install --frozen refuses #4356 (I3 parity).
  4. I|git-content_hash|audit-ci|lock-edited now passes (Trust and integrity consistency: audit --ci and install --frozen agree on locked content hashes #4271), so its pending xfail is dropped and it is a required witness.
  5. E01 golden journey. audit --ci prints the new passing hook-approval-pins check (Trust and integrity consistency: install --frozen and audit --ci agree on executable approvals #4272), so 12 checks become 13. I regenerated the golden; the diff is only that row and the count:
--- golden/E01/03.txt
+++ recorded/E01/03.txt
@@ -15,6 +15,7 @@
 | [+]      | config-consistency       | No MCP configs to check                                     |
 | [+]      | content-integrity        | No critical hidden Unicode or hash drift detected           |
 | [+]      | local-bundle-hooks       | Local bundle hooks are approved                             |
+| [+]      | hook-approval-pins       | Deployed hooks match their approval pins                    |
 | [+]      | includes-consent         | No local content deployed -- includes consent check skipped |
 | [!]      | dependency-allowlist     | 1 dependency(ies) not in allow list (enforcement: warn)     |
 | [+]      | drift                    | no drift detected against lockfile                          |
@@ -23,7 +24,7 @@
   dependency-allowlist details:
     - github.com/github/awesome-copilot/skills/review-and-refactor: not in allowed sources
 
-12 check(s) passed; 1 reports violations under 'enforcement: warn' and fail once the policy switches to block.
+13 check(s) passed; 1 reports violations under 'enforcement: warn' and fail once the policy switches to block.

With step 3 fixed, E01 step 4 (audit --ci -o apm.sarif, exit 1) reached the family oracle. I7 no longer counts the report file a command was asked to write (-o/--output) as state a failure changed. Step 4's existing #4224 defect ("exits 1 without an error line") also gets its I7 cell, next to its O5 cell.

Issue and approved scope

Issue: Refs #4107 (security tables), Refs #4110 (journeys), Refs #4106 (concurrency)

Human scope-approval comment: steward rulings relayed by the 0.37 Stream T lead (golden regeneration approved on the diff above; strict cell on #4353).

Does this PR complete the issue, or what remains? It is partial. Some non-smoke integrity rows on main remain red in the same classes and are being triaged separately.

Type of change

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

Testing

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

Results (local, off main 84060d7):

  • E01, all concurrency rows and the git-content_hash integrity rows: 25 passed, 1 xfailed, then 0 failures after the cells.
  • tests/quality/test_generated_obligations.py: 19 passed. The witness registry is regenerated (922 required, 106 known failing).
  • test_lifecycle_driver, test_journey_index and test_test_taxonomy: 55 passed.
  • The ruff check / format mirror is 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.

…r hook-approval-pins; strict cells #4353 #4356

Co-authored-by: copilot-swe-agent[bot] <[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 15:03
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 90a1f10 into main Nov 20, 2026
2 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-t3-main-red-fix branch November 20, 2026 15:07

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

Unresolved critical issues break binary concurrency synchronization, disable the hermetic network guard, and cause false lifecycle-oracle failures and a documentation expectation mismatch.

5 open issues
What changed in this PR

This PR repairs lifecycle test infrastructure and expectations after recent integrity and audit changes, without changing production behavior.

Changes:

  • Adds an engine-driver lock barrier for concurrency tests.
  • Tracks known integrity failures under #4353 and #4356, while restoring the fixed lock-edit audit case as a required witness.
  • Refreshes E01 audit expectations and adjusts I7 to exclude explicitly requested reports.
File Description
tests/​quality/​generated_obligations.json Updates required witnesses and tracked failing cells.
tests/​lifecycle/​security/​test_integrity.py Revises integrity expectations and strict expected failures.
tests/​lifecycle/​scenarios/​test_concurrency.py Adds lock-acquisition parking for the engine driver.
tests/​lifecycle/​oracles.py Excludes requested report files from failure-state checks.
tests/​lifecycle/​journeys/​goldens/​E01/​03.txt Adds the hook-approval check and updates the passing count.
tests/​lifecycle/​journeys/​enterprise/​E01-org-policy-rollout.yaml Updates audit output expectations and tracks the missing failure diagnostic.

Review effort: Balanced

- "| [!] | dependency-allowlist | 1 dependency(ies) not in allow list (enforcement: warn) |"
- "..."
- "12 check(s) passed; 1 reports violations under 'enforcement: warn' and fail once the policy switches to block."
- "13 check(s) passed; 1 reports violations under 'enforcement: warn' and fail once the policy switches to block."
for path in _changed_paths(before.artifacts, after.artifacts)
if path.split(":", 1)[1].rsplit("/", 1)[-1] not in {"apm.yml", "apm.lock.yaml"}
and not any(_bookkeeping(path.split(":", 1)[1], prefix) for prefix in _FAILURE_BOOKKEEPING)
and path.split(":", 1)[1] != report
self.ready = self.dir / "ready"
self.release = self.dir / "release"
self.started = self.dir / "contender-started"
park_in_git = driver.selected_driver() == "binary"
Comment on lines +174 to +175
world.env["PYTHONPATH"] = os.pathsep.join(
p for p in (str(hook), world.env.get("PYTHONPATH", "")) if p
for path in _changed_paths(before.artifacts, after.artifacts)
if path.split(":", 1)[1].rsplit("/", 1)[-1] not in {"apm.yml", "apm.lock.yaml"}
and not any(_bookkeeping(path.split(":", 1)[1], prefix) for prefix in _FAILURE_BOOKKEEPING)
and path.split(":", 1)[1] != report
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