You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario.deployed() did not observe a project-scope native plugin, and projected_cells() dropped its gated native cell. So a scenario passed when an allowed plugin was never deployed or declared, and when a denied plugin stayed active.
This PR changes the lifecycle scenario kit only:
projected_cells() now keeps the gated native cell of a plugin installed whole ([FEATURE] Native plugins at project scope for Claude and Copilot #3921: p-native-claude* for claude/copilot at project scope). It still drops the plugin's loose kinds, so the existing check that loose copies are absent stays.
Scenario.deployed() observes that cell per target from two parts: the root .agents/plugins/<name>/.claude-plugin/plugin.json and the target's enabledPlugins declaration (.claude/settings.json or .github/copilot/settings.json). Either part makes the cell observed, so a denied plugin left active fails I4. The root counts as a managed path, so I1 also checks it against the lock's native fingerprint.
After each successful install or update (not dry-run), every allowed native cell must have both parts (Scenario.native_gaps). Only APM's <plugin>@apm-p-* key counts as the declaration. If the settings file holds declared user bytes, only the root is required. A plugin that ships bin/ must be whole only on a --trust-bin step; without trust it is parked whole.
New scenario test_a_native_plugin_is_one_gated_cell_at_project_scope (claude + copilot, kinds native/skill/mcp so loose copies are observed): install, approve, install, then deny and install.
New scenario test_a_native_plugin_with_bin_deploys_whole_only_when_trusted: an approved plugin that ships bin/ is parked until install --trust-bin deploys it whole.
Red first. I simulated each product defect with a temporary, uncommitted edit to src/apm_cli/claude_plugins/registrar.py, then ran these nodes: test_ownership_siblings.py::test_a_native_plugin_is_one_gated_cell_at_project_scope and test_network_offline.py::test_native_plugin_works_offline.
Simulated defect
kit on origin/main
kit in this PR
A: allowed plugin never declared (write_declaration replaced by a preview)
2 passed (gap)
2 failed: install: allowed native plugins not whole: ["p-native-claude/native/claude: found ['.agents/plugins/p-native-claude/.claude-plugin/plugin.json']", ...]
B: denied plugin left active (_retire returns False)
2 passed (gap)
new scenario fails: I1 ... deployed file is not in the lock: .agents/plugins/p-native-claude/.claude-plugin/plugin.json and I4 ... p-native-claude/native/... still deployed but not allowed
Without a simulated defect, both nodes pass with this PR's kit.
Validation commands, with results:
uv run --extra dev pytest tests/lifecycle/scenarios -n 2 -p no:cacheprovider -q -> 265 passed, 2 skipped (at head)
uv run --extra dev pytest tests/quality/test_promise_obligations.py tests/quality/test_scenario_refusal_credit.py -q -> 40 passed
Negative controls for the bin/ rule: with trust forced on, the untrusted install fails allowed native plugins not whole: ["p-native-claude-bin/native/claude: found [] .... With defect A, the --trust-bin install fails the same check.
uv run --extra dev python -m tests.lifecycle.generator --check -> [+] generated lifecycle obligations are up to date
ruff check and ruff format --check (ruff 0.15.12, CI paths) -> clean
python -m tests.quality.taxonomy --changed -> [+] tm006: 1 changed test module(s) carry their marker and promise
promise: P-INV-I4 -- a deny never increases what is deployed; the next mutating command removes what is no longer allowed (source: .agents/skills/apm-lifecycle-tests)
cell: OP=install SRC=native-plugin PRIM=native SCOPE=project TGT=multi GATE=denied-after-deploy owner: claude_plugins/registrar.py
instrument: target scenario -> tests/lifecycle/scenarios/test_ownership_siblings.py::test_a_native_plugin_is_one_gated_cell_at_project_scope (new: no scenario covered a project-scope native deny)
oracles: [I1, I4, native whole-cell] decisive: Scenario.native_gaps / I4 on p-native-claude/native/<target>
failing-before: simulated defects A/B on the main kit -> 2 passed (gap)
passing-after: same nodes on this kit -> pass; with A/B -> fail
guard+mutation: n/a ledger: n/a (gap in the test oracle, not a product defect)
hints executed: none printed
Changelog
One fragment per section, changelog.d/<pr>.<section>.md, holding
one line: user-visible effect first, 25 words or fewer, ending with (#PR); breaking changes only under upgrade notes; no Highlights; no
new lines under ## [Unreleased]. See changelog.d/README.md and .github/instructions/changelog.instructions.md.
…ations (#4808)
Scenario.deployed() now observes each Claude-format plugin installed whole
at project scope as one gated native cell per target: its root under
.agents/plugins and the target's enabledPlugins declaration. projected_cells()
keeps that native cell while still dropping loose copies. A successful
install must leave every allowed native cell whole; a denied plugin left
active fails I4.
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The lifecycle tests can accept unrelated plugin declarations, reject correctly preserved user disables, and miss unintended loose skill or MCP copies because of incomplete fixture coverage.
This PR strengthens the lifecycle scenario kit’s checks for project-scope native plugins in Claude and Copilot, addressing the test-oracle gap in #4808 without changing production behavior.
Changes:
Retains gated native cells while excluding loose plugin components from expected deployment.
Observes plugin roots and target declarations, and checks completeness after successful installs and updates.
Adds an approval-to-denial scenario covering both targets.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The tests incorrectly require native deployment without bin trust even when parking is valid, and the oracle accepts truthy non-boolean enable values that violate the settings contract.
Require native plugin enable values to be the boolean true
tests/lifecycle/scenarios/_kit.py:142
This accepts any truthy enable value, not just the JSON boolean true required by the native settings contract (src/apm_cli/native_plugins/settings.py:9). For example, an owned key with the string value "false" is observed as enabled, so native_gaps() passes when the root exists even though the plugin has no valid enabled declaration. Compare the value with True explicitly so malformed declarations cannot satisfy the whole-cell oracle.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The scenario helper raises on malformed settings before running the CLI, preventing tests from validating invalid-settings refusal and byte preservation.
With a native package in the scenario, malformed user settings (for example, {broken, or a nonempty list for enabledPlugins) now make the pre-command observation raise JSONDecodeError or AttributeError. Consequently, Scenario.run(..., exit=1) cannot exercise the CLI's supported invalid-settings refusal and byte-preservation behavior (native_plugins/settings.py::read_settings and _section), because the command never runs. Treat malformed or non-object settings as no observed declaration, allowing the exit-code and I1 checks to validate the refusal.
… regenerate
Keeps #4843's native observation (a root half plus the enabledPlugins declaration half, native_gaps). Builds _surface_hits on train 5's entry-aware surfaces (JsonEntry, MergedHooks) and _observable. projected_cells keeps #4843's native projection plus the shared-root loose skill (#4559). #4751fixed#4744, so the user-scope bin target-change cell drops its strict known and is required (known 9 -> 8, L15).
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
full-integrationRun the full integration suite (ci-integration.yml) on this PR before merge
2 participants
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
Scenario.deployed()did not observe a project-scope native plugin, andprojected_cells()dropped its gated native cell. So a scenario passed when an allowed plugin was never deployed or declared, and when a denied plugin stayed active.This PR changes the lifecycle scenario kit only:
projected_cells()now keeps the gatednativecell of a plugin installed whole ([FEATURE] Native plugins at project scope for Claude and Copilot #3921:p-native-claude*for claude/copilot at project scope). It still drops the plugin's loose kinds, so the existing check that loose copies are absent stays.Scenario.deployed()observes that cell per target from two parts: the root.agents/plugins/<name>/.claude-plugin/plugin.jsonand the target'senabledPluginsdeclaration (.claude/settings.jsonor.github/copilot/settings.json). Either part makes the cell observed, so a denied plugin left active fails I4. The root counts as a managed path, so I1 also checks it against the lock's native fingerprint.Scenario.native_gaps). Only APM's<plugin>@apm-p-*key counts as the declaration. If the settings file holds declared user bytes, only the root is required. A plugin that ships bin/ must be whole only on a--trust-binstep; without trust it is parked whole.test_a_native_plugin_is_one_gated_cell_at_project_scope(claude + copilot, kinds native/skill/mcp so loose copies are observed): install, approve, install, then deny and install.test_a_native_plugin_with_bin_deploys_whole_only_when_trusted: an approved plugin that ships bin/ is parked untilinstall --trust-bindeploys it whole.Issue and approved scope
Issue: Fixes #4808
Human scope-approval comment: #4808 (comment)
This PR completes the issue.
Type of change
Testing
Red first. I simulated each product defect with a temporary, uncommitted edit to
src/apm_cli/claude_plugins/registrar.py, then ran these nodes:test_ownership_siblings.py::test_a_native_plugin_is_one_gated_cell_at_project_scopeandtest_network_offline.py::test_native_plugin_works_offline.origin/mainwrite_declarationreplaced by a preview)2 passed(gap)2 failed:install: allowed native plugins not whole: ["p-native-claude/native/claude: found ['.agents/plugins/p-native-claude/.claude-plugin/plugin.json']", ...]_retirereturns False)2 passed(gap)I1 ... deployed file is not in the lock: .agents/plugins/p-native-claude/.claude-plugin/plugin.jsonandI4 ... p-native-claude/native/... still deployed but not allowedWithout a simulated defect, both nodes pass with this PR's kit.
Validation commands, with results:
uv run --extra dev pytest tests/lifecycle/scenarios -n 2 -p no:cacheprovider -q->265 passed, 2 skipped(at head)uv run --extra dev pytest tests/quality/test_promise_obligations.py tests/quality/test_scenario_refusal_credit.py -q->40 passedallowed native plugins not whole: ["p-native-claude-bin/native/claude: found [] .... With defect A, the--trust-bininstall fails the same check.uv run --extra dev python -m tests.lifecycle.generator --check->[+] generated lifecycle obligations are up to dateruff checkandruff format --check(ruff 0.15.12, CI paths) -> clean10.00/10bash scripts/lint-auth-signals.sh-> cleanscripts/check_complexity_ratchet.py --base-ref origin/main-> cleanpython -m tests.quality.taxonomy --changed->[+] tm006: 1 changed test module(s) carry their marker and promiseChangelog
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)