Merge nucleic/plucky-north-vole-sdna into dev

This commit is contained in:
2026-08-01 16:26:15 -07:00
parent 97d63c7714
commit 8ac00de087
2 changed files with 16 additions and 1 deletions
+7 -1
View File
@@ -311,6 +311,10 @@ def record_from_decision(candidate: Candidate, decision: dict[str, Any]) -> dict
record = {field: decision[field] for field in SOURCE_FIELDS - {"prompt"}} record = {field: decision[field] for field in SOURCE_FIELDS - {"prompt"}}
record["prompt"] = candidate.prompt record["prompt"] = candidate.prompt
if not decision["recoverableFromFirst"]: if not decision["recoverableFromFirst"]:
# `vague-eval` records model first-message uncertainty, so they cannot also
# claim a context-derived second deliverable. Preserve the primary label only.
record["secondary"] = None
record["mixed"] = False
record["slice"] = "vague-eval" record["slice"] = "vague-eval"
validate_source_record(record, candidate.id) validate_source_record(record, candidate.id)
return record return record
@@ -334,7 +338,9 @@ def run(args: argparse.Namespace) -> dict[str, int]:
states = _load_state(args.state, by_line) if args.resume else {} states = _load_state(args.state, by_line) if args.resume else {}
pending = [candidate for candidate in source if candidate.line.number not in states] pending = [candidate for candidate in source if candidate.line.number not in states]
if args.limit_sessions is not None: if args.limit_sessions is not None:
pending = pending[:args.limit_sessions] # A resumed bounded canary/dry run retains its original total limit rather
# than processing another full limit beyond already persisted decisions.
pending = pending[:max(0, args.limit_sessions - len(states))]
batch_list = batches( batch_list = batches(
pending, batch_size=args.batch_size, batch_chars=args.batch_chars, pending, batch_size=args.batch_size, batch_chars=args.batch_chars,
max_prompt_chars=args.max_prompt_chars, max_response_chars=args.max_response_chars, max_prompt_chars=args.max_prompt_chars, max_response_chars=args.max_response_chars,
+9
View File
@@ -90,6 +90,15 @@ class LabelSWEChatPromptsTests(unittest.TestCase):
self.assertEqual(candidate.prompt, record["prompt"]) self.assertEqual(candidate.prompt, record["prompt"])
self.assertNotIn(candidate.response, record.values()) self.assertNotIn(candidate.response, record.values())
def test_unrecoverable_mixed_decision_becomes_single_purpose_vague_eval(self):
candidate = self.candidate()
decision = self.decision(candidate, False)["items"][0]
decision.update({"secondary": "frontendImpl", "mixed": True, "slice": "mixed"})
record = label_swe_chat_prompts.record_from_decision(candidate, decision)
self.assertEqual("vague-eval", record["slice"])
self.assertFalse(record["mixed"])
self.assertIsNone(record["secondary"])
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()