Repository navigation
test: harden the receipt gate and the acceptance gate (#4586) - #4605
Merged
Daniel Meppiel (danielmeppiel) merged 11 commits intoNov 21, 2026
Merged
Conversation
1. lifecycle-full writes receipts to one directory and then runs the merged-receipt ratchet with APM_LIFECYCLE_RECEIPTS_REQUIRED=1, so every required witness must report; subset jobs are documented as such. 2. scripts/check_obligation_status_ratchet.py (Lint job, vs the base SHA): an obligation required at the base must stay required or known-failing unless the change adds and names a removal or mapping rule (lifecycle removed/mapped, security excluded, obligation_removals.json). 3. An e2e receipt needs at least one assertion fact (state, output line, pinned exit or expected/observed); Evidence() is refused. 4. Release acceptance: an unbound or missing findings ledger yields PENDING-VERIFICATION, never GO; 'add --sha' binds a walk without findings. Refs #4586, #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 11:49
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical validation gaps allow assertion-free receipts, invalid obligation waivers, stale-SHA findings, and missing required witnesses to pass, while valid ASCII-output evidence is incorrectly rejected.
5 open issues
What changed in this PR
This PR strengthens lifecycle evidence and release-acceptance checks for #4586, supporting the broader test-corpus work in #4565. It changes test, CI, and skill infrastructure without changing product behavior.
Changes:
- Adds required receipt checking to the nightly lifecycle run and rejects assertion-free e2e evidence.
- Adds a base-ref ratchet to detect required obligations that become baseline or disappear without a new removal rule.
- Makes missing or unbound acceptance ledgers pending and adds explicit SHA binding, documentation, and regression tests.
| File | Description |
|---|---|
tests/unit/test_release_acceptance_scripts.py |
Tests missing ledgers and explicit SHA binding. |
tests/unit/scripts/test_check_obligation_status_ratchet.py |
Tests demotions, exceptions, and unreadable base refs. |
tests/quality/test_promise_obligations.py |
Adds missing-witness and workflow-wiring checks. |
tests/quality/test_generated_obligations.py |
Adds assertion-free receipt negative controls. |
tests/quality/obligation_removals.json |
Introduces the named-removal registry. |
tests/lifecycle/oracles.py |
Requires assertion facts for e2e receipts. |
scripts/check_obligation_status_ratchet.py |
Implements the base-ref obligation status check. |
apm.lock.yaml |
Refreshes deployed skill content hashes. |
.github/workflows/main-architecture-ratchets.yml |
Includes the new ratchet fixture tests. |
.github/workflows/lifecycle-journeys.yml |
Persists and checks nightly lifecycle receipts. |
.github/workflows/ci.yml |
Runs the status ratchet and its fixture tests. |
.apm/skills/release-acceptance/SKILL.md |
Documents SHA binding for finding-free walks. |
.apm/skills/release-acceptance/scripts/findings.py |
Adds ledger binding and pending missing-ledger output. |
.agents/skills/release-acceptance/SKILL.md |
Updates the deployed acceptance instructions. |
.agents/skills/release-acceptance/scripts/findings.py |
Synchronizes the deployed ledger implementation. |
Review effort: Balanced
… CLI - Journey O3 receipts assert ascii_output; it is an output fact, so the e2e assertion-fact rule accepts it (the smoke journeys were refused). - The status ratchet tests are pure-function tests: marked unit (AQ003). - The ledger gate tests drive findings.py and assert its printed row, keeping the assertion-quality baseline flat. Refs #4586, #4565 Co-authored-by: Copilot App <[email protected]>
4 of 10 tasks
- findings.py add --sha refuses findings recorded for another SHA, so an
old walk cannot bind a ledger to a new SHA and yield GO for it.
- Required receipts cover generated witnesses too, scoped per job by
APM_LIFECYCLE_RECEIPTS_SCOPE: lifecycle-full requires tests/lifecycle
outside journeys; the journeys job requires the journey family on Linux.
- A removal waiver must be a non-empty string; null, false, 0, {} and ''
name no rule.
- State facts count only non-empty predicates: an empty path collection
or an egress log without a host expectation checks nothing. Journey O12
records its real fact (no refused host) as an expected/observed pair.
Refs #4586, #4565
Co-authored-by: Copilot App <[email protected]>
…gate-4586 # Conflicts: # apm.lock.yaml
…gate-4586 # Conflicts: # .github/workflows/ci.yml
The train guard ratchet step must match ci.yml's (#4586). Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-w3-receipt-gate-4586
branch
November 21, 2026 20:24
This was referenced Nov 22, 2026
Merged
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
Hardens the lifecycle receipt gate and the release-acceptance gate (issue #4586, epic #4565). Test and skill infrastructure only; no product change.
lifecycle-fulljob (.github/workflows/lifecycle-journeys.yml) writes receipts to$RUNNER_TEMP/lifecycle-receipts. A follow-up step then runstest_merged_receipts_hold_the_ratchetwithAPM_LIFECYCLE_RECEIPTS_REQUIRED=1, so every required promise witness must have reported. All seven required witnesses live intests/lifecycleoutside journeys, so this is the full-set job. The workflow documents the subset jobs that do not set the variable: the PR lifecycle smoke shards, the journeys job andgate-machine-nightly.scripts/check_obligation_status_ratchet.py --base-ref <sha>runs in the Lint job next to the complexity and taxonomy ratchets. It fails when an id that isrequiredat the base inlifecycle_obligations.jsonorgenerated_obligations.jsonisbaselineor absent at the head.known-failingstill counts as tracked. The only way out is a rule that the same change adds and names: a new generatorremovedormappedentry, a new securityexcludedentry, or a new entry intests/quality/obligation_removals.json(id -> rule or ruling, with its issue) for ids no generator rule can express. A rule that is already present at the base does not excuse a new demotion.check_obligationrefuses ane2eore2e-evidencereceipt with no assertion fact (Evidence.assertion_facts()). An assertion fact is a state fact, an output key line (match or forbid), anexpected/observedpair, or a pinned exit code; the pinned exit is the CLI result's own expected/observed pair, which journey O8 receipts use.Evidence()alone is refused.gate_rowin the release-acceptancefindings.pyreturns PENDING-VERIFICATION for an unbound ledger (shanull) as well as for a stale one.gate-rowon a missing ledger file still exits 2, and now also prints the PENDING-VERIFICATION row. A walk with no findings binds the ledger withadd --sha <sha>, so GO stays reachable; SKILL.md says so. The edits are made in.apm/skills/(source) and redeployed to.agents/skills/withapm install, which also updates the two content hashes inapm.lock.yaml.Issue and approved scope
Issue: Refs #4586, Refs #4565
Human scope-approval comment: the amended apm-scope:v1 record on #4586 (Decision: approve, review contact Daniel Meppiel (@danielmeppiel); it supersedes the earlier record and adds item 4).
Does this PR complete the issue, or what remains? It covers items 1-4 of the amended record. One deviation in test placement: the fixture tests for the status ratchet live in
tests/unit/scripts/test_check_obligation_status_ratchet.py, becausetest_ci_topologyrequires fixture-scope ratchet tests there. The other negative controls are intests/quality.Type of change
Testing
Fails before and passes after, or negative controls:
test_required_receipts_fail_when_one_witness_did_not_report(all witnesses but one report, so the required mode fails and names the missing one) andtest_the_full_lifecycle_run_requires_its_receipts(pins the workflow wiring; fails on main). Live proof, run locally: the seven required witnesses withAPM_LIFECYCLE_RECEIPTS_DIRset gave 7 passed;test_merged_receipts_hold_the_ratchetwithAPM_LIFECYCLE_RECEIPTS_REQUIRED=1then gave 1 passed.tests/unit/scripts/test_check_obligation_status_ratchet.py, 11 passed. A demotion or absence fails; known-failing and newly named removed, mapped and named-removal rules pass; a rule already at the base does not excuse a demotion; an unreadable base ref fails closed with exit 2.check_obligation_status_ratchet.py --base-ref origin/mainis clean on this branch and on test(lifecycle): re-ground 21 stale known cells; sign and gate every known cell #4584.test_e2e_receipt_needs_an_assertion_factfails on main and passes here.tests/unit/test_release_acceptance_scripts.py(unbound ledger, missing ledger in the library and the CLI,add --shabinding a walk without findings) fail on main; 54 passed here, and the matching-sha GO case is unchanged.pytest tests/quality/test_ci_topology.py tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/quality/test_test_taxonomy.pypassed locally. Two collect-only subprocess tests timed out under host load and passed when re-run alone.taxonomy --changedOK; taxonomy allowances did not grow.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)