Skip to content

fix(contracts): accept truthful required-cleanup failure receipts - #1618

Merged
Brad-Edwards merged 4 commits into
devfrom
1612-cleanup-failure-receipts
Oct 17, 2026
Merged

Brad-Edwards merged 4 commits into
devfrom
1612-cleanup-failure-receipts

Conversation

@Brad-Edwards

Copy link
Copy Markdown
Collaborator

Summary

validate_trial_cleanup_receipt() now accepts truthful failed, partial, unsupported, and unverified cleanup receipts. Before this change, it rejected every receipt in which an owed required obligation did not succeed, whatever the cleanup status was. Each required obligation that the terminal trigger owes must still report an attempted result. When cleanup_status is succeeded, every owed result must succeed. Results must also agree with the obligation triggers. This unblocks OpenRAE/lilrae#435.

Requirement UIDs

  • SCE-007

Related Issues

Refs #1612

ADR Impact

  • ADR-084

Changes

  • trial_cleanup.py: split required-result coverage from the successful-cleanup check. Reject omitted, skipped, or not-triggered owed required results. Reject not-triggered for a triggered obligation and execution results for an untriggered obligation. Reject unsuccessful results when cleanup reports success.
  • cleanup-contracts.md: replace the unconditional-success rule with a table of admissible combinations.
  • trial-cleanup-receipt-v1 schema: update the invariant description, and update the publication record hash and last_change.
  • Add five valid receipt fixtures for failed, unverified, and unsupported cleanup across all terminal outcomes. A new test cross-validates every valid receipt fixture against the canonical plan fixture.
  • Batch and archival tests now accept a truthful failed cleanup after a successful trial, and reject false success and suppressed results.
  • requirement_order.yaml: map SCE-007 to a governance phase. SCE-007 traceability: add code, test, and issue links.

Test Plan

  • Unit tests pass
  • Integration tests pass if applicable
  • Full completion suite required in CI before merge
  • No coverage regression

The regression tests failed on the unmodified tree, including the issue's exact reproduction. Local targeted runs: the three pytest modules (163 passed), check_generated_schemas.py, check_schema_publication.py, and verify-fast-feedback with RAES_REQUIREMENT_UID=SCE-007.

Ground Control Checks

  • Repository policy checks required in CI before merge
  • Pre-push Codex review completed; all findings fixed or dispositioned

Traceability

  • IMPLEMENTS: SCE-007 ← implementations/python/packages/raes_contracts/contracts/trial_cleanup.py, SCE-007 ← contracts/schemas/control-plane/trial-cleanup-receipt-v1.json, SCE-007 ← specs/formal/scenario-variation-trial-realization/cleanup-contracts.md
  • TESTS: SCE-007 ← implementations/python/tests/test_sce_006_cleanup_contracts.py, SCE-007 ← implementations/python/tests/test_sce_006_batch_scheduler.py, SCE-007 ← implementations/python/tests/test_sce_002_trial_realization.py

Checklist

  • Code follows the project's coding standards
  • Changelog: owned by Release Please (generated from the Conventional Commit PR title; no per-PR fragment)
  • Architectural docs updated if stack, package structure, or key behaviors changed

Documentation

Updated: see diff.

@Brad-Edwards

Copy link
Copy Markdown
Collaborator Author

Ground Control delivery — this pull request delivers issue #1612; Phase E runs on merge.

@Brad-Edwards
Brad-Edwards merged commit e96deea into dev Oct 17, 2026
34 checks passed
@Brad-Edwards
Brad-Edwards deleted the 1612-cleanup-failure-receipts branch October 17, 2026 23:11
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.

1 participant