Repository navigation
test(lifecycle): M-SOURCE context ids, native and bundle primitives (T-2 drain 1) - #4592
Daniel Meppiel (danielmeppiel) wants to merge 4 commits into
Conversation
…T-2 drain 1)
M-SOURCE now credits context ids X|<op>|<form>|<FACTOR>=<value> at the
real steps that ran in that state (scope, network, unchanged target set,
gate, a clean prior deployment, --force/--update/--frozen/--target), and
the generator reads each one as {OP, SRC, FACTOR}. Native plugins name
the primitives they carry (skill, mcp, bin via p-native-claude-bin), the
LSP bundle joins the bundle form, and compile/lock now act on a project
holding a local bundle. One context pass (multi-target, force/update,
frozen, bundle reinstall) adds 10 CLI steps to the spine.
Baseline 1468 -> 1380 (T-2 496 -> 408); one strict known cell:
X|install|pkg-registry|UPDATE=on (#4572, a git->registry source switch
leaves a stale .apm-pin until install --update drops it).
Also re-anchors the update.py evidence lines of the generator rules,
which drifted on main (test_every_rule_cites_code_that_still_says_it).
Refs #4564
Refs #4565
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Coverage receipts are credited without primitive-specific deployment or bundle artifact evidence, while shared target history incorrectly credits unchanged-target behavior across unrelated sources.
3 open issues
What changed in this PR
This PR advances the lifecycle coverage work in #4564 by extending M-SOURCE witnesses, reducing the baseline from 1,468 to 1,380 obligations without changing production code.
Changes:
- Adds context receipts for source, target, gate, scope, network, and install modifiers, plus a multi-target spine pass.
- Expands native-plugin primitive and local-bundle coverage; records the stale git-pin bug in #4572 as a strict known failure.
- Regenerates the obligation catalog with 87 additional required cells and one known-failing cell, and refreshes update-command evidence anchors.
| File | Description |
|---|---|
tests/quality/lifecycle_obligations.json |
Updates witness aliases, obligation statuses, counts, and digest. |
tests/lifecycle/machines/test_m_source.py |
Adds context crediting, fixtures, spine steps, and the strict known cell. |
tests/lifecycle/generator/witnesses.py |
Translates context IDs into factor assignments for generated obligations. |
tests/lifecycle/generator/rules.py |
Reanchors evidence references to current update-command lines. |
Review effort: Balanced
…nfigured
GATE=none is GateLevel('none', authority=None): no executables gate.
The lifecycle world configures executables.allow, so a skill-only
package there has no gate level; its GATE=none cells move to the
gate-off phase of the next batch.
Refs #4564
Co-authored-by: Copilot App <[email protected]>
…2-source-drain # Conflicts: # tests/quality/lifecycle_obligations.json
|
Superseded by the train #4598, test(lifecycle): corpus train 1 (T-1 batch 1 + T-2 drain 1). The train merges this branch with |
…gets, bundle ops) - Native plugins are observed by the primitives they carry (skill, MCP) as well as the gated native unit, so an unapproved native deployment is an I4 violation the oracle sees. - TGT=*-unchanged is judged per slot: a step is "unchanged" for a form only when that form's last resolving step ran under the same targets. The context pass installs the bundle twice under the multi-target set. - compile and lock no longer act on a local bundle in this batch: an unapproved bundle deploys nothing, so those cells wait for the gate-off batch, where its artifacts are deployed and checked. Baseline 1468 -> 1390 (T-2 496 -> 418), 1 strict known (#4572). Refs #4564 Co-authored-by: Copilot App <[email protected]>

Description
First T-2 (M-SOURCE) baseline drain of the 0.38 burn-down. 78 lifecycle obligations move from baseline to required (T-2 lane 496 -> 418). One more becomes a strict known cell, which a product bug found here now tracks.
tests/lifecycle/machines/test_m_source.pycreditsX|<op>|<form>|<FACTOR>=<value>throughoracles.check_obligation. The credit happens at the real steps that ran in that state: scope, network, unchanged single or multi target set, gate level of executable kinds (unapproved-exec;GATE=noneonly when no executables gate is configured, which the next batch witnesses), a clean prior deployment, and the--force,--update,--frozenand--targetmodifiers.X_CONTEXTlists the set statically, and the spine asserts that every id earns a receipt.tests/lifecycle/generator/witnesses.pyreads each id as{OP, SRC, FACTOR}. That discharges pairs likeSRC=native-plugin|FORCE=onandSRC=inline-mcp|TGT=multi-unchanged, which the spine already ran but never credited.p-native-claude-bin. They are observed by those primitives, so an unapproved native deployment is an I4 violation.p-lsp:bundle) joins the bundle form. Compile and lock of a bundle stay baseline until the gate-off batch deploys its artifacts (review). Update, prune and uninstall of a bundle stay U8 rule cells.context_pass()runs once in the spine: retarget to multi,install,install --force --update --target ...,install --frozen, a forced bundle reinstall, then retarget back. Unchanged-target credit is judged per slot (review).X|install|pkg-registry|UPDATE=on([BUG] A git-to-registry source switch leaves the stale git .apm-pin in apm_modules until install --update #4572). Switchingp-skillfrom git to the package registry leaves the git.apm-pininapm_modules/lifecycle/p-skill. It survives repeatedapm installuntilinstall --updatedrops it, so I2 fails on a converged state. The cell is matched on that exact path, sopair|SRC=pkg-registry|UPDATE=onis known-failing.Obligation counts (
tests/quality/lifecycle_obligations.json, regenerated on the merge with main0c349e03):T-2 baseline: 496 -> 418. Other lanes are unchanged.
PR shard cost: the spine adds 11 CLI steps. Profiled locally on the same host and run: 91 -> 101 commands, about +26 s at about 2.5 s per command, plus one bundle install after review. That is about +22 s at CI's roughly 2 s per command. The generated-sequence test is unchanged at 4 examples on PR and 25 nightly.
Issue and approved scope
Issue: Refs #4564 (Refs #4565, the epic)
Human scope-approval comment: #4564 (comment)
Does this PR complete the issue, or what remains? No. #4564 closes when the baseline is <= 500 (now 1390). The next T-2 batches cover 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
Commands run on the merged tree (engine driver,
.venv/bin/apm0.37.0,GIT_EXEC_PATHunset):pytest tests/lifecycle/machines/test_m_source.pywithAPM_LIFECYCLE_RECEIPTS_DIRset: 2 passed (spine 426 s on a loaded shared host, generated sequences 46 s).pytest tests/quality/test_promise_obligations.py -k merged_receiptsover those receipts: 1 passed (ratchet holds, nothing left to promote).pytest tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/lifecycle/generator/test_generator_rules.py: 74 passed.python -m tests.lifecycle.generator --check: up to date.uvx [email protected] checkandformat --check(src, tests, scripts) pass; pylint R0801 10.00/10;lint-auth-signals.shclean;check_complexity_ratchet.py --base-ref origin/mainclean;python -m tests.quality.taxonomy --changed: tm006 ok.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.