From e06ae41ed862fe0491068ae78cc4d74ed7bc8545 Mon Sep 17 00:00:00 2001 From: "Vitaly D." Date: Tue, 9 Jun 2026 04:54:23 +0300 Subject: [PATCH] test(research-radar): require bench handoff fields --- .../codex-experiment-proposal-prompt.md | 10 ++ .../templates/experiment-proposal.md | 8 ++ scripts/run-deterministic-tests.sh | 1 + ...arch_radar_experiment_proposal_contract.py | 94 +++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 tests/test_research_radar_experiment_proposal_contract.py diff --git a/research-radar/codex-experiment-proposal-prompt.md b/research-radar/codex-experiment-proposal-prompt.md index 568f52a..f052e4f 100644 --- a/research-radar/codex-experiment-proposal-prompt.md +++ b/research-radar/codex-experiment-proposal-prompt.md @@ -27,5 +27,15 @@ Required fields: - stop_condition - reason_not_to_implement_immediately +Inside `agent_bench_lab_eval_handoff`, include: + +- candidate_suite_or_task_family +- public_smoke_check +- private_holdout_need +- run_validity_or_harness_blocker +- baseline_setup +- candidate_setup +- comparison_metric + The proposal must explain why the experiment should remain separate from mainline feature work until approved. The proposal must not assume Agent Bench Lab is complete. If the benchmark layer cannot evaluate the idea yet, record the blocker instead of converting the idea into implementation work. diff --git a/research-radar/templates/experiment-proposal.md b/research-radar/templates/experiment-proposal.md index 2f0e3b2..a657292 100644 --- a/research-radar/templates/experiment-proposal.md +++ b/research-radar/templates/experiment-proposal.md @@ -20,6 +20,14 @@ ## Agent Bench Lab Evaluation Handoff +- Candidate suite or task family: +- Public smoke check: +- Private holdout need: +- Run-validity or harness blocker: +- Baseline setup: +- Candidate setup: +- Comparison metric: + ## Agent Bench Lab Blockers ## Fixtures or Benchmarks Needed diff --git a/scripts/run-deterministic-tests.sh b/scripts/run-deterministic-tests.sh index 061c209..c2a63f1 100755 --- a/scripts/run-deterministic-tests.sh +++ b/scripts/run-deterministic-tests.sh @@ -6,5 +6,6 @@ cargo test cargo clippy -- -D warnings cargo run --quiet -- eval-fixtures --json python3 research-radar/bin/validate_reports.py +python3 -m unittest tests.test_research_radar_experiment_proposal_contract python3 -m unittest tests.test_research_radar_shared_intake_dependency git diff --check diff --git a/tests/test_research_radar_experiment_proposal_contract.py b/tests/test_research_radar_experiment_proposal_contract.py new file mode 100644 index 0000000..6f69844 --- /dev/null +++ b/tests/test_research_radar_experiment_proposal_contract.py @@ -0,0 +1,94 @@ +from pathlib import Path +import unittest + + +ROOT = Path(__file__).resolve().parents[1] +TEMPLATE = ROOT / "research-radar" / "templates" / "experiment-proposal.md" +PROMPT = ROOT / "research-radar" / "codex-experiment-proposal-prompt.md" + +REQUIRED_HEADINGS = [ + "Title", + "Source URL", + "Source Type", + "Hypothesis", + "Affected Modules", + "Minimal Reversible Change", + "Expected Signal", + "Evaluation Plan", + "Agent Bench Lab Fit", + "Agent Bench Lab Evaluation Handoff", + "Agent Bench Lab Blockers", + "Fixtures or Benchmarks Needed", + "Contract Risk", + "Licensing and Attribution Notes", + "Security Notes", + "Stop Condition", + "Reason Not To Implement Immediately", +] + +REQUIRED_PROMPT_FIELDS = [ + "title", + "source_url", + "source_type", + "hypothesis", + "affected_modules", + "minimal_reversible_change", + "expected_signal", + "evaluation_plan", + "agent_bench_lab_fit", + "agent_bench_lab_eval_handoff", + "agent_bench_lab_blockers", + "fixtures_or_benchmarks_needed", + "contract_risk", + "licensing_attribution_notes", + "security_notes", + "stop_condition", + "reason_not_to_implement_immediately", +] + +REQUIRED_HANDOFF_LABELS = [ + "Candidate suite or task family", + "Public smoke check", + "Private holdout need", + "Run-validity or harness blocker", + "Baseline setup", + "Candidate setup", + "Comparison metric", +] + +REQUIRED_HANDOFF_PROMPT_FIELDS = [ + "candidate_suite_or_task_family", + "public_smoke_check", + "private_holdout_need", + "run_validity_or_harness_blocker", + "baseline_setup", + "candidate_setup", + "comparison_metric", +] + + +class ExperimentProposalContractTests(unittest.TestCase): + def test_template_contains_required_sections(self): + text = TEMPLATE.read_text(encoding="utf-8") + + for heading in REQUIRED_HEADINGS: + with self.subTest(heading=heading): + self.assertIn(f"## {heading}", text) + + def test_template_expands_agent_bench_lab_handoff(self): + text = TEMPLATE.read_text(encoding="utf-8") + + for label in REQUIRED_HANDOFF_LABELS: + with self.subTest(label=label): + self.assertIn(f"- {label}:", text) + + def test_prompt_lists_required_fields_and_handoff_fields(self): + text = PROMPT.read_text(encoding="utf-8") + + for field in REQUIRED_PROMPT_FIELDS + REQUIRED_HANDOFF_PROMPT_FIELDS: + with self.subTest(field=field): + self.assertIn(field, text) + + +if __name__ == "__main__": + unittest.main()