Repository navigation
test(lifecycle): M-SOURCE gate-off pass and bundle refusal rules (T-2 drain 2) - #4624
Merged
Merged
Conversation
#4597 fixed #4572 (a git -> registry switch now drops the stale .apm-pin) but left the strict KnownCell registry-source-switch-stale-pin in test_m_source.py. The cell no longer fails, so the source spine (test_source_spine_covers_every_form_and_op, lifecycle_smoke shard 4) fails strict on every PR. Drop the cell and its KNOWN_CELLS_BY_ID entry; the regenerated pair X|install|pkg-registry|UPDATE=on moves from known-failing to required. Refs #4572, #4565 Co-authored-by: Copilot App <[email protected]>
… drain 2) R1 (lead ruling): GATE=none means no executables gate is configured, the default user path. M-SOURCE gains a gate-off pass: drop the executables block, install every declared form, assert each declared MCP server (registry and inline) is configured in .mcp.json and recorded in the lock with no parking line, then restore the gate and install again (executables retire, I4). ModelState gains with_exec_gate; the X ids X|install|<form>|GATE=none are earned there for inline-mcp, mcp-registry, plugin-at-mkt, native and pkg-registry. R2: a local bundle install refuses --update (install.py rejected_flags, exit 2), so UPDATE leaves ACCEPTS["bundle-install"]; the covering replay pins the "not valid with a local bundle install" message on the refusal step (REFUSAL_MESSAGES). R3: a SRC=local-bundle pair carrying a modifier bundle install refuses (FROZEN, UPDATE) maps through U8 to bundle-install, then to its refusal cell. Counts: baseline 1253 -> 1245, required 1237 -> 1244 (T-2 418 -> 410). Refs #4564 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 13:18
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The lifecycle tests can credit invalid deployments because they fail to verify all expected plugins, removal of unapproved MCP servers after gate restoration, and exact server names.
3 open issues
What changed in this PR
This test-only PR advances the lifecycle coverage work in #4564 by exercising gate-disabled installs and mapping unsupported local-bundle modifiers to refusal cases. It also includes the stacked #4619 cleanup for the fixed stale-pin issue.
Changes:
- Adds a gate-off/install/gate-on sequence and MCP configuration checks to M-SOURCE.
- Adds bundle
--updaterefusal coverage and updates generator mappings. - Regenerates replay rows and lifecycle obligations, promoting five gate-off cells to required coverage.
| File | Description |
|---|---|
| tests/quality/lifecycle_obligations.json | Updates coverage status, refusal mappings, witnesses, and hashes. |
| tests/lifecycle/replay/rows/generated_cover-15-refusals.yaml | Receives the pack-update refusal step. |
| tests/lifecycle/replay/rows/generated_cover-14-refusals.yaml | Rebalances refusal steps. |
| tests/lifecycle/replay/rows/generated_cover-13-refusals.yaml | Adds bundle-update refusal and message checks. |
| tests/lifecycle/model/state.py | Adds an executable-gate state transition. |
| tests/lifecycle/machines/test_m_source.py | Adds gate-off coverage and retires the stale-pin known cell. |
| tests/lifecycle/generator/test_generator_rules.py | Checks local-bundle modifier refusal mappings. |
| tests/lifecycle/generator/rules.py | Defines bundle-update refusal and source mapping rules. |
| tests/lifecycle/generator/covering.py | Carries expected refusal messages into generated rows. |
Review effort: Balanced
6 of 10 tasks
Collaborator
Author
… are first-party Review on #4624: - Both installs of the gate-off pass now require the deployed set to equal the model's observable surfaces (as _gate_matrix does), so a parked native or marketplace plugin fails the GATE=none credit. - MCP server names are matched exactly (the registry server by its full id or short name), not by prefix. - Restoring the gate retires package executables, while the project's own MCP servers (declared in its apm.yml) stay configured and locked: they are first-party and never parked. The restore install asserts it. That also corrects drain 1: a root-declared MCP server has no executable-gate level while the gate is on, so the inline-mcp and mcp-registry X ids no longer claim GATE=unapproved-exec (2 pairs back to baseline; a removal rule is proposed to the lead). Counts: 1253/1238 -> 1247/1242 (T-2 418 -> 412). Refs #4564 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
force-pushed
the
ql-w1-t2-drain-2
branch
from
November 21, 2026 14:22
aa152c9 to
4e1eafc
Compare
6 of 14 tasks
Merged
3 of 10 tasks
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
T-2 (M-SOURCE) drain 2 for corpus train 2. It carries the three lead rulings on #4564: R1 is witnessed, R2 and R3 are applied.
Stacked on #4619 (the single owner of the #4572 main red). This branch contains #4619's commit
fc9857fc; once #4619 lands, the diff below it is the only change.R1: GATE=none is witnessed, not removed. GATE=none means no executables gate is configured (
GateLevel("none", authority=None)), which is the default user path.tests/lifecycle/machines/test_m_source.pygainsgate_off_pass():executablesblock (an edit step).io.github.lifecycle/p-registryand inlinep-inline) is configured in.mcp.json, recorded in the lock'smcp_servers, and printed noParked MCP serverline.Both installs require the deployed set to equal the model's observable surfaces (as
_gate_matrixdoes), and MCP names are matched exactly.ModelState.with_exec_gate()drives the reference model;expected_deployedalready treats GATE=none as deployable. The context idsX|install|<form>|GATE=noneare earned there for inline-mcp, mcp-registry, plugin-at-mkt, native and pkg-registry.R2. A local bundle install refuses
--update(src/apm_cli/commands/install.py:1299rejected_flags,install/local_bundle_handler.py:84, exit 2). UPDATE leavesACCEPTS["bundle-install"], withREFUSAL_EVIDENCEat install.py:1299. The covering replay now runsapm install <bundle> --updateas a refusal step and pins the messagenot valid with a local bundle install(REFUSAL_MESSAGES, used byrefusal_rows).R3. A
SRC=local-bundlepair that carries a modifier bundle install refuses (FROZEN or UPDATE) maps through U8 to bundle-install, then to its refusal cell.test_u8_mappings_name_the_cell_or_refusal_each_shape_lands_ongets the matching independent clause (2 cells).Not in this PR: the bundle's own GATE=none cell. With the gate off, a local bundle's MCP name clashes with the marketplace
p-execplugin ("Bundle MCP server name conflicts with another owner"; correct behaviour). Installing it alone shows that the reference model does not yet track bundle-deployed executables. That cell and compile/lock of a bundle come in a later batch.Counts (
python -m tests.lifecycle.generator --counts, on main 7fb04a1 + #4619):T-2 baseline: 418 -> 412. R1 witnesses 5 cells and R2/R3 map 3 cells to refusals. Review then exposed a drain-1 mislabel: root-declared MCP servers are first-party and never parked, so their 2
GATE=unapproved-execpairs return to baseline (removal rule proposed). One new required refusal cell is witnessed by the covering replay:refusal|OP=bundle-install|UPDATE=on, exit 2.PR shard cost: the gate-off pass adds 2 edits and 2 installs, plus 1 refusal step in the covering replay. That is about +6 s on CI.
Issue and approved scope
Issue: Refs #4564 (Refs #4565, the epic)
Human scope-approval comment: #4564 (comment). Rulings R1-R3 come from the Q&L lead on that scope.
Does this PR complete the issue, or what remains? No. #4564 closes when the baseline is <= 500 (now 1247). Next T-2 batches: the marketplace op and HOSTID, approve-deny and audit per form, the marketplace-local and marketplace-file sources, and world extensions.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
pytest tests/lifecycle/machines/test_m_source.py tests/lifecycle/replay/test_covering_replay.py -k "test_source or cover-13 or cover-14 or cover-15"(engine driver, receipts dir set): 5 passed.pytest tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/lifecycle/generator/test_generator_rules.py tests/lifecycle/modelwith those receipts: passed (generator rules 29/29 after the U8 oracle clause).python -m tests.lifecycle.generator --check: up to date.Lint contract:
uvx [email protected] checkandformat --checkpass;check_complexity_ratchet.py --base-ref origin/mainclean;python -m tests.quality.taxonomy --changedok.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.