Repository navigation
test(lifecycle): credits earned as claimed: unchanged targets, user-scope gate, per-target routes - #4756
Closed
Daniel Meppiel (danielmeppiel) wants to merge 1 commit into
Closed
test(lifecycle): credits earned as claimed: unchanged targets, user-scope gate, per-target routes#4756Daniel Meppiel (danielmeppiel) wants to merge 1 commit into
Daniel Meppiel (danielmeppiel) wants to merge 1 commit into
Conversation
…cope gate, per-target routes emit.lane_for routes TGT=*-unchanged offline pairs to T-6e (exact change tokens; bare TGT=changed stays T-6a). The M-GATE user pass opts the user manifest into the gate (a user approval never opens it) and asserts the lock records exec_status=deployed. File-routing rows assert the instruction under every current target's root and no dropped target's. Ledger status unchanged (531/5/1911). Refs #4564 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 22, 2026 15:06
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The compile and bundle-install checks omit targets, allowing the Copilot scenario to pass without verifying that its instruction exists under .github/instructions/.
1 open issue
What changed in this PR
This follow-up to #4711 strengthens lifecycle test evidence without changing production behavior or obligation statuses.
Changes:
- Routes unchanged-target offline obligations to the offline lane and adds regression coverage.
- Explicitly enables the executable gate for approval probes and checks deployed trust status.
- Adds instruction-routing assertions for current and dropped targets.
| File | Description |
|---|---|
tests/quality/lifecycle_obligations.json |
Moves two unchanged-target offline cells to T-6e. |
tests/lifecycle/scenarios/test_file_routing.py |
Adds per-target instruction placement checks. |
tests/lifecycle/machines/_gate_matrix.py |
Corrects approval gate modeling and verifies lockfile trust status. |
tests/lifecycle/generator/test_generator_rules.py |
Tests changed versus unchanged target lane routing. |
tests/lifecycle/generator/emit.py |
Matches exact target-change tokens instead of suffixes. |
Review effort: Balanced
| if route == "deployed": | ||
| assert marked, "a deployed instruction is a target file carrying the marker" | ||
| assert not any(name.endswith(("AGENTS.md", "GEMINI.md")) for name in marked), marked | ||
| for name in targets: |
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 22, 2026
Co-authored-by: Copilot App <[email protected]>
5 of 14 tasks
Collaborator
Author
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
Fast follow-up to #4711 (stacked on its frozen head c6da09b; retargets to
mainonce #4711 merges). It fixes three credit-integrity findings from Copilot's review of the earlier lapse train head. None of them changes an obligation status: the ledger stays at 531 / 5 / 1911 on #4711. With these fixes, the credits are earned the way the ledger claims.tests/lifecycle/generator/emit.py).lane_forusedendswith(("widened", "narrowed", "changed")), which also matchedsingle-unchangedandmulti-unchanged. An unchanged target set is not target history, sopair|TGT={single,multi}-unchanged|NET=offlinenow routes to T-6e (offline), not T-6a. Both cells stay required. The bareTGT=changedrefusal cell keeps T-6a. New case:test_generator_rules.py::test_only_a_changed_target_set_routes_an_offline_pair_to_target_historychecks the router and the committed ledger.tests/lifecycle/machines/_gate_matrix.py). The model turned the gate on for everyapprove. A user-scope approval (APM_HOME/config.json) never opens the gate, though:security/executables.pyenables it only for a manifestexecutables:block, a user deny or an org signal. So the user-scope "allowed" probes ran with the gate off. Nowapproveopens the gate only at project scope. The user pass opts the user manifest in withgate_on(), as the bin spine does, andassert_gate_enforcedchecks on the real CLI that the lock recordsexec_status: deployedfor each approved package.package_exec_decisionomits that status while the gate is off. The credited ids are unchanged and are now earned with the gate on.tests/lifecycle/scenarios/test_file_routing.py). A deployed-route row only checked that some file carried the instruction marker. It now asserts the marker under every current target's instruction root (KNOWN_TARGETS[...].primitives["instructions"]) and under no dropped target's.Issue and approved scope
Issue: Refs #4564, Refs #4565 (epic)
Human scope-approval comment: #4564 (comment)
Does not complete #4564: test-corpus credit-integrity fixes only.
Type of change
Testing
Local (host_guard, real CLI, -n 2):
test_file_routing.py,test_m_gate.py::test_gate_matrix_credits_op_prim_gate_cells(project + user),tests/lifecycle/generator,test_generated_obligations.py,test_promise_obligations.py,test_gate_cell_obligations.py: 111 passed.python -m tests.lifecycle.generator --checkis up to date; ledger status 531 / 5 / 1911 (unchanged; 2 lane moves).[email protected] check/format, AQ, duplicate and taxonomy ratchets are clean.Changelog
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)
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.