Files
Assistant/tests/agent_execution/graph_persistence_sql_test.go
m 3d30681279
CI / test (push) Successful in 3m1s
CI / test (pull_request) Successful in 2m1s
feat: persist verified graph synthesis runtime
2026-08-23 01:52:39 +03:00

34 lines
1.1 KiB
Go

package agent_execution_test
import (
"os"
"strings"
"testing"
)
func TestGraphPersistenceMigrationIsRevisionScoped(t *testing.T) {
data, err := os.ReadFile("../../database/migrations/031_work_graph_persistence.sql")
if err != nil {
t.Fatal(err)
}
sql := string(data)
for _, marker := range []string{"work.graphs", "work.graph_nodes", "work.graph_edges", "PRIMARY KEY (graph_id, revision)", "FOREIGN KEY (graph_id, revision)"} {
if !strings.Contains(sql, marker) {
t.Fatalf("graph persistence marker missing: %s", marker)
}
}
}
func TestGraphSynthesisMigrationIsWorkOwnedAndAtomicInputsExist(t *testing.T) {
data, err := os.ReadFile("../../database/migrations/036_work_graph_result_synthesis.sql")
if err != nil {
t.Fatal(err)
}
sql := string(data)
for _, marker := range []string{"work.graph_result_candidates", "work.graph_conflicts", "work.graph_synthesis_candidates", "verifier_run_id", "dissent_candidate_ids", "FOREIGN KEY (graph_id, graph_revision)", "SET ROLE work_role"} {
if !strings.Contains(sql, marker) {
t.Fatalf("graph synthesis persistence marker missing: %s", marker)
}
}
}