Files
Assistant/tests/research_contracts/truth_persistence_sql_test.go
m 53f86e4176
CI / test (push) Successful in 25s
CI / test (pull_request) Successful in 21s
feat(epistemics): persist truth bundles with source provenance
2026-08-22 15:16:42 +03:00

27 lines
655 B
Go

package research_contracts_test
import (
"os"
"strings"
"testing"
)
func TestTruthBundlePersistenceMigrationIsOwnedAndIdempotent(t *testing.T) {
payload, err := os.ReadFile("../../database/migrations/034_epistemics_truth_bundles.sql")
if err != nil {
t.Fatal(err)
}
script := string(payload)
for _, required := range []string{
"SET ROLE epistemics_role",
"CREATE TABLE IF NOT EXISTS epistemics.truth_bundles",
"UNIQUE (snapshot_id, excerpt_id, claim_id)",
"CREATE INDEX IF NOT EXISTS truth_bundles_source_time_idx",
"RESET ROLE",
} {
if !strings.Contains(script, required) {
t.Fatalf("migration missing %q", required)
}
}
}