Support legacy claim evidence fingerprints
This commit is contained in:
parent
604e1669c7
commit
ed827626db
2 changed files with 7 additions and 1 deletions
|
|
@ -45,6 +45,7 @@ SECURITY_DEFINER_ARGUMENT_TYPES = {
|
||||||
"assert_approved_proposal": "uuid, text, jsonb, text, uuid, timestamp with time zone, text",
|
"assert_approved_proposal": "uuid, text, jsonb, text, uuid, timestamp with time zone, text",
|
||||||
"finish_approved_proposal": "uuid, text, jsonb, text, uuid, timestamp with time zone, text, text",
|
"finish_approved_proposal": "uuid, text, jsonb, text, uuid, timestamp with time zone, text, text",
|
||||||
}
|
}
|
||||||
|
CLAIM_EVIDENCE_FINGERPRINT_ORDER = "ce.claim_id::text, ce.source_id::text, ce.role::text"
|
||||||
|
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
|
|
@ -976,7 +977,7 @@ select json_build_object(
|
||||||
'public.agents', {fingerprint("public.agents", "a", "true", "a.id::text")},
|
'public.agents', {fingerprint("public.agents", "a", "true", "a.id::text")},
|
||||||
'public.claims', {fingerprint("public.claims", "c", f"not ({claim_predicate})", "c.id::text")},
|
'public.claims', {fingerprint("public.claims", "c", f"not ({claim_predicate})", "c.id::text")},
|
||||||
'public.sources', {fingerprint("public.sources", "s", f"not ({source_predicate})", "s.id::text")},
|
'public.sources', {fingerprint("public.sources", "s", f"not ({source_predicate})", "s.id::text")},
|
||||||
'public.claim_evidence', {fingerprint("public.claim_evidence", "ce", f"not ({evidence_predicate})", "ce.id::text")},
|
'public.claim_evidence', {fingerprint("public.claim_evidence", "ce", f"not ({evidence_predicate})", CLAIM_EVIDENCE_FINGERPRINT_ORDER)},
|
||||||
'public.claim_edges', {fingerprint("public.claim_edges", "e", f"not ({edge_predicate})", "e.id::text")},
|
'public.claim_edges', {fingerprint("public.claim_edges", "e", f"not ({edge_predicate})", "e.id::text")},
|
||||||
'public.reasoning_tools', {fingerprint("public.reasoning_tools", "rt", f"not ({tool_predicate})", "rt.id::text")},
|
'public.reasoning_tools', {fingerprint("public.reasoning_tools", "rt", f"not ({tool_predicate})", "rt.id::text")},
|
||||||
'kb_stage.kb_proposals', {fingerprint("kb_stage.kb_proposals", "p", f"p.id <> {ap.sql_literal(proposal_id)}::uuid", "p.id::text")},
|
'kb_stage.kb_proposals', {fingerprint("kb_stage.kb_proposals", "p", f"p.id <> {ap.sql_literal(proposal_id)}::uuid", "p.id::text")},
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ sys.path.insert(0, str(ROOT / "scripts"))
|
||||||
import run_approve_claim_clone_canary as canary # noqa: E402
|
import run_approve_claim_clone_canary as canary # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
|
def test_unrelated_fingerprint_orders_legacy_claim_evidence_by_composite_key() -> None:
|
||||||
|
assert canary.CLAIM_EVIDENCE_FINGERPRINT_ORDER == ("ce.claim_id::text, ce.source_id::text, ce.role::text")
|
||||||
|
assert "ce.id" not in canary.CLAIM_EVIDENCE_FINGERPRINT_ORDER
|
||||||
|
|
||||||
|
|
||||||
def _passing_result(expected_rows: dict, expected_deltas: dict) -> dict:
|
def _passing_result(expected_rows: dict, expected_deltas: dict) -> dict:
|
||||||
proposal_id = "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"
|
proposal_id = "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue