Skip to content

feat(ingest): add span re-anchoring and stale-span linter (Phase 5) (#450)#819

Merged
manavgup merged 3 commits into
mainfrom
worktree-agent-a952b11c
May 25, 2026
Merged

feat(ingest): add span re-anchoring and stale-span linter (Phase 5) (#450)#819
manavgup merged 3 commits into
mainfrom
worktree-agent-a952b11c

Conversation

@manavgup
Copy link
Copy Markdown
Owner

Summary

  • When a source is re-ingested, existing spans are re-anchored by fingerprint match — matched spans keep their IDs so claim references stay valid, unmatched spans are marked stale=True
  • New detect_stale_spans() linter rule surfaces articles with claims pointing to stale source spans (severity: WARN)
  • Alembic migration adds stale boolean column to sourcespan table

Changes

  • SourceSpan.stale field + migration
  • reanchor_spans() in ingest/spans.py — fingerprint-based matching
  • persist_spans() auto-delegates to re-anchoring when existing spans found
  • stale_spans.py linter rule wired into the lint pipeline
  • 7 new tests covering re-anchoring and stale detection

Test plan

  • 2150 unit tests pass
  • Lint and typecheck clean
  • CI green
  • Verify: ingest a URL, re-ingest with modified content → stale spans detected
  • Verify: linter surfaces stale-span findings

🤖 Generated with Claude Code

@github-actions github-actions Bot force-pushed the worktree-agent-a952b11c branch 3 times, most recently from e146c93 to 4d34356 Compare May 25, 2026 15:24
manavgup and others added 3 commits May 25, 2026 15:24
…450)

When a source is re-ingested, existing spans are matched to new spans by
fingerprint so claim references (source_span_ids) stay valid. Unmatched
old spans are marked stale. A new linter rule surfaces articles with
claims pointing to stale spans as structural warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot force-pushed the worktree-agent-a952b11c branch from 4d34356 to c2e9101 Compare May 25, 2026 15:24
@manavgup manavgup merged commit f59b160 into main May 25, 2026
@github-actions github-actions Bot deleted the worktree-agent-a952b11c branch May 25, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant