You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(lifecycle): re-ground 21 stale known cells; sign and gate every known cell - #4584
Fixes#4571 (this PR carries #4653's O8 -> O8a/O8b journey oracle split and lands as one unit; #4653 closes as superseded).
Twenty-one strict known cells in tests/quality/generated_obligations.json cited tracking issues that the 0.37 release train #4424 had already completed (Refs #4053, #4178, #4224, #4174). All 21 still failed on main bfc0929, but for new reasons. The fixes had landed and the test oracles had gone stale. A strict xfail asserts only that a test fails, so it could not tell the two causes apart. This PR re-grounds the 21 cells and adds a structural guard so the same thing cannot go unnoticed again.
Per-cell classification (run on main under host_guard, real binary):
The fix landed: apm approve resolves the org policy once through resolve_trust_policy. Block classes now exit 1 with "Blocked by org policy" and "Nothing was written". Warn classes print "Org policy not applied (outcome=...)" once, and I9 holds.
Expectations now follow the shared routing, matching the exec-map site. The cells become required. empty/warn and the forbids lists now name the routed line, because the old "approval is proceeding" text no longer exists in src/.
The fix landed: the sarif run names the failed check on stderr. O8 still fires because no format of audit --ci prints a runnable remedy for a dependency-allowlist failure. This is a different cause.
The fix landed: the advice is runnable and --verbose names the credential source. Following diagnostic advice on a repo that does not exist still exits 1, and #4174's own regression test pins that.
Q&L ruling: drop O8 from E04 step 4. Model residual #4571 ("O8 cannot model diagnostic advice"). The key lines and O5 now pin the host, the credential and the advice.
None of the 21 is a product bug, so no issue was reopened.
Structural fix (approved by the lead):
tests/lifecycle/known.py adds KnownFailure(tracking, reason, match, kind="bug"|"deferred-design", raises=AssertionError). Its .mark() builds the strict xfail. The same module is a pytest plugin, registered by tests/conftest.py. It reports an expected failure whose message lacks the match signature as a failure ("failed for a different reason").
New gate tests/quality/test_known_cells_cite_open_issues.py (offline, repository ratchet scope, added to the ratchet contract job in ci.yml and main-architecture-ratchets.yml) checks four things:
Every known cell cites #<n> with n > 0. This covers the generated known_failing list, journey known_cells, machine KNOWN_CELLS, RULE_CELL_KNOWN, and an AST scan of every strict xfail and KnownFailure in tests/.
The snapshot tests/quality/known_cell_issue_states.json records exactly the cited issues.
No cited issue is recorded closed.
No raw pytest.mark.xfail appears in tests/lifecycle outside known.py.
A pytester test proves the signature hook: a matching failure is reported as xfailed, and a failure with a different message is reported as failed.
Regenerate the snapshot with python -m tests.quality.known_cell_issues --write, which reads issue state through gh.
Obligation counts (tests/quality/generated_obligations.json): required 1064 -> 1083 (+19), known_failing 27 -> 7 (the six #3703 cells plus J|E01|4|O8 -> #4570). J|E04|4|O8 leaves the universe (residual #4571). tests/quality/lifecycle_obligations.json is unchanged (baseline 1468, required 1023).
Table-level known cells also need an open issue and a signature. Machine KNOWN_CELLS_BY_ID and KNOWN_T4 map to KnownFailure, and scenario credits take a Known. Known, known_defect and KnownCell now reject #0 and an empty match. The gate's AST scan covers all of them and resolves module-level tracking constants.
Line-wise signatures: in a lifecycle oracle failure, every violation line must carry the signature. A known violation listed next to an unrelated one now fails the row. The pytester test covers a mixed case and an all-known case.
Human scope-approval comment: Quality & Lifecycle lead rulings, 2026-11-21. Task A brief: classify the 21 stale cells, then ship the moves, the re-keys and the open-issue gate in one PR. E01 is re-keyed to #4570. The E04 O8 drop was accepted with residual #4571. KnownFailure, the makereport hook, the static ban and the snapshot gate were approved as designed. The #4543deferred-design kind follows the regent ruling relayed by the lead.
Does this PR complete the issue, or what remains? It completes the stale-cell triage for #4565. #4570 (product) and #4571 (model residual) remain open and are tracked 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)
All runs used host_guard with APM_BINARY_PATH=.venv/bin/apm:
pytest tests/lifecycle/security/test_gate_removal.py tests/lifecycle/security/test_policy_outcomes.py -k "lsp or approve": 78 passed (all 12 lsp rows and all 22 approve rows, no xfail left).
…n cells
The 21 cells citing closed#4053, #4178, #4224 and #4174 still failed on
main, but for new reasons: the fixes had landed and the oracles were stale.
- #4053 (10 LSP gate cells): --frozen now refuses with 'records an
executables decision the gate no longer makes'; FROZEN_REFUSAL accepts
it and the cells are required.
- #4178 (9 approve cells): approve routes the org policy through the trust
reader once; block classes refuse and write nothing, warn classes report
'Org policy not applied' once. Expectations follow; cells required.
- J|E01|4|O8: sarif audit now names the failed check (#4224) but no format
prints a runnable remedy: re-keyed to #4570.
- J|E04|4|O8: the advice is diagnostic (#4174); O8 cannot model it
(residual #4571), so step 4 drops O8 and pins host, credential, advice.
KnownFailure (tests/lifecycle/known.py) replaces raw strict xfails: it
names the tracking issue and the failure signature, and a makereport hook
fails a known cell that failed without it. The gate
tests/quality/test_known_cells_cite_open_issues.py requires every known
cell to cite an issue recorded OPEN in known_cell_issue_states.json.
Refs #4565, #4549
Co-authored-by: Copilot App <[email protected]>
- KnownFailure gains kind (bug | deferred-design) and raises; the
signature plugin is registered by tests/conftest.py for every suite.
- The #4543@registry shorthand cells (a deferred design whose tracker
stays open) become KnownFailure(kind='deferred-design') with their
failure signature; reason text and strictness are unchanged.
- The gate now discovers every strict xfail in tests/ by AST, so a raw
strict xfail anywhere must cite an issue recorded OPEN.
- test_journeys.py names its promise ids literally (tm006 --changed).
Refs #4565, #4549
Co-authored-by: Copilot App <[email protected]>
This PR updates APM’s lifecycle tests to reflect fixes shipped in 0.37 and strengthens how the test suite tracks remaining known failures. It changes test infrastructure and CI, not product behavior.
Changes:
Promotes 10 LSP and nine approval cells from known failures to required coverage.
Re-keys E01’s missing-remedy failure to #4570 and removes E04’s inapplicable remediation check, tracking diagnostic coverage under #4571.
Adds failure-signature checks, an issue-state snapshot, and CI checks for known-cell tracking.
…cells
- Scenario Known cells of test_failure_phase cited closed#4164, but still
fire with their original signature: product residual filed as #4594 and
the cells re-keyed to it.
- Table-level known cells need an open issue and a failure signature:
machine KNOWN_CELLS_BY_ID and KNOWN_T4 map to KnownFailure; scenario
credits take a Known; Known, known_defect and KnownCell reject '#0' and
an empty match.
- The gate's static scan covers Known, known_defect and KnownCell and
resolves module-level tracking constants.
Refs #4565, #4549
Co-authored-by: Copilot App <[email protected]>
…s its signature
Review follow-up. An oracle failure can list a known violation next to an
unrelated one; a substring search over the whole message kept the row
xfailed and hid the new one. For a lifecycle oracle failure (header, one
line per violation, then 'args=' evidence) every violation line must now
match the KnownFailure signature; other failures keep a message search.
The #3703 signature names all three of its symptoms, and the gate test
adds a mixed known-plus-new case that must fail.
Refs #4565, #4549
Co-authored-by: Copilot App <[email protected]>
Resolve: main's new strict known cell X|install|pkg-registry|UPDATE=on
(#4572) becomes a KnownFailure with its KnownCell signature; the issue
snapshot records #4572 OPEN.
Co-authored-by: Copilot App <[email protected]>
Union resolution: main's source rule cells keep the KnownFailure-typed
KNOWN_CELLS_BY_ID; both FIRST_PARTY_MCP_CELL and KnownFailure imports;
snapshot drops #4324 (no longer cited on main).
Co-authored-by: Copilot App <[email protected]>
… diagnostic
O8 ran every printed "Run 'apm ...'" advice and required the failing
command to pass afterwards. That cannot model diagnostic advice, whose
job is to show why a step failed, so E04 step 4 sat on a strict cell
keyed to a closed issue and J13 step 4 passed vacuously (`apm list`,
then a rerun of a different command that already worked).
- O8a (REMEDIATION-TRUTH) is today's O8, renamed in the index, the E01
known cell and the runner.
- O8b (DIAGNOSTIC-TRUTH): in a copy of the project and the step's own
environment, the advice writes nothing, exits 0 or with the failing
exit, prints every line it promises that the step did not, and the
failing command keeps its exit.
- Journey files mark advice as `remediate` (O8a) or `diagnose` (O8b with
promises); check_journey_file refuses a mismatch with the index.
- E04 step 4 (#4584's hunk carried verbatim: host, credential and advice
key lines, the e04 strict cell keyed to closed#4174 dropped) and J13
step 4 are O8b: J|E04|4|O8b and J|J13|4|O8b are required.
Fixes#4571
Refs #4565
Co-authored-by: Copilot App <[email protected]>
… quality module
The static O8a/O8b schema test asserted no CLI outcome inside the e2e
journey module (AQ003). It is a schema check, so it lives with the
other journey-index checks (unit).
Refs #4571
Co-authored-by: Copilot App <[email protected]>
…filtered diff
Review on #4653:
- The diagnostic probe is a clone of the whole world (project, HOME,
APM_HOME, caches) under the failing step's environment, so advice
that writes outside the project cannot leak into later steps and is
seen by the read-only check.
- "Writes nothing" compares every durable root with the unfiltered
artifact diff (bookkeeping such as .apm-local and directory entries
included), not the journey's filtered file delta.
Refs #4571
Co-authored-by: Copilot App <[email protected]>
#4224 is closed; #4570 tracks the missing runnable next step of a failed
dependency-allowlist audit.
Refs #4571
Co-authored-by: Copilot App <[email protected]>
…4571)
The obligation-status ratchet (#4586, now on main) requires a named rule for
each required id that disappears; the 9 journey O8 ids are witnessed by
their O8a/O8b successors.
Co-authored-by: Copilot App <[email protected]>
…n candidate
The root conftest registers tests/lifecycle/known.py, so the bounded candidate
copy must carry it or every mutation run fails at pytest_configure.
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active findings leave forbidden credential output unchecked in advice and reruns, while durable-write detection misses environment-selected cache and configuration roots.
…s, and snapshots every durable root
The diagnostic advice and each failing-command rerun must not print the
step's forbidden lines (raw output), recorded as evidence. The no-write
check snapshots every root the environment selects (cache, XDG, GitHub and
Azure config), collapsing nested roots, with a write-outside-HOME regression.
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The checks can incorrectly accept unrelated fixture setup failures as known failures and miss creation or removal of empty artifact roots, leaving two correctness gaps unresolved.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Include root existence changes in artifact snapshot diffs
tests/lifecycle/journeys/test_journeys.py:1437
ArtifactSnapshot.diff() compares entries only, not root_existed (tests/utils/artifact_snapshot.py:81-94). Creating an empty environment-selected root such as GH_CONFIG_DIR, or removing an existing empty root, therefore produces no changes here and passes O8b's no-write check. Compare root_existed as well so these durable writes are reported.
Validate known-failure signatures for fixture setup errors
tests/lifecycle/known.py:96
A KnownFailure-marked test can xfail during fixture setup, but this call-only guard skips its signature check. An unrelated setup AssertionError is therefore accepted as an expected failure even when it lacks the known signature. Check every xfailed report with exception information, and add a pytester case covering a mismatched fixture failure.
…er its base
Main's T-6b/T-7b scenario modules passed issue strings to credits(known=);
microsoft#4584's credits() takes signed Known cells. Each step and its CREDITS
entry now share one module constant.
Co-authored-by: Copilot App <[email protected]>
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
full-integrationRun the full integration suite (ci-integration.yml) on this PR before merge
2 participants
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
Fixes #4571 (this PR carries #4653's O8 -> O8a/O8b journey oracle split and lands as one unit; #4653 closes as superseded).
Twenty-one strict known cells in
tests/quality/generated_obligations.jsoncited tracking issues that the 0.37 release train #4424 had already completed (Refs #4053, #4178, #4224, #4174). All 21 still failed on main bfc0929, but for new reasons. The fixes had landed and the test oracles had gone stale. A strict xfail asserts only that a test fails, so it could not tell the two causes apart. This PR re-grounds the 21 cells and adds a structural guard so the same thing cannot go unnoticed again.Per-cell classification (run on main under host_guard, real binary):
G|frozen|*|lsp,G|frozen-g|*|lsp,G|audit-ci|*|lsp--frozenexits 1 with "records an executables decision the gate no longer makes".FROZEN_REFUSALdid not accept that wording.FROZEN_REFUSALaccepts it. The cells become required.P|approve|*apm approveresolves the org policy once throughresolve_trust_policy. Block classes now exit 1 with "Blocked by org policy" and "Nothing was written". Warn classes print "Org policy not applied (outcome=...)" once, and I9 holds.empty/warnand theforbidslists now name the routed line, because the old "approval is proceeding" text no longer exists insrc/.J|E01|4|O8audit --ciprints a runnable remedy for adependency-allowlistfailure. This is a different cause.J|E04|4|O8--verbosenames the credential source. Following diagnostic advice on a repo that does not exist still exits 1, and #4174's own regression test pins that.None of the 21 is a product bug, so no issue was reopened.
Structural fix (approved by the lead):
tests/lifecycle/known.pyaddsKnownFailure(tracking, reason, match, kind="bug"|"deferred-design", raises=AssertionError). Its.mark()builds the strict xfail. The same module is a pytest plugin, registered bytests/conftest.py. It reports an expected failure whose message lacks thematchsignature as a failure ("failed for a different reason").Every strict xfail in
tests/lifecyclenow goes throughKnownFailure: the gate, policy, egress, integrity, origin, world and journey tables. The six User-scope (-g) org policy source: govern global installs consistently #3703 cells carry their I4 signature.The [FEATURE] @registry dependency shorthand (owner/repo@<registry>#<semver>) #4543 Vasily Pupkin (@registry) shorthand cells are a deferred design whose tracker stays open. They become
KnownFailure(kind="deferred-design")with the signatureShorthand '@alias' is not supported. Their reason text and strictness are unchanged, and all 19 nodes still xfail.New gate
tests/quality/test_known_cells_cite_open_issues.py(offline, repository ratchet scope, added to the ratchet contract job inci.ymlandmain-architecture-ratchets.yml) checks four things:#<n>with n > 0. This covers the generatedknown_failinglist, journeyknown_cells, machineKNOWN_CELLS,RULE_CELL_KNOWN, and an AST scan of every strict xfail andKnownFailureintests/.tests/quality/known_cell_issue_states.jsonrecords exactly the cited issues.pytest.mark.xfailappears intests/lifecycleoutsideknown.py.A pytester test proves the signature hook: a matching failure is reported as xfailed, and a failure with a different message is reported as failed.
Regenerate the snapshot with
python -m tests.quality.known_cell_issues --write, which reads issue state throughgh.Obligation counts (
tests/quality/generated_obligations.json): required 1064 -> 1083 (+19), known_failing 27 -> 7 (the six #3703 cells plusJ|E01|4|O8-> #4570).J|E04|4|O8leaves the universe (residual #4571).tests/quality/lifecycle_obligations.jsonis unchanged (baseline 1468, required 1023).Added after review and lead rulings:
A 22nd stale cell: the scenario
Knowncells intest_failure_phase(rowslockfile-writeandmcp-config-write) cited a tracking issue that was already completed (Refs Install that fails at the lockfile or MCP config write keeps the deployed files of the failed attempt #4164), but they still fire with their original signature. The Install that fails at the lockfile or MCP config write keeps the deployed files of the failed attempt #4164 fix did not cover these two commit points. I filed the product residual as [BUG] A failed install still keeps the deployed files of the failed attempt (lockfile or MCP config write) #4594 and re-keyed the cells to it.Table-level known cells also need an open issue and a signature. Machine
KNOWN_CELLS_BY_IDandKNOWN_T4map toKnownFailure, and scenario credits take aKnown.Known,known_defectandKnownCellnow reject#0and an empty match. The gate's AST scan covers all of them and resolves module-level tracking constants.Line-wise signatures: in a lifecycle oracle failure, every violation line must carry the signature. A known violation listed next to an unrelated one now fails the row. The pytester test covers a mixed case and an all-known case.
KnownFailure.kind(bug|deferred-design) andraises: the [FEATURE] @registry dependency shorthand (owner/repo@<registry>#<semver>) #4543 Vasily Pupkin (@registry) shorthand cells (regent ruling: deferred design, tracker stays open) usekind="deferred-design". Their reason text and strictness are unchanged.The gate covers every strict xfail in
tests/. The snapshot records 11 issues, all OPEN.Live example of the class this gate catches: fix(install): drop the stale .apm-pin after a git -> registry source switch #4597 landed the change for [BUG] A git-to-registry source switch leaves the stale git .apm-pin in apm_modules until install --update #4572 but left the strict
KnownCellregistry-source-switch-stale-pin, so main's source spine went red on every PR. test(lifecycle): retire the #4572 strict cell after its fix (main red) #4619 retires that cell, and this branch is rebased on it. With this gate, the snapshot regeneration flags [BUG] A git-to-registry source switch leaves the stale git .apm-pin in apm_modules until install --update #4572 as done, so the gate fails until the cell flips.Issue and approved scope
Issue: Refs #4565, Refs #4549 (also #4570, #4571, #4594, #4543)
Human scope-approval comment: Quality & Lifecycle lead rulings, 2026-11-21. Task A brief: classify the 21 stale cells, then ship the moves, the re-keys and the open-issue gate in one PR. E01 is re-keyed to #4570. The E04 O8 drop was accepted with residual #4571. KnownFailure, the makereport hook, the static ban and the snapshot gate were approved as designed. The #4543
deferred-designkind follows the regent ruling relayed by the lead.Does this PR complete the issue, or what remains? It completes the stale-cell triage for #4565. #4570 (product) and #4571 (model residual) remain open and are tracked separately.
Type of change
Testing
All runs used host_guard with
APM_BINARY_PATH=.venv/bin/apm:pytest tests/lifecycle/security/test_gate_removal.py tests/lifecycle/security/test_policy_outcomes.py -k "lsp or approve": 78 passed (all 12 lsp rows and all 22 approve rows, no xfail left).pytest "tests/lifecycle/journeys/test_journeys.py::test_journey[E01]" "...[E04]"plus the six User-scope (-g) org policy source: govern global installs consistently #3703 gate rows: 8 passed, 6 xfailed (each xfail carries its signature).pytest tests/quality tests/unit/test_apm_yml_registries.py tests/unit/test_reference_registry_shorthand.py tests/unit/registry/test_compat_matrix.py tests/lifecycle/journeys/test_journeys.py::test_journey_files_agree_with_the_index -n 2: 599 passed, 19 xfailed.lint-auth-signals.shclean;check_complexity_ratchet.py --base-ref origin/mainclean;python -m tests.quality.taxonomy --changedreports 11 changed modules OK.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)