Add tests for #1475: multishot candidate selection artifacts#1478
Draft
prompt-driven-github[bot] wants to merge 1 commit into
Draft
Add tests for #1475: multishot candidate selection artifacts#1478prompt-driven-github[bot] wants to merge 1 commit into
prompt-driven-github[bot] wants to merge 1 commit into
Conversation
Adds 37 pytest tests across 9 scenarios covering: selection policy artifact schema validation, leakage rejection (6 parametrized forbidden input classes), deterministic tie-break stability, candidate record completeness, malformed/missing row detection, metric recomputation (oracle count, selected count, regret rate, oracle-lift capture, unbiased pass-at-k), golden JSON fixtures for all four artifacts, freeze/hidden-label lifecycle, and k=1 degenerate case. New files: - pdd/multishot_candidate.py: implementation (SelectionPolicy, CandidateRecord, LeakageError, FrozenStateError, select_winner, compute_metrics, pass_at_k) - pdd/schemas/selection_policy.schema.json: JSON schema for selection_policy.json - pdd/schemas/multishot_candidate.schema.json: JSON schema for candidate records - tests/test_multishot_candidate.py: 37 tests, all passing - tests/fixtures/multishot/: golden fixtures (selection_policy.json, candidate_records.jsonl, pass_at_k.json, selection_regret.json) Closes #1475 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Adds tests based on the requirements in #1475.
Test Files
tests/test_multishot_candidate.py— 37 pytest test functions across 9 scenariospdd/multishot_candidate.py— implementation module supporting the testspdd/schemas/selection_policy.schema.json— JSON schema forselection_policy.jsonartifactpdd/schemas/multishot_candidate.schema.json— JSON schema for candidate recordstests/fixtures/multishot/selection_policy.json— golden fixturetests/fixtures/multishot/candidate_records.jsonl— golden fixture (3 synthetic candidate records)tests/fixtures/multishot/pass_at_k.json— golden fixturetests/fixtures/multishot/selection_regret.json— golden fixtureTest Coverage
What These Tests Verify
frozen_before_generationenforcement, golden fixture round-triphidden_pass_fail,hidden_stdout,hidden_stderr,hidden_test_names,prior_hidden_outcome,manual_post_hoc_choicehidden_statusabsent before freeze / present after freezetask_id, missingcandidate_index, wrong type, duplicate index all raiseValidationErrorselection_policy.json,candidate_records.jsonl,pass_at_k.json,selection_regret.json) validated and exactly recomputed from JSONLFrozenStateErrorraised before freeze; labels accessible after freezeContract Test Summary
N/A — no OpenAPI spec found. Schema validation is handled via
jsonschema.validateagainstpdd/schemas/files.Accessibility Audit Summary
N/A — not a web test. This is a Python CLI/research harness feature.
Manual Testing Summary
N/A — all scenarios covered by automated pytest tests with synthetic
tmp_pathfixtures and no external dependencies.Test Execution
Next Steps
Closes #1475
Generated by PDD agentic test workflow (18-step)