Repository navigation
forge-engine: gate promotion on retained executions (R02/R04 gaps from #111) - #112
Merged
Merged
Conversation
- Count distinct trials by trial_id; contradictory records for one id do not count as completed (R02-N6). - One admission_gap() owner drives both the canonical lifecycle/promotion state and promote(): zero completed trials, invalid or unrecorded pair comparability, and trial-cited receipts absent from the bundle are not Verified/Eligible and are refused by promote() (R04-N2/N6/N7). - promote() resolves StoreRow raw-artifact receipts against tool_receipts and refuses unresolved ones. - Optional operator-owned lab.promotion_max_evidence_age_secs (default None: behaviour unchanged; the contract defines no TTL) (R04-N8). - Move the PR #111 gap tests in as r04_promotion_gate_tests; positive-path fixtures in promotion/r04_witness/export tests now carry the executions the gate requires.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
What this does
Addresses the five evidence/promotion gaps disclosed in #111. Four are closed by default: retained-execution admission, trial de-duplication, receipt resolution, and comparability. The fifth, stale evidence, is gated only when an operator sets
lab.promotion_max_evidence_age_secs; with the defaultNone, stale evidence is not refused.ExperimentEvidenceBundle::admission_gap()returns the first reason the retained executions cannot support a qualified claim: no completed trials, invalid comparability, no comparability verdict recorded, or a trial citing a receipt the bundle does not carry. Both the canonical lifecycle/promotion-state derivation andpromote()consult it, so they cannot disagree on retained-execution admission. The store-backed raw-artifact check is enforced inpromote()only (see Not closed here).distinct_completed_trial_count()counts trials bytrial_id; copies count once, and records sharing atrial_idthat contradict each other (side, attempt or completion) are not counted as completed.promote()now refuses with criterioncompleted_trials,pair_comparability,pair_comparability_missingortrial_receiptfrom that gap, and withraw_artifactwhen aStoreRowreceipt does not resolve to atool_receiptsrow (wrong table or missing row) through the storepromote()already holds.Blocked{…}; no completed trial or no comparability verdict derivesNotPromoted. Neither derivesEligible.lab.promotion_max_evidence_age_secs: Option<u64>, defaultNone(no change to current behaviour). When set,promote()refuses evidence older than the limit, dated in the future, or with an unparsablecreated_at(criterionevidence_age). Documented inPROMOTION.mdandCONFIG.md.Behaviour changes to note
StoreRowreceipt naming a table other thantool_receiptsis refused, because it cannot be resolved here.promotion_testsandr04_witness_testsfixtures built assessment-only bundles with zero trials — the case the contract forbids. Their fixtures now carry two distinct completed trials and a valid comparability verdict; their assertions are unchanged.export_tests::claim_metadata_carries_projected_verification_summarynow carries the two receipts its trials cite; asserted values are unchanged. Test counts in all three files are unchanged (5, 7 and 27) and no assertion line was removed; the fixtures only gained the data described.Evidence
On head
988102d(onmain4d030f8):cargo fmt --all -- --check, andcargo clippy --locked --workspace --all-targets --all-features -- -D warnings: clean.cargo test --locked --workspace --all-targets --all-features --no-fail-fast(root workspace): 3,614 passed, 0 failed, 7 ignored.tests/r04_promotion_gate_tests.rs(13 tests).4d030f8; the full gates above were re-run after it.These are local runs on one host; hosted CI results will be reported by this PR's own checks.
Not closed here
StoreRowraw artifact is absent still projects lifecycleVerified; onlypromote()refuses it. Closing that needs store-aware lifecycle derivation.ArtifactPathreceipts are not resolved (no operator-defined artifact root in this crate), and raw-artifact content hashes are not re-verified — only row existence.No provider call, deployment or activation.