summaryrefslogtreecommitdiff
path: root/tests/test_release.py
diff options
context:
space:
mode:
authorOscar Wan <oscarwan@stanford.edu>2026-07-24 20:45:42 -0700
committerOscar Wan <oscarwan@stanford.edu>2026-07-24 20:45:42 -0700
commit15efc30e9e7179accd30375d3edb2e34a3b4dc5f (patch)
treeba1c49eb128e7906ba451141723d763e1dcda53a /tests/test_release.py
parent708f2af9c6985e9cb5cd53e434a7d3b8dfa2b4ac (diff)
updated generation process
Diffstat (limited to 'tests/test_release.py')
-rw-r--r--tests/test_release.py47
1 files changed, 43 insertions, 4 deletions
diff --git a/tests/test_release.py b/tests/test_release.py
index b825478..8927b14 100644
--- a/tests/test_release.py
+++ b/tests/test_release.py
@@ -4,7 +4,6 @@ import json
import pytest
-from gap_pipeline.models import KernelCandidate
from gap_pipeline.release import export_release
from gap_pipeline.store import RunStore, sha256_payload
from gap_pipeline.surface import SURFACE_FAMILIES
@@ -47,13 +46,52 @@ def test_offline_release_export_verifies_and_assembles(
kernel_root = tmp_path / "kernel-runs"
kernel_store = RunStore(kernel_root, item.item_id)
- candidate = KernelCandidate.model_validate(candidate_dict)
+ candidate = {
+ **candidate_dict,
+ "node_order": ["n1"],
+ "terminal_answer": "4",
+ }
kernel_store.write_final(
{
"item_id": item.item_id,
"status": "accepted",
- "accepted_candidate": candidate.model_dump(mode="json"),
+ "proof_dag": {
+ "nodes": [{"node_id": "n1", "claim": "claim", "dependencies": []}],
+ "terminal_node_id": "n1",
+ },
+ "method_plan": {
+ "nodes": [{"node_id": "n1", "method_label": "method"}]
+ },
+ "accepted_replacement_plan": {
+ "changes": [
+ {
+ "slot_id": "s1",
+ "source_node_id": "n1",
+ "description": "value",
+ "original_value": "1",
+ "replacement_value": "2",
+ "guard_condition": "positive",
+ "guard_justification": "2 is positive",
+ }
+ ],
+ "closure_statement": "closed",
+ },
+ "accepted_diffused_proof": {
+ "nodes": [
+ {
+ "node_id": "n1",
+ "dependencies": [],
+ "method_label": "method",
+ "instantiated_claim": "claim",
+ "justification": "reason",
+ }
+ ],
+ "terminal_node_id": "n1",
+ "terminal_answer": "4",
+ },
+ "accepted_candidate": candidate,
"accepted_candidate_sha256": sha256_payload(candidate),
+ "accepted_bundle_sha256": "bundle-sha",
}
)
@@ -70,7 +108,8 @@ def test_offline_release_export_verifies_and_assembles(
(output_root / "records" / f"{item.item_id}.json").read_text()
)
assert set(output["variants"]) == {*SURFACE_FAMILIES, "kernel_variant"}
- assert output["variants"]["kernel_variant"]["question"] == candidate.question
+ assert output["variants"]["kernel_variant"]["question"] == candidate["question"]
+ assert output["variants"]["kernel_variant"]["_meta"]["replacement_plan"]
with pytest.raises(FileExistsError):
export_release(
source_dataset=source_dir,