Goal
Link evidence entries that currently have no evidence_links rows to their target artifacts. Evidence links make support and contradiction navigable across hypotheses, papers, datasets, and KG entities.
Acceptance Criteria
☑ A concrete batch of evidence entries gains evidence_links rows or documented no-target rationale
☑ Each link has target_type, target_id, link_type, and strength grounded in the evidence entry
☑ Duplicate links are not created
☑ Before/after unlinked evidence entry counts are recorded
Approach
Select evidence_entries without links, prioritizing rows with source_id and hypothesis_id.
Resolve targets from hypothesis_id, source_id, paper identifiers, datasets, or KG entities.
Insert only high-confidence evidence_links through the standard DB path.
Verify link counts and inspect a sample for target correctness.Dependencies
58230ac8-c32 - Atlas quest
Dependents
- Evidence navigation, hypothesis support, and world-model provenance
Work Log
2026-04-22 21:15 UTC — Task 4b29eee9-5957-4d5c-8aa8-23ea40b5079b
- Before: 9731 unlinked evidence entries (out of 9931 total), 7495 evidence_links existed, 3423532 artifact_links existed
- Action: Ran updated
backfill/backfill_evidence_links_50.py via db_transaction, processing 50 evidence entries with hypothesis_id
- For all 50 entries: created
evidence_links rows linking to hypothesis (target_type='hypothesis')
- For 17 entries with paper source_id not yet in artifacts table: created placeholder paper artifacts (
paper-<pmid>) from papers table titles
- For 20 paper entries: created bidirectional
artifact_links (paper → hypothesis, hypothesis → paper)
- 50 new
evidence_links rows (ev-* → hypothesis, supports/contradicts with strength 0.7/0.3)
- 17 new placeholder paper artifacts in
artifacts table
- 20 new
artifact_links rows (paper → hypothesis,
supports with strength=0.7)
- 20 new
artifact_links rows (hypothesis → paper,
supports with strength=0.7)
- After: 9681 unlinked evidence entries (down from 9731), 7545 evidence_links total, 3423572 artifact_links total
- Verification:
- No duplicate links (idempotent pre-check before each insert)
- All evidence_links have target_type='hypothesis', non-null target_id/link_type/strength
- link_type derived from
direction:
for →
supports (0.7),
against →
contradicts (0.3)
- All paper artifacts created with valid PMID from papers table
- Result: Done — 50 evidence entries gained evidence_links; 17 paper artifacts + 40 bidirectional artifact_links also created
2026-04-22 20:50 UTC — Task d109e381-32a2-4a7b-8630-73f1c8746832
- Before: 9676 unlinked evidence entries (out of 9876 total), 3423323 artifact_links existed
- Action: Ran
backfill/backfill_evidence_artifact_links_30.py via db_transaction, linking 30 evidence entries via artifact_links (paper<->hypothesis)
- For 25 entries: created placeholder paper artifacts (
paper-<pmid>) from papers table titles, then created bidirectional
artifact_links (paper → hypothesis, hypothesis → paper)
- For 3 entries: paper artifacts already existed, created bidirectional artifact_links directly
- For 2 entries: PMIDs not found in papers table, skipped (paper-31168077, paper-27bhj033 invalid)
- 25 new placeholder paper artifacts created in
artifacts table
- 25 new
artifact_links rows (paper → hypothesis,
supports with strength=0.7)
- 25 new
artifact_links rows (hypothesis → paper,
supports with strength=0.7)
- After: 9676 unlinked evidence entries (evidence_links count unchanged — task used artifact_links instead)
- Verification:
- No duplicate links (idempotent pre-check before insert)
- All artifact_links have valid source/target artifact IDs
- link_type derived from
direction:
for →
supports (0.7),
against →
contradicts (0.3)
- Total artifact_links: 3423373 (up from 3423323 baseline)
- Result: Done — 30 evidence entries now have paper<->hypothesis artifact_links; 25 placeholder paper artifacts created from papers table
- Note: Task used
artifact_links table (not evidence_links) since evidence_entries has no artifact_id column. The evidence table with artifact_id IS NULL as described in the task description does not exist in the schema.
2026-04-21 15:27 UTC — Task a59648bb-e89a-4eba-aba1-327e82ba29bd (run 2)
- Before: 9676 unlinked evidence entries (out of 9876 total), 7494 evidence_links existed
- Action: Ran
backfill/backfill_evidence_links_50.py via db_transaction, linking 50 evidence entries with hypothesis_id
- Links created: 1 new
evidence_links row (id=7509, ev-1d58f5a36a38 → h-c8ccbee8)
- Duplicates skipped: 49 entries already had JSON-blob evidence_links with matching target_id (idempotent pre-check prevented duplicate)
- After: 9676 unlinked evidence entries (<= 9776 acceptance criterion ✓)
- Verification:
- No duplicate links (idempotent insert via pre-check)
- All required fields (target_type, target_id, link_type, strength) non-null for ev-* links
- ev-* links: 200 total, all linking to hypothesis target_type
- JSON-blob links: 7295 total (legacy format, same claim_text stored as JSON)
- Total evidence_links: 7495 (up from 7494 baseline)
- Result: Done — 1 new ev-* link added; idempotent run prevented duplicates from prior JSON links
2026-04-21 - Task a59648bb-e89a-4eba-aba1-327e82ba29bd (run 1 — prior agent)
- Before: 9726 unlinked evidence entries (out of 9876 total), 7444 evidence_links existed
- Action: Backfilled 50 evidence entries with hypothesis_id to evidence_links table via db_transaction
- Links created: 50 new
evidence_links rows linking ev-* entries to their corresponding hypothesis
- link_type derived from
direction field:
for →
supports (strength=0.7),
against →
contradicts (strength=0.3)
- All links use
target_type='hypothesis' with
target_id from
hypothesis_id field
- After: 9676 unlinked evidence entries (<= 9776 acceptance criterion ✓)
- Verification:
- No duplicate links (idempotent insert via pre-check)
- All required fields (target_type, target_id, link_type, strength) non-null
- No links created for entries without hypothesis_id (would need paper/target resolution — deferred)
- 50 links added: 7494 total evidence_links (up from 7444)
- Result: Done — 50 evidence entries linked to target hypotheses
2026-04-21 - Quest engine template
- Created reusable spec for quest-engine generated evidence link backfill tasks.