Repository navigation
test(lifecycle): corpus train 2 (T-3 batch 1 + T-1 batch 2 + U-MKT) - #4614
Closed
Daniel Meppiel (danielmeppiel) wants to merge 18 commits into
Closed
Daniel Meppiel (danielmeppiel) wants to merge 18 commits into
Daniel Meppiel (danielmeppiel) wants to merge 18 commits into
Conversation
…ckfiles A second scope-lock spine drives a stale lockfile (the manifest and the lock disagree on the toggle package), an absent lockfile and the side-door commands (deny, install --mcp, a local bundle, marketplace list) through every lock state the lockfile spine leaves open. Each step runs I1-I9; admitted side doors also assert their own outcome. Lockfile cells now carry the context their step acted on and credit, anchored on LOCK, the pairs it implies. apm marketplace list creating ~/.apm/marketplaces.json is a strict known cell (#4600). Refs #4564 Refs #4097 Co-authored-by: Copilot App <[email protected]>
…owed The GATE matrix gains a user-scope spine (install --frozen at every gate level an approval store reaches, T2 FROZEN x SCOPE=user x GATE) with the user-scope copilot surfaces observed (Bench.surface_globs). Marketplace commands map onto rule U-MKT (Q&L ruling 2026-11-21): one rule cell witnessed at the allowed and revoked levels with every project byte unchanged; the org-policy level keeps its own cells, witnessed under the dependency deny. The allowed level also uninstalls and reinstalls p-lsp. Refs #4564 Refs #4095 Co-authored-by: Copilot App <[email protected]>
Refs #4564 Co-authored-by: Copilot App <[email protected]>
credits() is the one place that says which ids a machine receipt discharges (rule ids themselves, anchored cells only their anchor), and the witness test reads it. U-MKT evidence follows main's line moves. Refs #4564 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 12:35
6 of 10 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tests can credit coverage despite missing gate-level witnesses, durable bundle installation state, or verified lock reconciliation, allowing no-op or incomplete behavior to pass.
3 open issues
What changed in this PR
Expands APM's lifecycle test corpus toward the baseline-reduction goal in #4564, without changing production behavior.
Changes:
- Adds stale and absent lockfile scenarios, alternate command paths, and strict known-failure coverage for #4600.
- Extends user-scope gate coverage and introduces the U-MKT marketplace equivalence rule.
- Centralizes receipt-credit logic and regenerates obligations, reducing baseline cells from 1,253 to 1,108.
| File | Description |
|---|---|
tests/quality/lifecycle_obligations.json |
Regenerates obligation mappings, witnesses, counts, and known failures. |
tests/lifecycle/machines/test_m_scope_lock.py |
Adds lock-drift sequences and alternate command coverage. |
tests/lifecycle/machines/test_m_gate.py |
Enables user-scope matrix execution and rule-receipt checks. |
tests/lifecycle/machines/_kit.py |
Observes user deployment locations and handles absent-lock provenance. |
tests/lifecycle/machines/_gate_matrix.py |
Adds user gate sequences and marketplace preservation checks. |
tests/lifecycle/generator/witnesses.py |
Translates drift context and centralizes receipt credits. |
tests/lifecycle/generator/test_generator_rules.py |
Validates witness credits through the shared credit logic. |
tests/lifecycle/generator/rules.py |
Defines U-MKT while preserving separate org-policy coverage. |
Review effort: Balanced
…record Per review on corpus train 2: outcome checks now run before a drift cell is credited. A resolving command must leave a readable lockfile whose rows match the manifest and that records each deployed declared skill; a local bundle install must record p-lsp's approval key and LSP type in apm_modules/.local-bundle-pending.json while its server stays parked. Refs #4564 Co-authored-by: Copilot App <[email protected]>
Per review on corpus train 2: the allowed and the revoked marketplace probes each hold their checked step; the rule cell's receipts are emitted only once both levels are present, so dropping either probe leaves the rule uncovered (negative control: umkt_ready per dropped level). Refs #4564 Co-authored-by: Copilot App <[email protected]>
6 of 14 tasks
Co-authored-by: Copilot App <[email protected]>
…main Co-authored-by: Copilot App <[email protected]>
This was referenced Nov 21, 2026
Collaborator
Author
|
Superseded by #4700 (corpus train 3, combined), which carries this train's content as car 1 on current main. |
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
Corpus train 2 lands the next ready lifecycle-corpus batches with ONE regenerated
tests/quality/lifecycle_obligations.json. Sources are merged with--no-ff.Rule U-MKT (Q&L ruling 2026-11-21) says that marketplace commands act on catalogs, never on deployed primitives.
evidencefield intests/lifecycle/generator/rules.py, anchors checked bytest_every_rule_cites_code_that_still_says_it):src/apm_cli/commands/marketplace/__init__.py:372(def add(source, name: add registers a catalog);docs/src/content/docs/reference/cli/marketplace.md:292(apm marketplace updaterefreshes registered catalogs);docs/src/content/docs/consumer/installing-from-marketplaces.md:112(apm marketplace update"refreshes the cached list and nothing else");apm marketplace --help, where every consumer and authoring command acts on catalogs or themarketplace:block, andrules.pyACCEPTS marketplace = {SELECT}.apm install <plugin>@<marketplace>(OP=install, SRC=marketplace-*), which M-SOURCE covers.rule|U-MKT|marketplace-never-touches-deployed. The org-policy GATE level stays its own cells (U2 no-collapse), and OP x SRC x PRIM stays with the source lane.apm marketplace add <world catalog>runs at the allowed level andapm marketplace updateruns at the revoked-after-deploy level (denied executables still deployed). Both are checked with I5 forbidding any project write and with e2e-evidence that every project byte (deployed surfaces and the lockfile) is unchanged. A thirdapm marketplace updateunder the org dependency deny witnesses the sixOP=marketplace x PRIM x GATE=denied-dependencycells directly. The JSON is produced bypython -m tests.lifecycle.generatoron the merged tree, never hand-merged.w2-t3-lock-drift): M-SCOPE-LOCK drift spinew2-t1-b2-umkt(W2): M-GATE matrix batch 2credits()becomes the single definition of what a machine receipt discharges.Each batch alone on main:
w2-t1-b2-umkt: T-1 baseline 133 -> 95; total obligations shrink by U-MKT#4624 (W1, T-2 drain 2) and #4619 landed on main on their own and are no longer sources of this train.
Train, regenerated on the merged tree at 9e7046f (current main 11f8f58;
python -m tests.lifecycle.generator --counts):Baseline by lane: T-1 133 -> 95, T-3 240 -> 142, T-2 364 -> 362, T-7b 47 -> 46; other lanes unchanged.
W4's T-6b batch rides train 3.
Issue and approved scope
Issue: Refs #4564, Refs #4565
Human scope-approval comment: #4564 (comment)
Does this PR complete the issue, or what remains? No. #4564 closes at baseline <= 500.
Type of change
Testing
Results:
pytest tests/lifecycle/machines/test_m_scope_lock.py ...: 175 passed (test(lifecycle): M-SCOPE-LOCK drift spine for stale and absent lockfiles (T-3 batch 1) #4604)pytest tests/lifecycle/machines/test_m_gate.py::test_gate_matrix_credits_op_prim_gate_cells(project and user): 2 passed (w2-t1-b2-umkt)python -m tests.lifecycle.generator --check: up to datepytest tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/lifecycle/generator/test_generator_rules.py: 77 passedlint-auth-signals.sh,tests.quality.taxonomy --changed,check_test_assertions.py): cleanChangelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)