Repository navigation
test(lifecycle): M-SOURCE marketplace op, HOSTID and U-FIRST-PARTY-MCP (T-2 drain 3) - #4637
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]>
… 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]>
…P (T-2 drain 3) - U-FIRST-PARTY-MCP (lead ruling R4): an MCP server the project declares in its own apm.yml is first-party; the executables gate governs servers from dependencies (control-executables.mdx) and never parks it. The 8 pairs MCP source x executable-gate level map to one must-cover rule cell, rule|U-FIRST-PARTY-MCP|root-declared-mcp-not-gated, witnessed by the M-SOURCE gate-on install (configured, locked, no "Parked MCP server" line naming them). Machine rule ids credit themselves (witnesses.credited_ids). - Marketplace op: `apm marketplace update NAME` runs with catalog packages installed (single target, multi target, gate off) and must leave the project untouched; it earns T3/T5 cells of the marketplace forms and OP=marketplace context pairs. - HOSTID (E1), read from the observed lock row: the default host (bare key), a GHES host on port 8443 (host and port recorded) and the registry proxy (registry_prefix recorded, bare logical key), across install/lock/update/uninstall and the lock state each starts from. X ids now carry one or more FACTOR=value contexts. Counts: 1247/1242 -> 1196/1286 (T-2 412 -> 364; T-3 243 -> 240). 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 14:53
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The HOSTID receipts do not validate exact declaration values or canonical lock keys, and the refresh witness can pass from cache without proving catalog revalidation.
2 open issues
What changed in this PR
Extends the lifecycle test corpus for #4564, building on #4619 and #4624 to reduce unwitnessed obligations without changing production behavior.
Changes:
- Adds marketplace refresh checks and host/port/proxy identity coverage to M-SOURCE.
- Consolidates root-declared MCP executable-gate cases into one witnessed rule and supports multi-factor receipt contexts.
- Regenerates obligations and refusal replays, including bundle
--updaterejection and retirement of the fixed stale-pin failure.
| File | Description |
|---|---|
tests/quality/lifecycle_obligations.json |
Regenerates required cells, mappings, witnesses, and replay hashes. |
tests/lifecycle/replay/rows/generated_cover-15-refusals.yaml |
Receives the pack --update refusal case. |
tests/lifecycle/replay/rows/generated_cover-14-refusals.yaml |
Rebalances generated refusal cases. |
tests/lifecycle/replay/rows/generated_cover-13-refusals.yaml |
Adds bundle --update rejection with a message assertion. |
tests/lifecycle/model/state.py |
Adds an executable-gate state transition. |
tests/lifecycle/machines/test_m_source.py |
Adds marketplace, host identity, and root MCP checks; retires the stale-pin known failure. |
tests/lifecycle/generator/witnesses.py |
Supports multi-factor contexts and direct rule-cell credit. |
tests/lifecycle/generator/test_generator_rules.py |
Checks first-party MCP and bundle-refusal mappings. |
tests/lifecycle/generator/rules.py |
Defines first-party MCP equivalence and bundle modifier refusals. |
tests/lifecycle/generator/covering.py |
Includes configured refusal messages in generated replay steps. |
Review effort: Balanced
…h must revalidate Review on #4637: - HOSTID comes from the declaration (default host, GHES on port 8443, registry proxy) and the lock row must match it exactly: host, port, registry_prefix and the canonical unique key (bare, or host:port qualified); uninstall reads the pre-step lock. - `apm marketplace update NAME` must show a successful request for the named catalog in the egress log before it earns its receipts. Refs #4564 Co-authored-by: Copilot App <[email protected]>
Merged
3 of 10 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
… changes Rebase reds after the corpus PRs (#4637, #4619) met #3921's contract: - J05 (code + cells): the O6 oracle requires every changed file to be announced. The native report said '.agents/plugins' and 'Claude Code settings' without naming files; it now prints '.agents/plugins/' and each settings file it rewrote with its harness label. J05 expects the native deploy (no loose .claude/commands) and its cold replay removes every deployed root; golden regenerated. - M-SOURCE (cells): at project scope a Claude plugin deploys whole, so the model expects only its gated native unit; the oracle still observes the carried skill and MCP surfaces, so a loose deploy fails. The gate-off pass also asserts the plugin root is deployed (bin/ plugins stay parked without --trust-bin). 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
T-2 (M-SOURCE) drain 3, source PR for corpus train 3. Stacked on #4624 (train 2) and #4619; once they land, the top commit is the only change.
U-FIRST-PARTY-MCP (lead ruling R4). An MCP server the project declares in its own
apm.ymlis first-party. The executables gate governs executables "from dependencies" (enterprise/control-executables.mdx), andconsumer/install-mcp-servers.mdadmits a server by having you "Re-declare it in yourapm.yml". The 8 pairs MCP source (inline-mcp, mcp-registry) x executable-gate level (unapproved-exec, allowed, denied-executable, revoked-after-deploy) map to one must-cover rule cell,rule|U-FIRST-PARTY-MCP|root-declared-mcp-not-gated. The M-SOURCE gate-on install witnesses it: withexecutables.allowempty, each root-declared server is configured in.mcp.json, recorded in the lock, and named by noParked MCP serverline. GATE=none and the org-policydenied-dependencystay obligations. A change that starts gating root MCP fails this cell. Machine rule ids credit themselves (witnesses.credited_ids, shared with the test that checks credits), andtest_generator_rulespins the mapping.Marketplace op.
apm marketplace update NAMEruns three times with catalog packages installed: single target, multi target, and gate off. It must leave the project byte-identical (forbidden project writes; only the catalog cache under APM_HOME may change). It earns the T3/T5 cells of the marketplace forms (skill, hook, bin, MCP) and the OP=marketplace context pairs: NET, SCOPE, TGT, SELECT (named catalog), DEPLOYED=clean, GATE.HOSTID (E1), read from the observed lock row.
PROXY_REGISTRY_URL): the lock recordsregistry_prefix: artifactory/githuband keeps the bare logical key.Each runs across install, lock, update and uninstall, together with the lock state the step starts from (absent, stale, consistent). X ids now carry one or more
FACTOR=valuecontexts (X|install|git-object|HOSTID=qualified-host-port|LOCK=stale).Counts (
python -m tests.lifecycle.generator --counts):T-2 baseline: 412 -> 364. T-3 spillover: 243 -> 240.
Left for later batches (T-2): HOSTID x audit and x newer-generator lock, marketplace-git under the proxy or a ported host, marketplace op x lsp/canvas (needs catalog entries), approve-deny/audit per form, the marketplace-local/-file sources, and world extensions.
PR shard cost: 3 marketplace refreshes plus a HOSTID pass of 8 commands, about +20 s on CI. The running total of my additions is about +48 s of the +90 s budget.
Issue and approved scope
Issue: Refs #4564 (Refs #4565, the epic)
Human scope-approval comment: #4564 (comment). R4 is the Q&L lead's ruling on that scope.
Does this PR complete the issue, or what remains? No. #4564 closes when the baseline is <= 500 (now 1196).
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(engine driver, receipts dir set): 3 passed.pytest tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/lifecycle/generator/test_generator_rules.pywith those receipts: 79 passed (ratchet holds).Lint contract, each step with its real exit code:
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, andpython -m tests.lifecycle.generator --check: 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.