Skip to content

feat(agent): enforce claim-source attribution integrity (#81) - #83

Merged
atomicdragonranch merged 1 commit into
masterfrom
feat/attribution-integrity
Jul 9, 2026
Merged

atomicdragonranch merged 1 commit into
masterfrom
feat/attribution-integrity

Conversation

@atomicdragonranch

Copy link
Copy Markdown
Owner

Adds a DiagnosisReport model_validator that enforces referential integrity on the claim-source-mapping pattern:

  • every sourced claim's source_id must reference a real SourceRecord (UNSOURCED claims exempt)
  • every conflict must reference two real claims
  • source_id/claim_id uniqueness so references are unambiguous

Prevents the "attribution lost" failure the pattern exists to stop (a dangling reference = an untraceable finding). 5 new tests; full suite 207 passing, ruff + format clean.

Closes #81

Add a model_validator to DiagnosisReport that enforces referential integrity on
the claim-source-mapping pattern, so nothing in a diagnosis is untraceable:

- every sourced claim's source_id must reference a real SourceRecord (UNSOURCED
  claims are exempt, they explicitly have no backing source)
- every conflict must reference two real claims
- source_ids and claim_ids must be unique, so references are unambiguous

This closes the "attribution lost" failure the pattern exists to prevent: a
dangling source_id would leave a finding with no traceable origin. 5 new tests.

Closes #81
@atomicdragonranch
atomicdragonranch merged commit 5844f01 into master Jul 9, 2026
3 checks passed
@atomicdragonranch
atomicdragonranch deleted the feat/attribution-integrity branch July 9, 2026 17:39
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.

feat(agent): enforce claim-source attribution integrity

1 participant