Repository navigation
test(lifecycle): split journey oracle O8 into O8a remediation and O8b diagnostic - #4653
Closed
Daniel Meppiel (danielmeppiel) wants to merge 6 commits into
Closed
Daniel Meppiel (danielmeppiel) wants to merge 6 commits into
Daniel Meppiel (danielmeppiel) wants to merge 6 commits into
Conversation
… 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]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 17:13
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The probe shares durable paths with the continuing journey, while its filtered project-only diff misses state writes and directory creation, allowing mutations to pass the read-only assertion and affect later steps.
2 open issues
What changed in this PR
Splits lifecycle advice validation into remediation (O8a) and diagnostics (O8b), addressing #4571 without changing APM product behavior.
Changes:
- Adds diagnostic checks for promised information, exit behavior, and filesystem changes.
- Reclassifies E04 and J13 as diagnostic journeys while retaining remediation checks elsewhere.
- Updates catalog validation, promise declarations, and generated obligation IDs.
| File | Description |
|---|---|
tests/quality/test_journey_index.py |
Pins the oracle catalog to include O8a and O8b. |
tests/quality/test_generated_obligations.py |
Accepts suffixed oracle IDs in journey obligations. |
tests/quality/generated_obligations.json |
Refreshes required and known-failing obligation mappings. |
tests/lifecycle/journeys/test_journeys.py |
Implements O8b, validates advice kinds, and makes promise IDs literal. |
tests/lifecycle/journeys/index.yaml |
Defines both advice oracles and updates journey assignments. |
tests/lifecycle/journeys/enterprise/E04-private-hosts.yaml |
Checks diagnostic credential/probe output and removes the stale known cell. |
tests/lifecycle/journeys/enterprise/E01-org-policy-rollout.yaml |
Renames the known cell’s oracle to O8a. |
tests/lifecycle/journeys/consumer/J13-run-scripts.yaml |
Replaces the unrelated successful rerun with diagnostic script-list checks. |
Review effort: Balanced
… 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]>
6 of 14 tasks
…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]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 22, 2026
…main + #4653 Co-authored-by: Copilot App <[email protected]>
6 of 10 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The durability check misses writes to cache and configuration roots outside HOME, allowing O8b to pass despite persistent mutations; those roots need coverage and a negative regression test.
1 open issue
2 resolved since last review
Review effort: Balanced
Merged
6 of 14 tasks
Collaborator
Author
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
Splits journey oracle O8 into O8a remediation and O8b diagnostic (#4571). Test-side only; APM output and behaviour are unchanged.
Root cause: O8 ran every printed
Run 'apm ...'advice and required the failing command to pass afterwards. Diagnostic advice exists to show why a step failed, not to fix it, so O8 could not model it:E04 step 4 sat on a strict cell keyed to [BUG] Inaccessible-repository failure does not name the credential source tried #4174 (already closed).
J13 step 4 passed vacuously: it ran
apm list, then reranapm run review, which already worked in step 3, instead of the failingapm run missing.O8a (REMEDIATION-TRUTH) is today's O8, renamed in
tests/lifecycle/journeys/index.yaml, the runner, and E01's known cell.O8b (DIAGNOSTIC-TRUTH) works on a copy of the project in the step's own environment. The advice must write nothing and exit 0 or with the failing exit. It must print every line it promises that the step did not already print (strictly more information). The failing command must keep its exit.
Journey files mark each advice as
remediate(O8a) ordiagnose: {advice, promises}(O8b).check_journey_filerejects advice whose kind disagrees with the index, andtest_advice_kind_follows_the_indexpins that check.E04 step 4 carries test(lifecycle): re-ground 21 stale known cells; sign and gate every known cell #4584's hunk verbatim: key lines for the host, credential and advice, and the e04 strict cell keyed to [BUG] Inaccessible-repository failure does not name the credential source tried #4174 (already closed) is dropped. Its advice
apm install --verbose lifecycle.ghe.com/lifecycle/p-missingmust printsource=GITHUB_APM_PAT_LIFECYCLEandTrying git ls-remote for lifecycle.ghe.com; the advice text promises "each probe and credential".J13 step 4 (audit finding):
apm listmust print the command column (cat review.prompt.md); the advice text promises "each script and its command".The other remediation advice (J03, J04, J12, J14, E02, E06) actually fixes its step and stays O8a.
Also: O8b runs the advice under the failing step's env; O8 never applied it. The
test_journeys.pypromise marker now lists its ids literally so the tm006 gate can read them (same hunk as test(lifecycle): re-ground 21 stale known cells; sign and gate every known cell #4584). The journey-space id pattern acceptsO8a/O8b.Obligations (
python -m tests.lifecycle.witnesses): 1064 required / 27 known failing -> 1065 / 26.J|E04|4|O8bandJ|J13|4|O8bare required, and the 9 remediation ids are renamedJ|*|O8->J|*|O8a.H7 coupling: this PR couples with #4584 on
E04-private-hosts.yaml(the same step-4 hunk), thetest_journeys.pypromise marker, andtests/quality/generated_obligations.json. Whichever lands second regenerates the JSON withpython -m tests.lifecycle.witnesses --writeand drops the duplicate hunk.Issue and approved scope
Issue: Fixes #4571 (Refs #4565, the epic)
Human scope-approval comment: the
apm-scope:v1approve record on #4571 (review contact Daniel Meppiel (@danielmeppiel)). Ordering ruling from the Q&L lead: build on main, carry #4584's E04 hunk, and #4571 lands first.Does this PR complete the issue, or what remains? It completes #4571. O8b exists in index.yaml and test_journeys.py,
J|E04|4|O8bis required and passes, the generated snapshot is regenerated, and the index carries no comment citing #4571.Type of change
Testing
All runs through the host guard, on a worktree with its own venv, engine driver,
APM_E2E_TESTS=1:pytest tests/lifecycle/journeys/test_journeys.py::test_journey[E04] [J13] [E01]: 3 passed.pytest tests/lifecycle/journeys/test_journeys.py -k "advice_kind or agree_with_the_index": 7 passed.pytest tests/quality/test_journey_index.py tests/quality/test_generated_obligations.py tests/quality/test_promise_obligations.py tests/lifecycle/generator: passed (96).python -m tests.lifecycle.witnesses: up to date, 1065 required / 26 known.python -m tests.lifecycle.generator --check: up to date.uvx [email protected] checkandformat --check, pylint R0801,lint-auth-signals.sh,check_complexity_ratchet.py --base-ref origin/main,python -m tests.quality.taxonomy --changed(tm006 ok): all pass.Changelog
## [Unreleased]inCHANGELOG.md:user-visible effect first, 25 words or fewer, ending with
(#PR);breaking changes only under upgrade notes; no Highlights; see
.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.