Spaces:
Sleeping
Sleeping
Strengthen test generation prompt diversity
Browse filesFiles changed (2)
96 unmodified lines9798991001011021107 unmodified lines1210121112121213121412151216121796 unmodified lines- Prefer inputs that make multi-step behavioral mistakes visible rather than cosmetic differences.DIVERSITY REQUIREMENTS:- All {target_test_count} test cases must be DISTINCT. Do not repeat the same args.- Avoid near-duplicate tests that only change one number while keeping the same overall shape.- Vary both the VALUES and the STRUCTURE of inputs whenever the function allows it.1107 unmodified linesf"{len(unique_args)} unique argument tuples, and {len(diversity_signatures)} "f"input-shape patterns; the validator requires at least {required_patterns} "f"patterns and {minimum_unique_count} unique tuples. "f"Return valid JSON with at least {minimum_test_count} supported tests and do not repeat the ""previous arguments.")except json.JSONDecodeError as e:96 unmodified lines9798991001011021031041107 unmodified lines12121213121412151216121712181219122096 unmodified lines- Prefer inputs that make multi-step behavioral mistakes visible rather than cosmetic differences.DIVERSITY REQUIREMENTS:- Generate cases from at least 4 different input-shape families, not 4 variations of the same shape.- Include one simple happy-path case, one boundary/empty case, one mixed or longer-input case, and one unusual-but-valid case.- All {target_test_count} test cases must be DISTINCT. Do not repeat the same args.- Avoid near-duplicate tests that only change one number while keeping the same overall shape.- Vary both the VALUES and the STRUCTURE of inputs whenever the function allows it.1107 unmodified linesf"{len(unique_args)} unique argument tuples, and {len(diversity_signatures)} "f"input-shape patterns; the validator requires at least {required_patterns} "f"patterns and {minimum_unique_count} unique tuples. "f"This retry must cover at least 4 different input-shape families: ""a simple happy path, an empty or boundary case, a longer or mixed case, ""and an unusual-but-valid case. Do not repeat the previous arguments.")except json.JSONDecodeError as e:
528 unmodified lines52953053153253353446 unmodified lines581582583584585586528 unmodified linesretry_messages = llm.invoke.call_args_list[1].args[0]assert "Use input collections too." in first_messages[0].contentassert "10 supported tests" in retry_messages[1].contentdef test_test_generation_never_retries_more_than_twice():46 unmodified linessystem_prompt = llm.invoke.call_args.args[0][0].contentassert "EXACTLY 16 test cases" in system_promptassert "EXACTLY 25" not in system_promptassert messages[0] == "Generating test candidates (attempt 1/2)"assert "Checking test response" in messages[1]assert messages[-1] == "Accepted 16 candidate tests"528 unmodified lines52953053153253353453546 unmodified lines582583584585586587588528 unmodified linesretry_messages = llm.invoke.call_args_list[1].args[0]assert "Use input collections too." in first_messages[0].contentassert "10 supported tests" in retry_messages[1].contentassert "at least 4 different input-shape families" in retry_messages[1].contentdef test_test_generation_never_retries_more_than_twice():46 unmodified linessystem_prompt = llm.invoke.call_args.args[0][0].contentassert "EXACTLY 16 test cases" in system_promptassert "EXACTLY 25" not in system_promptassert "at least 4 different input-shape families" in llm.invoke.call_args_list[0].args[0][0].contentassert messages[0] == "Generating test candidates (attempt 1/2)"assert "Checking test response" in messages[1]assert messages[-1] == "Accepted 16 candidate tests"
architect/saboteur.py+5-2
test_saboteur_generated_test_validation.py+2