Repository navigation
test(lifecycle): corpus train 3 (combined: T-1/T-2/T-3/T-6a/T-6b/T-6e) - #4700
Merged
Merged
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]>
…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]>
…every operation
Discharges the T-6b pair obligations (DEPLOYED in {edited, unowned,
present-provenance-unknown} crossed with OP, modifiers, SRC, PRIM, GATE,
TGT and NET) with real-CLI oracle receipts in
tests/lifecycle/scenarios/test_ownership_siblings.py.
- The user's bytes are declared (Scenario.user_write) and must survive
(I1-X2); a closed gate that keeps them is exempt from I4 only when the
keep is announced and audit --ci detects it (I4-X2).
- Declared refusals earn credit only through EXPECTED_REFUSALS (exit code,
cause, the promise it upholds, its source); a refusal on any other pair,
or a declared pair that exits 0, fails the step
(tests/quality/test_scenario_refusal_credit.py negative controls).
- run(says=...) asserts announced outcomes and records them as evidence.
- Product failures are strict known cells: #4626 (edited hook, canvas and
LSP files overwritten silently), #4628 (a user's LSP entry taken over),
#4268 (refused install --mcp writes first), #4634 (local bundle reinstall
after a lost lockfile leaves MCP lock state the gates reject).
- TGT reads the declared target set before the step: narrowed drops at
least one declared target (a switch counts); widened adds and drops none.
T-6b obligations: 141 baseline -> 132 required, 6 known-failing, 3 baseline.
Refs #4564 #4565
Co-authored-by: Copilot App <[email protected]>
Two deterministic spines credit OP x PRIM x GATE for the side doors: apm install <local bundle> (a run-time packed p-bmix bundle with a skill, an instruction, a hook and an MCP server, plus the world's p-lsp bundle) and apm pack --dry-run over git dependencies, each at five gate levels (unapproved, denied before deploy, allowed, revoked after deploy, gate off). Every step runs I1-I9; bundle installs must leave exactly the per-bundle model set and record parked executables as pending; pack must ship exactly the dependency executables the gate deploys and never a managed MCP server. Refs #4564 Refs #4095 Co-authored-by: Copilot App <[email protected]>
Target history (ruling #3): install and every command after a declared target change, with real-CLI receipts crediting the scenario-lane pairs their assignments imply (CREDITS). U11 maps changed-TGT x FROZEN onto refusal|TGT=changed|FROZEN=on, witnessed by test_frozen_refuses_a_target_change. Strict known cells: #4636 (uninstall after a target change) and #4638 (frozen widened refusal leaves hook config). Refs #4564, #4565, #4100 Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…nerated) Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…main Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…ain-3 Co-authored-by: Copilot App <[email protected]>
…et-history rows Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Each offline row installs online, closes the network (closed proxy, as the source machine does) and runs one command through the scenario kit with I1-I9: a converged project (single and multi target), a local-only update, parked then denied executables, a native plugin, registry/MCP/bundle/pack sources and git/local/file marketplaces. 42 baseline cells become required. Refs #4104, #4565 Co-authored-by: Copilot App <[email protected]>
…ain-3c 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 21:38
6 of 10 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active test-evidence gaps assign coverage without valid witnesses, leave required pack receipts unmet, and allow stale output expectations or missing native-plugin ownership records to pass unchecked.
5 open issues
Use Git-only dependencies for pack history success receipts · New Remove unsupported project-scope bin coverage credits · New Credit registry coverage only to a registry-backed witness · New Track user-scope bin ownership in native-plugin checks · New Scope the stale-output expectation to the affected history row · New
What changed in this PR
This test-only PR expands APM’s lifecycle coverage toward the baseline-reduction goal in #4564, without changing product behavior.
Changes:
- Extends gate and lock-state machines across user scope, bundles, packing, and plugin binaries.
- Adds ownership, target-history, and offline scenarios with explicit refusal checks.
- Updates obligation generation and runs the new refusal-credit checks in CI.
| File | Description |
|---|---|
tests/utils/lifecycle_evidence.py |
Adds a known repeated-output expectation. |
tests/quality/test_scenario_refusal_credit.py |
Tests refusal-credit validation. |
tests/quality/test_generated_obligations.py |
Adds marketplace witness negative controls. |
tests/lifecycle/scenarios/test_ownership_siblings.py |
Expands ownership-preservation scenarios. |
tests/lifecycle/scenarios/test_network_offline.py |
Adds offline lifecycle scenarios. |
tests/lifecycle/scenarios/test_history_upgrade.py |
Adds target-history and frozen-refusal coverage. |
tests/lifecycle/scenarios/_kit.py |
Supports declared refusals and output evidence. |
tests/lifecycle/machines/test_m_scope_lock.py |
Adds stale/absent lock and side-door coverage. |
tests/lifecycle/machines/test_m_gate.py |
Runs expanded gate-machine scenarios. |
tests/lifecycle/machines/_kit.py |
Adds user-scope deployment observations. |
tests/lifecycle/machines/_gate_matrix.py |
Extends user-scope and marketplace gate coverage. |
tests/lifecycle/machines/_gate_bundle.py |
Adds bundle-install and pack gate machines. |
tests/lifecycle/machines/_gate_bin.py |
Adds user-scope plugin-bin gate coverage. |
tests/lifecycle/generator/witnesses.py |
Maps new machine and scenario witnesses. |
tests/lifecycle/generator/test_generator_rules.py |
Validates shared machine IDs and credits. |
tests/lifecycle/generator/rules.py |
Defines marketplace and frozen-target rules. |
tests/lifecycle/generator/emit.py |
Registers scenario-backed refusal witnesses. |
tests/lifecycle/generator/covering.py |
Excludes scenario refusals from generated replay rows. |
.github/workflows/main-architecture-ratchets.yml |
Runs refusal-credit checks on main. |
.github/workflows/ci.yml |
Runs refusal-credit checks in CI. |
Review effort: Balanced
…green on main 488a4b1) Co-authored-by: Copilot App <[email protected]>
…sts the refusal-credit module Co-authored-by: Copilot App <[email protected]>
A hook-only package, deployed and approved, loses its lockfile; a deny or a dropped approval then retires the hook on the next install. Refs #4564 #4565 Co-authored-by: Copilot App <[email protected]> (cherry picked from commit b260b74)
Co-authored-by: Copilot App <[email protected]>
…in-3c Co-authored-by: Copilot App <[email protected]>
Project-scope history and offline rows no longer credit PRIM=bin (U-BIN), pack history rows are refusals and credit nothing, the registry package stays in the scenario that selects the registry, user-scope scenarios observe plugin bin/ and set user_scope for I1, and the uninstall hint-repeat output cell (closed #4636) is retired. Co-authored-by: Copilot App <[email protected]>
5 of 14 tasks
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
Co-authored-by: Copilot App <[email protected]>
Adds W3's guard test_every_scenario_credit_names_a_collected_node (from danielmeppiel-w3-t6a-history-v2); the 40 target-history keys were built target-first and named nodes pytest never collects. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
…-read each local catalog Regenerate on the re-stack. refresh_marketplace(every=True) now adds a probe plugin to each local/file catalog before the refresh and credits their cells only when the command reports the refreshed count (2 plugins) for that catalog, then restores it: a skipped or stale read fails. 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
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 3 (combined), built as one coupled unit: one regenerated
tests/quality/lifecycle_obligations.json(never hand-merged;python -m tests.lifecycle.generator), one CI and Integration run, and each car merged with--no-ffso authorship is preserved. It supersedes #4614 (train 2), whose content is car 1.ql/corpus-train-2: #4604 (W2, M-SCOPE-LOCK drift spine) +w2-t1-b2-umkt(W2, M-GATE batch 2 and rule U-MKT)w2-t1-b3-bundle-pack+w2-t1-b4-bin(W2, M-GATE side doors)apm pack --dry-runat five gate levels (exact deployed and packed sets);bin/of a Claude marketplace plugin at user scope with--trust-binat five gate levels.danielmeppiel-t6b-ownership@26d604048 (W4, T-6b)danielmeppiel-w3-t6a-history@52ce20eeff3 (W3, T-6a)--frozenrefuses any declared-target change).danielmeppiel-w3-t6e-offline@00e1932e9 (W3, T-6e)ql-w1-t2-drain-4(W1, T-2 drain 4)Train-level fixes (no product change):
rules.py: U-MKT, U-FIRST-PARTY-MCP (main) and U11 kept side by side.test_ownership_siblings.py: main'stest_a_users_lsp_entry_is_never_taken_over([BUG] apm install takes over a user's own LSP server entry with the same name #4628 fix) replaces the T-6b duplicate. Its strict cell now tracks [BUG] A failed install on a user LSP entry conflict still changes apm.lock.yaml #4697 (install: lazy pre-write snapshot at the integrator write chokepoint #4282 closed while that path still changes the lock on a failed install).apm install -gstill rewrites ~/.apm/apm.lock.yaml (addsmcp_target_servers: {}) #4685 (bisected to fix(install): reconcile MCP/LSP before native Claude registration commits the lockfile (#4329) #4579), on the refusedinstall --trust-binstep.test_history_upgrade.py: the target-history row asserts the exit stays inside the command's contract (I8), so the assertion-quality ratchet has an observable outcome.machines/_kit.pyandscenarios/_kit.py: user-scope observations setuser_scope, so I1 reads native-plugin records; the scenario kit observes pluginbin/at user scope.merge-train.yml: its ratchet list includestests/quality/test_scenario_refusal_credit.py, matchingci.yml.PRIM=bin(U-BIN); pack andaudit --cihistory rows are refusals (no install runs between the target change and the command) and credit nothing; the registry package is credited only whereuse_registryselects it.Counts (
python -m tests.lifecycle.generator --counts)Baseline by lane, main -> train: T-1 133 -> 56, T-2 364 -> 220, T-3 240 -> 142, T-6a 201 -> 109, T-6b 141 -> 1, T-6e 42 -> 0, T-7b 47 -> 46; T-6c unchanged (28).
Known-failing cells, each a strict known cell citing an open issue:
pair|DEPLOYED=edited|GATE=allowed,pair|PRIM=canvas|DEPLOYED=edited,pair|PRIM=lsp|DEPLOYED=edited([BUG] apm install silently overwrites user edits to deployed hook, canvas and LSP files #4626)pair|PRIM=bin|DEPLOYED=unowned([BUG] A refusedapm install -gstill rewrites ~/.apm/apm.lock.yaml (addsmcp_target_servers: {}) #4685)pair|PRIM=lsp|DEPLOYED=unowned([BUG] A failed install on a user LSP entry conflict still changes apm.lock.yaml #4697)pair|SRC=inline-mcp|DEPLOYED=unowned(Detect MCP server config collisions during install preflight #4268)pair|SRC=local-bundle|DEPLOYED=present-provenance-unknown(Reinstalling a local bundle after the lockfile is lost leaves MCP lock state that audit --ci and install --frozen reject #4634)When one of these issues is fixed on main, the flip-on-close gate requires dropping its strict cell in the same pass.
Isolation from the product rows in the same landing window
tests/lifecycle/journeys/file is touched. test(lifecycle): split journey oracle O8 into O8a remediation and O8b diagnostic #4653 and test(lifecycle): re-ground 21 stale known cells; sign and gate every known cell #4584 (E01) are not cars of this train.tests/lifecycle/generator/rules.pywith [0.38] feat(policy): add --policy to apm install and apm update (#1925) #4001. The hunks are disjoint: [0.38] feat(policy): add --policy to apm install and apm update (#1925) #4001 edits the audit.py evidence anchors at lines 110-165, and this train edits the rule table from line 247 on.git merge-treereports no conflict in that file in either order. None of this train's new evidence anchors (commands/marketplace/__init__.py,install/service.py,install/frozen_withdrawal.py) point into a file [0.38] feat(policy): add --policy to apm install and apm update (#1925) #4001 or fix(audit): name a runnable remedy for a failed dependency-allowlist check #4596 changes.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
Run locally through the host guard (
-n 2), on the car heads before the final main fold:pytest tests/lifecycle/machines/test_m_gate.py tests/lifecycle/scenarios/test_history_upgrade.py tests/lifecycle/scenarios/test_ownership_siblings.py tests/quality/test_scenario_refusal_credit.py tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/lifecycle/generator/test_generator_rules.py: 239 passed, 1 failed. The failure was [BUG] A refusedapm install -gstill rewrites ~/.apm/apm.lock.yaml (addsmcp_target_servers: {}) #4685, now a strict known cell; that test and the [BUG] A failed install on a user LSP entry conflict still changes apm.lock.yaml #4697 test pass after the change.pytest tests/lifecycle/machines/test_m_scope_lock.pyplus the obligation tests on car 1 at main e182672: 95 passed.ruff check/ruff format --check(0.15.12), pylint R0801,scripts/lint-auth-signals.sh,scripts/check_complexity_ratchet.py --base-ref origin/main,scripts/check_test_assertions.py,scripts/check_exact_test_duplicates.py,python -m tests.quality.taxonomy --changed,python -m tests.lifecycle.generator --check: clean at the head.CI with the
full-integrationlabel is the authority for the combined head.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.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.