Skip to content

test(lifecycle): T-1c, the plugin bin spine re-installs with each modifier (stacked on T-1b) - #5244

Merged
Daniel Meppiel (danielmeppiel) merged 18 commits into
mainfrom
w3e/lifecycle-t1c
Nov 24, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 18 commits into
mainfrom
w3e/lifecycle-t1c

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Lane T-1c of the lifecycle baseline (#4095 family). Stacked on #5242 (T-1b): its first commit is T-1b's, so review only the last commit (ae51bdb2) and merge it after #5242.

At the allowed gate level, the project plugin bin spine (tests/lifecycle/machines/_gate_plugin_bin.py) now re-installs the deployed, approved plugin with each modifier (--frozen, --update, --force, --dry-run, --target claude). Each re-install runs I1-I9 and the spine's outcome oracle (deployed set unchanged). The evidence requires the plugin root and the harness settings files to stay byte-identical, and the dry run must leave the whole project unchanged. bin_context names the factor context each such step proves, and the generator (witnesses.py) turns that context into non-anchored machine cells, the same way it already treats a deploying install.

8 obligations move from baseline to required:

  • pair|PRIM=bin|FROZEN=on
  • pair|PRIM=bin|UPDATE=on
  • pair|PRIM=bin|FORCE=on
  • pair|PRIM=bin|DRYRUN=on
  • pair|PRIM=bin|SELECT=on
  • pair|PRIM=bin|DEPLOYED=clean
  • pair|PRIM=bin|NET=online
  • pair|PRIM=bin|TGT=single-unchanged

No other obligation changes status or witness.

Later commits on this branch:

  • 5a41afba: pair|OP=mcp-install|PRIM=bin moves to required. The user bin spine already runs install --mcp at none, allowed and revoked-after-deploy while bin/ is deployed. Each step's evidence requires bin/ present and .agents/plugins byte-identical (U7), so the generator lets those ids also credit the OP x PRIM pair (anchored on PRIM).
  • 284c75bd: a guard test for the proposed rule below. It flips nothing.
  • d52be38c: model fix. expected_deployed crossed every kind with every declared target, so with claude and copilot declared it expected a copilot bin/ that the product never deploys (bin/ is Claude-only: exec_gate.plugin_bin_deployable, and a whole plugin enabled for Claude Code). KIND_TARGETS now bounds bin to claude. The new cell test_u_bin_seam.py::test_the_model_expects_bin_only_for_a_claude_target is red on the old model.
  • 6f7178b6: pair|PRIM=bin|TGT=multi-unchanged moves to required. At allowed the spine widens targets to claude and copilot, installs, re-installs unchanged (install-multi keeps bin/ byte-identical), then narrows back. Negative control (the model drops the approval on install-multi): I4 ... bin/claude still deployed but not allowed.
  • 7afc1d75: pair|OP=pack|PRIM=bin moves to known-failing, tracked by apm pack refuses a project with a project-scope native Claude plugin, and its "run apm install" hint does not fix it #5253, a product bug filed in this lane. apm pack over a project whose native Claude plugin is deployed whole exits 1 and calls the converged install "stale or partial". Its "run apm install" remedy was executed: install exits 0 and pack fails the same way. The strict known cell must keep failing with that signature; a pass fails the spine until it is flipped to required.
  • 55fcbf22: T1|OP=pack|PRIM=bin|GATE=denied-dependency moves to required. Under the org dependency deny, pack --dry-run over the project whose whole plugin carries bin/ exits 1 with "Pack blocked by org policy ... Nothing was packed", and the plugin root and settings stay byte-identical. The id carries the |plugin suffix because the pack spine already labels its own denied pack step with the plain id.

Rule U-BIN-BUNDLE (approved by QL; commit 2f5f5693)

A local bundle cannot deploy bin/ at any scope, so a bundle refusal says nothing about bin/. Evidence:

  • integrate_local_bundle (src/apm_cli/install/services.py:804) routes every packed file through bundle_deploy_relative_path (src/apm_cli/install/local_bundle_paths.py:125).
  • That function keeps only files under a primitive a target deploys (_lower_to_target and _is_primitive_deploy_path, local_bundle_paths.py:309-345).
  • No target declares a bin primitive.
  • exec_gate.plugin_bin_deployable (exec_gate.py:749) is called only by the package pipeline (deployment_plan.py:367, skill_integrator.py:1880), never by the bundle side door.

How the rule is added (tests/lifecycle/generator/rules.py), following U-BIN and U-USER-SCOPE-ORG-POLICY:

  • Definition: every PRIM=bin cell of OP=bundle-install or SRC=local-bundle is removed, including the org-deny level; the bundle spine still witnesses the deny's own refusal (pair|OP=bundle-install|GATE=denied-dependency stays required). Cells that U8 maps to a rule cell (prune, update, uninstall and marketplace over a local bundle) keep that mapping.
  • Evidence: four Ev citations, each pinned to a code snippet.
  • Self-reinstating: bin_pin.bundle_bin_digest hashes the three routing functions, and U_BIN_BUNDLE_PIN holds the approved digest, also recorded under pins in the obligations JSON. A changed digest makes the cells must-cover again (test_a_changed_bundle_routing_reinstates_the_bundle_bin_cells).
  • Tripwire: test_u_bin_seam.py::test_no_target_routes_a_bundle_bin_file probes 4 bin/ spellings for every target, with an anti-vacuity check on a claude skill path.

9 baseline obligations are removed (none was required):

  • T1|OP=bundle-install|PRIM=bin|GATE=denied-dependency
  • pair|OP=bundle-install|PRIM=bin
  • pair|SRC=local-bundle|PRIM=bin
  • T3|OP={approve-deny,audit,bundle-install,compile,lock}|SRC=local-bundle|PRIM=bin (W3d's five)
  • T3|OP=install|SRC=local-bundle|PRIM=bin (install of a local bundle is bundle-install; it was mapped there)

No other status, witness or mapping changes.

Issue and approved scope

Issue: Refs #4095

Human scope-approval comment: #4095 (comment) (lane T-1 corpus work, assigned by the QL VP).

Does this PR complete the issue, or what remains? Together with #5234 and #5242, every T-1 baseline obligation (#4095 lane T-1) is now required, known-failing with a filed issue (#5236, #5253), or removed by the approved U-BIN-BUNDLE rule. The 8 pair|OP=<op>|PRIM=bin pairs are W3d's T-2 lane.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation (engine driver, sequential through the host guard):

  • pytest test_m_gate.py::test_gate_plugin_bin_spine_credits_project_scope_prune_cells tests/lifecycle/generator tests/quality/test_generated_obligations.py tests/quality/test_gate_cell_obligations.py tests/quality/test_promise_obligations.py tests/quality/test_known_cells_cite_open_issues.py -n 0: 123 passed.
  • Negative control: the model was made to drop the approval on the context re-installs. Result: I4 ... p-native-claude-bin/bin/claude still deployed but not allowed, args install --trust-bin --frozen (1 failed), so those steps observe bin/.
  • python -m tests.lifecycle.generator --check: up to date. uvx ruff@0.15.12 check / format --check: clean.

Evidence row:

promise: P-INV-I4 -- a modifier never widens what the gate allows; a converged re-install keeps bin/ byte-identical (source: tests/lifecycle/oracles.py)
cell: PRIM=bin x {FROZEN, UPDATE, FORCE, DRYRUN, SELECT}=on, DEPLOYED=clean, NET=online, TGT=single-unchanged, SCOPE=project, GATE=allowed   owner: src/apm_cli/install/exec_gate.py
instrument: target rule -> tests/lifecycle/machines/test_m_gate.py::test_gate_plugin_bin_spine_credits_project_scope_prune_cells (extends the plugin bin spine)
oracles: [I1-I9, deployed set unchanged, check_obligation unchanged root+settings (dry run: whole project)]
failing-before: obligations baseline; negative control -> 1 failed
passing-after: 123 passed
guard+mutation: n/a     ledger: n/a
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.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…odifier at allowed

Lane T-1c (#4095): 8 PRIM=bin pairs flip to required: FROZEN, UPDATE,
FORCE, DRYRUN and SELECT (--target) each re-install the deployed,
approved plugin and keep bin/ byte-identical (the dry run writes nothing
in the project), on an online, single-unchanged-target project whose
bin/ is clean (DEPLOYED=clean, NET=online, TGT=single-unchanged).
Stacked on T-1b.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…nstall x bin pair

Lane T-1c (#4095): pair|OP=mcp-install|PRIM=bin flips to required. The
user bin spine runs install --mcp at none, allowed and
revoked-after-deploy while bin/ is deployed; each step's evidence
already requires bin/ present and .agents/plugins byte-identical (U7),
so those ids now also credit the OP x PRIM pair (anchored on PRIM).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Proposed rule U-BIN-BUNDLE (#4095 lane T-1c, for QL's ruling): no
target declares a bin primitive and bundle_deploy_relative_path keeps
only primitive files, so a local bundle deploys no bin/ at any scope.
This guard fails if that ever changes. No obligation is flipped.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
QL ruling on #4095 lane T-1c: every PRIM=bin cell of OP=bundle-install
or SRC=local-bundle is removed as vacuous for bin/, including the org
deny level (the bundle spine still witnesses the deny's refusal) and
W3d's five T3 local-bundle cells. Commands U8 maps to a rule cell keep
that mapping. Evidence is pinned to the routing code; bin_pin
bundle_bin_digest hashes bundle_deploy_relative_path, _lower_to_target
and _is_primitive_deploy_path, and a changed digest makes the cells
must-cover again. The tripwire test_no_target_routes_a_bundle_bin_file
fails if any target ever routes a bundle bin/ path.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
expected_deployed crossed every primitive kind with every declared
target, so with claude and copilot declared it expected a copilot bin/
surface the product never has: bin/ deploys only for a Claude target
(exec_gate.plugin_bin_deployable; a whole plugin enabled for Claude
Code). KIND_TARGETS bounds bin to claude; the new cell is red on the
old model.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…clared

Lane T-1c (#4095): pair|PRIM=bin|TGT=multi-unchanged flips to required.
At allowed the spine widens targets to claude and copilot, installs,
re-installs unchanged (install-multi keeps bin/ byte-identical), then
narrows back. Relies on the model fix that bounds bin/ to Claude.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… cell (#5253)

Lane T-1c (#4095): pair|OP=pack|PRIM=bin moves to known-failing, tracked
by #5253. At allowed the plugin bin spine runs pack --dry-run over the
deployed whole plugin; pack exits 1 calling the converged install stale,
and its apm install remedy does not change that. The cell must still
fail that way; a pass fails the spine until it is flipped to required.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…n refuses

Lane T-1c (#4095): T1|OP=pack|PRIM=bin|GATE=denied-dependency flips to
required. Under the org dependency deny the plugin bin spine runs
pack --dry-run over the project whose whole plugin carries bin/: it exits
1 with "Pack blocked by org policy ... Nothing was packed" and the root
and settings stay byte-identical. The id carries the plugin suffix, as
the pack spine already labels its own denied pack step.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	tests/lifecycle/machines/_gate_plugin_bin.py
#	tests/quality/known_cell_issue_states.json
#	tests/quality/lifecycle_obligations.json
Main's bundle frontmatter-hooks fixes add one skip (_declares_unapproved_hooks)
to bundle_deploy_relative_path; _lower_to_target and _is_primitive_deploy_path
are unchanged, so a local bundle still never routes bin/.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The pin omits the caller’s required target=target routing argument, allowing a regression that accepts bin/ paths to evade detection and leave bundle/bin obligations excluded.

1 open issue
What changed in this PR

Extends the lifecycle gate tests for #4095, building on T-1b to cover approved plugin bin/ re-installs and reduce remaining baseline obligations. Changes are limited to test infrastructure and generated coverage records.

Changes:

  • Adds modifier and multi-target re-install checks that preserve plugin files and settings.
  • Expands gate-operation coverage and records strict known failures for #5236 and #5253.
  • Adds the pinned U-BIN-BUNDLE exclusion and limits the model’s bin deployment surface to Claude.
File Description
tests/​quality/​lifecycle_obligations.json Regenerates obligation statuses, witnesses, exclusions and pins.
tests/​quality/​known_cell_issue_states.json Records the two tracked issues as open.
tests/​lifecycle/​model/​expected.py Limits expected bin deployment to Claude.
tests/​lifecycle/​machines/​test_m_gate.py Requires the plugin sequence to observe its strict known failures.
tests/​lifecycle/​machines/​_gate_plugin_bin.py Adds modifier, multi-target and gate-operation checks.
tests/​lifecycle/​generator/​witnesses.py Credits the added operations and modifier contexts.
tests/​lifecycle/​generator/​test_u_bin_seam.py Adds bundle-routing and target-model regression checks.
tests/​lifecycle/​generator/​test_generator_rules.py Checks bundle exclusions, pin invalidation and witness assignments.
tests/​lifecycle/​generator/​rules.py Defines the pinned U-BIN-BUNDLE exclusion.
tests/​lifecycle/​generator/​emit.py Emits the bundle-routing digest in generated obligations.
tests/​lifecycle/​generator/​bin_pin.py Computes the bundle-routing digest.

Review effort: Balanced

Comment thread tests/lifecycle/generator/bin_pin.py Resolved
# Conflicts:
#	tests/quality/known_cell_issue_states.json
…call (U-BIN-BUNDLE)

Without integrate_local_bundle's target=target, _lower_to_target(..., None)
would pass a bundle's bin/ through while the old digest stayed unchanged. The
pin now includes that keyword, and a mutation test removes it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unchanged re-installs skip convergence checks, allowing lock, manifest, or other project changes to earn receipts; enable the checks and verify them with a lock-semantics negative control.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The bundle-pin check is bypassed by an earlier removal branch for applicable cells, and the routing digest omits consulted target mappings and layout data, leaving coverage excluded after routing changes.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread tests/lifecycle/generator/bin_pin.py Resolved
Comment thread tests/lifecycle/generator/rules.py Resolved
#5253 closed with main's fix (pack names a whole native plugin), and main's
spine already runs pack at the allowed level, so the strict known cell and its
duplicate step go; witnesses keep the mcp-install U7 credit and take main's
pack credit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… not the org-deny refusal

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new filesystem-mutating test is marked as unit rather than component, violating the classification rules and including component work in unit-only selections.

1 open issue
2 resolved since last review

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 830a3ff into main Nov 24, 2026
74 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the w3e/lifecycle-t1c branch November 24, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants