test: guard screened discard universe counts#348
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29d7a9840f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _apply_candidate_screening_cross_validation( | ||
| workspace=workspace, | ||
| artifacts=artifacts, | ||
| records=records, | ||
| ) |
There was a problem hiding this comment.
Block completion on screened universe mismatches
When Scout/Screener writes an object-shaped screened_candidates.json whose declared total is smaller than candidate_claims.json, this new check only runs while building the artifact registry; the stage completion preflight still calls _validate_artifact directly via _completion_artifact_gate_reasons / _topology_satisfaction_required_reasons, so default-topology stage-complete --stage scout can mark both Scout and Screener complete and only then record screened_candidates as invalid. That leaves the producer stage frozen as complete with an artifact this commit now knows is invalid, instead of rejecting the completion transaction before state is advanced.
Useful? React with 👍 / 👎.
29d7a98 to
6afa0b1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6afa0b19a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not missing_screened_id and screened_ids != candidate_ids: | ||
| return "candidate_universe_id_coverage_mismatch" |
There was a problem hiding this comment.
Reject screened entries missing candidate IDs
When candidate_claims.json has stable IDs, any screened entry without candidate_id now disables the final universe coverage comparison because missing_screened_id makes this branch skip the set check. For example, a file can declare total_candidates: 2, include one selected item with no ID plus an excluded CAND-001, and pass as valid even though CAND-002 disappeared and CAND-001 is effectively duplicated. Since the new gate is meant to guard the screened universe and the Scout/Screener contract requires stable candidate IDs, missing IDs in this path should be invalid rather than bypassing coverage.
Useful? React with 👍 / 👎.
Summary
Boundary
Validation