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

This commit is contained in:
2026-08-01 06:29:50 -07:00
parent 2ed9d28c28
commit bb4dff9b56
5 changed files with 161 additions and 112 deletions
+6 -7
View File
@@ -20,12 +20,12 @@ class LabelSWEChatPromptsTests(unittest.TestCase):
"repoID": "repo",
"userID": "user",
"sessionID": "session",
"sourceTurnIDs": ["one", "two", "three"],
"sourceTurnIDs": ["one", "two"],
"prompt": "What is making this test fail?",
"teacherContext": ["It fails only on CI.", "Please diagnose it."],
"teacherResponse": "It fails only on CI.",
}
value["promptHash"] = prompt_hash(value["prompt"])
value["contextPromptHashes"] = [prompt_hash(item) for item in value["teacherContext"]]
value["teacherResponseHash"] = prompt_hash(value["teacherResponse"])
line = base.SourceLine(1, json.dumps(value), "line-hash")
return label_swe_chat_prompts.candidates([line])[0]
@@ -39,7 +39,7 @@ class LabelSWEChatPromptsTests(unittest.TestCase):
}]
}
def test_context_hashes_are_checked_and_context_dependent_labels_become_vague_eval(self):
def test_response_hash_is_checked_and_context_dependent_labels_become_vague_eval(self):
candidate = self.candidate()
decisions = label_swe_chat_prompts.validate_decisions(
[candidate], self.decision(candidate, False)
@@ -50,8 +50,8 @@ class LabelSWEChatPromptsTests(unittest.TestCase):
def test_candidate_rejects_context_hash_mismatch(self):
candidate = self.candidate()
value = json.loads(candidate.line.raw)
value["contextPromptHashes"][0] = "bad"
with self.assertRaisesRegex(ValueError, "contextPromptHashes"):
value["teacherResponseHash"] = "bad"
with self.assertRaisesRegex(ValueError, "teacherResponseHash"):
label_swe_chat_prompts.candidates(
[base.SourceLine(1, json.dumps(value), "line-hash")]
)
@@ -63,7 +63,6 @@ class LabelSWEChatPromptsTests(unittest.TestCase):
)
encoded = json.dumps(state)
self.assertNotIn("It fails only on CI.", encoded)
self.assertNotIn("Please diagnose it.", encoded)
if __name__ == "__main__":