Repository navigation
test(lifecycle): family core -- model, driver, oracle receipts, obligation ratchet - #4142
Merged
Daniel Meppiel (danielmeppiel) merged 107 commits intoNov 20, 2026
Merged
Conversation
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged
6 of 10 tasks
…obligation ratchet (#4093) Create tests/lifecycle/: a pure reference model (model/state.py, model/expected.py), a driver (engine|binary), the cross-cutting oracle promoted from tests/utils/lifecycle_oracle.py with receipts written only by the oracle, snapshot helpers, a fallback world until T-0W lands, and a row runner with one example replay row. tests/quality/promise_obligations.json splits the 91 invariant x operation pairs and 107 GATE cells into required rows (witness tests must earn the receipt, checked in the lifecycle shards) and a baseline owned by later lanes. Old oracle/snapshot paths keep shims. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…#4093) 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)
force-pushed
the
danielmeppiel-cautious-fortnight
branch
from
November 20, 2026 08:57
5392d8e to
4211595
Compare
…mands run outside the project (#4093) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…loyed files (#4093) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…proof tests (#4094) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
…mands run outside the project (#4093) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…loyed files (#4093) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…proof tests (#4094) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
#4113) Adds check_cli_output (I6 ASCII + JSON mode, I8 exit contract, I9 no traceback or duplicated diagnostics) to tests/utils/lifecycle_evidence.py and routes ApmLifecycleRunner.run and run_sequence through it. Known cells registry is empty pending suite discovery. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…4095) Move tests/integration/_gate_machine_kit.py and test_generated_gate_state_machine.py to tests/lifecycle/machines/_gate_kit.py and test_m_gate.py. Commands now run through the lifecycle driver (engine on PR, binary on the nightly); the GATE cell session hook moves to tests/lifecycle/machines/conftest.py. Witness node ids, duration seeds, taxonomy baseline, nightly workflow and docs follow the move. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Compare the apm Click tree with the reference CLI pages and the apm-usage commands guide in both directions; fix five small docs gaps it found. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…rld (#4094) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…4107-#4112) oracles.check_obligation(cell_id, strength, before, after, result, evidence) is the one entry point that credits a generated obligation. The oracle checks the evidence itself (snapshot paths, unchanged bytes, egress log, persisted-secret scan, exit, output, owner value) and writes the receipt only when every fact holds; unit, e2e and e2e-evidence strengths set the minimum evidence. tests/lifecycle/obligation_space.py expands the reviewed model export tests/quality/security_obligations.json (G 244, P 224, I 116, E 281, M 38, C 22 = 925) and one row per journey step oracle of the journey index. The P collapse after the routing owner lands is a recorded, disabled rule. obligations.py loads the generated space with required witnesses, a derived per-lane baseline and a separate known-failing list that earns no receipt. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
4 of 14 tasks
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]>
3 of 14 tasks
…ll, #4154 XPASS - test_policy_outcome_routing_lifecycle.py cites P-OWN-policy-outcome-routing (added to the catalog). - test_credential_rendering.py: the two equal-body tests become one parametrized test with ids. - Strict output cell for approve's org-policy warning printed twice (#4178). - p-native-claude at user scope installs now (#4154); its strict xfail is retired. Co-authored-by: Copilot App <[email protected]>
…nment notice (#4320) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…4142 resolves - Taxonomy baseline: drop the temporary allowances for the modules #4142 marks (spec behavior modules, journey index, registry archive, git lock content hash, policy outcome routing, credential rendering) and the deleted integration machines; test_m_gate.py now carries e2e and promise marks. - Exact-duplicate baseline: drop the credential_rendering pair (now one parametrized test). - #4270 landed (#4276): the Claude plugin bin/ user-scope world cells are required again. - #4178 cell keys on the same approve warning printed twice, not on any warning. Co-authored-by: Copilot App <[email protected]>
…lowance growth - test_generated_obligations.py cites the executable trust owners its security tables cover; its promise_exempt entry is dropped. - Main's new test_hook_approval_pin_parity_lifecycle.py cites P-OWN-executable-trust-fingerprint; test_hook_pin_parity_reqs.py is component and cites req-sc-011. Co-authored-by: Copilot App <[email protected]>
…e global hook; cell for the empty org-policy notice per phase (#4113) One product duplicate now has one owner: tests/lifecycle/oracles.py _i9 excuses a duplicated line only when a strict I9 known output cell owns it for the same command, and the global hook on that command still fails the cell once the defect is fixed. Adds the #4241 cell for '[!] Org policy at <x> is present but empty' printed by both phases. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…--recommended prints the warning once (#4113) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…ng it Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Takeshi Masukawa (takeaship)
pushed a commit
to takeaship/apm
that referenced
this pull request
Nov 20, 2026
The tm006 template documented in microsoft#4303 uses pytest.mark.promise, which --strict-markers rejects on main until the marker is registered. Same wording and position as microsoft#4142, so the two merge cleanly. Refs microsoft#4113 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This was referenced Nov 20, 2026
…4113) New neutral issues: #4330 (non-ASCII path echoed raw), #4331 (uninstall lines per duplicate declaration), #4332 (adapter unreadable-config warning twice), #4333 (deny_all lifecycle notice repeats on update), #4334 (verbose diagnostics repeat), #4336 (hook summary line twice). Existing: #4299 (parked MCP per phase), #4291 (pack manifest notes twice). One #4178 cell (repeat-keyed); #4256 keyed on a repeated notice. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-cautious-fortnight
branch
November 20, 2026 14:02
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
3 tasks done
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
#4142 moved the GATE machine kit to tests/lifecycle/machines; cell g (#4050, fixed here) is dropped there and the #4050 ledger row points at the moved spine test. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Take main as canonical for the quality modules and the taxonomy baseline; keep both CHANGELOG lines. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This was referenced Nov 20, 2026
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
TL;DR. This PR adds the core of the lifecycle test family under
tests/lifecycle/:One example replay row drives the real CLI and earns receipts for I1-I9. The I2 law found a real defect on main, #4132, which the row records as a strict expected failure.
Problem (WHY). 17 lanes of the 0.37 lifecycle family need a shared model, driver, oracle and credit system. Until now, credit for a GATE cell came from a
cell:event that is emitted before the step runs. A requested step therefore earned credit even if no oracle ever checked it.Approach (WHAT).
tests/lifecycle/model/state.py(ModelState)tests/lifecycle/model/expected.py(expected_deployed,expected_lock_rows,expected_exit,EXIT_CONTRACTS: audit 0-3, pack 0-5, others 0-2)run(world, argv, scope=),APM_LIFECYCLE_DRIVER=engine|binary, user-scope flag per commandtests/lifecycle/driver.pyoperation_for(args);check_output(I6, I8, I9)tests/lifecycle/oracles.pyReceipt(node, params, pre_digest, argv, scope, post_digest, oracle_id, outcome, lane);emitraisesReceiptForgeryErrorfor any caller other than the oracle moduletests/lifecycle/receipts.pytests/lifecycle/obligations.py,tests/quality/promise_obligations.jsonLifecycleSurfaceRoots,capture_surfaces,restore_tree)tests/lifecycle/snapshot.pytests/lifecycle/conftest.py,tests/lifecycle/_fallback_world.pytests/lifecycle/rows.py(RowReplay),tests/lifecycle/replay/rows/core_gate_row.yamlImplementation (HOW).
Ratchet. The universe is the steward-approved APPLY table (91 invariant x operation pairs) plus the 107 GATE cells. 144 obligations are
required, each with a witness test: the example row, or the GATE spine for[project]or[user]. The remaining 54 sit in thebaseline, each naming its lane (T-1 Lifecycle test family: M-GATE machine in the family (T1 and T2 obligations) #4095, T-2 Lifecycle test family: M-SOURCE machine (T3 and T5 obligations) #4096, T-3 Lifecycle test family: M-SCOPE-LOCK machine (T4 obligations) #4097 or T-5 Lifecycle test family: covering replay generator and rows #4099). A globalpytest_runtest_makereporthook fails a passing witness whose receipts do not cover its rows; this runs inside the existing lifecycle shards with one dict lookup per test.test_promise_obligations.pyis in the ratchet job. It pins the universe, checks that every witness is alifecycle_smoketest, and checks that every baseline lane is a real lane. On a merged receipts run it also fails when a baseline row is already covered, so that row must be promoted torequired.Credit rules. A law that does not apply, fails, or is owned by a strict expected failure earns nothing. A refusal receipt never covers a success obligation; I7 needs a refusal. I3 credit also counts the paired
auditop.Promotion.
tests/utils/lifecycle_oracle.pyandtests/utils/world_snapshot.pybecome re-export shims.lifecycle_state.pyimports the surface code fromtests/lifecycle/snapshot.py. The GATE kit passes its cells and scope intoOperation, so the GATE spines earn receipts for all 107 cells.Oracle changes. These are kept minimal, as the lead asked:
I3 remediation, I7 announcements and I9 per-cause counting are unchanged (T-1).
CI. The lifecycle shard command gains
tests/lifecycle, the ratchet job gainstests/quality/test_promise_obligations.py, and estimated durations are added for the two new nodes. There are no new jobs.Trade-offs.
p-skillandp-execoverLocalPackageFactory) ships until T-0W (Lifecycle test family: shared hermetic world (builder, packages, services, clone) #4094) lands; whichever PR lands second removes it.P-OWN-*) are rejected until T-5 adds a promise catalog.Issue and approved scope
Fixes #4093
Fixes #4094
Fixes #4095
Fixes #4098
Fixes #4113
Fixes #4133
Human scope-approval comments: #4093 #4093 (comment) ; the records on #4094, #4095, #4098, #4113 and #4133 (posted by Daniel Meppiel (@danielmeppiel)).
This PR is the T1 integrator of the 0.37 lifecycle family:
Pieces land here progressively; the PR stays a draft until all of them are in and green. It makes no claim on #4096, #4097 or #4099 (finished by T2). It found #4132, which is not owned here and is recorded as a strict expected failure.
Type of change
Testing
Promise ids discharged:
P-INV-I1..P-INV-I9(the row names all nine). Obligation cells: 144 required rows intests/quality/promise_obligations.json.tests/lifecycle/test_core_example.py::test_core_gate_row_keeps_every_invariant.tests/integration/test_generated_gate_state_machine.py::test_gate_mandatory_spine_covers_obligations[project|user]. This includes all 107 GATE cells, now earned through receipts.Red before (snapshot-backed oracle failures on the real CLI, engine driver):
RowReplay(core_gate_row, entry_point=skip_approval_check.py)after install: I4 ...: p-exec/hook/copilot still deployed but not allowed; kept astest_core_gate_row_kills_the_recorded_approval_mutant"I4"dropped from_CHECKS, thenpytest tests/lifecycle/test_core_example.py::test_core_gate_row_keeps_every_invariant...is the witness of 1 required obligation(s) that no oracle receipt covered: P-INV-I4|op:installpytest tests/quality/test_promise_obligations.py -k removing_one_oracle_callP-INV-<law>|op:install(9 cases)-k only_the_oracle/-k without_the_caller_guardapm install --frozenI2: converged install-frozen rewrote files: ['project:.github'], tracked as #4132 (strictknown_cells)Green after:
uv run --extra dev pytest -p no:cacheprovider -q -n 8 --dist loadgroup tests/lifecycle tests/integration/test_generated_gate_state_machine.py tests/integration/test_lifecycle_state_snapshot_contract.py tests/unit/scripts/test_lifecycle_evidence.py tests/quality/test_promise_obligations.py tests/quality/test_gate_cell_obligations.py tests/quality/test_lifecycle_bug_ledger.pyAPM_LIFECYCLE_RECEIPTS_REQUIRED=1 uv run --extra dev pytest -q tests/quality/test_promise_obligations.py(on the merged session receipts)uv run --extra dev pytest -q -n 4 tests/quality/test_ci_topology.pyincluded)lint-auth-signals.sh(grep guards aresrc/-scoped; nosrc/change)Runtime: the two new lifecycle nodes take about 6 s each locally and run in lifecycle shard 2. The quality test takes 0.5 s.
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.