A fact without a source is a rumour with good formatting. Attribution
is the practice of keeping every stored fact linked to the
observation, document, or conversation that produced it, so that any
later reader can check it, any later contradiction can be weighed,
and any later deletion can propagate to the claims built on it. This
sub-skill supports its parent, ../../SKILL.md, because an evaluation
that cannot trace a claim to its source cannot judge whether the
claim is true, only whether it sounds plausible. It builds on
../../../memory-capture/SKILL.md, which covers recording sources at
capture time, and adds the formats, checks, and audits that keep
those links alive.
Quick Workflow
- Give every source a stable identifier at capture time, using the
scheme in section 1, and never reuse an identifier for new content.
- Attach source identifiers to every derived record, including
summaries and promoted semantic facts.
- Propagate confidence from source quality, not from how often a
claim has been repeated, using section 2.
- Check attribution before acting, meaning every claim behind an
action must resolve to a live source.
- Audit attribution regularly, and demote or quarantine records
whose sources are gone or broken.
- When a source is corrected or retracted, propagate that change to
every record that cites it, and log the propagation.
1. Source identifiers and citation formats
A source identifier must be stable, unique, and resolvable. Stable
means the same source keeps the same identifier across exports and
restores. Unique means two different observations never share one.
Resolvable means a reader with the identifier can find the source
content, or a clear tombstone explaining why it is gone. The schema
below is the minimum useful shape for a source record.
{
"source_record": {
"id": "src_20261027_0011",
"kind": "observation",
"agent": "hunter-01",
"captured": "2026-10-27T05:00:00Z",
"location": "scan run 2026-10-27 on 10.0.1.5, port 22 open",
"content_hash": "sha256:9f2c4a1b8d3e6f50718293a4b5c6d7e8f90123456789abcdef0123456789abcd",
"quality": "direct_observation",
"retracted": false
}
}
Source kinds used in this store:
- direct_observation, meaning a command output or tool result the
agent saw itself. Highest quality for operational facts.
- document, meaning a file, page, or report. Quality depends on the
document's own freshness and authority, recorded alongside.
- conversation, meaning a human or agent statement. Quality depends
on who said it and whether it was verified afterwards.
- derived, meaning a summary or promotion of other sources. A
derived source must list its own sources, forming a chain, never a
dead end.
Citation format in stored text is the bare identifier, such as
src_20261027_0011, placed directly after the claim it supports.
Human-facing output may render it as a footnote or link, but the
stored form keeps the identifier in plain text, so that grep, SQL,
and audits can all follow it without a rendering step.
2. Confidence propagation from source quality
Confidence must flow from sources to claims, not from repetition.
A claim repeated in ten summaries is still only as strong as its one
original observation. The propagation rules below keep that honest,
and they are deliberately conservative, because inflated confidence
is how a guess becomes an action.
"""Confidence propagation: a claim is only as strong as its sources."""
SOURCE_QUALITY = {
"direct_observation": 0.95,
"document": 0.80,
"conversation": 0.60,
"derived": 0.70,
}
def claim_confidence(source_qualities, corroboration=1):
"""Weakest-link base, with a small bonus for independent agreement."""
if not source_qualities:
return 0.0
base = min(SOURCE_QUALITY.get(q, 0.5) for q in source_qualities)
bonus = 0.05 * (corroboration - 1)
return round(min(0.98, base + bonus), 3)
# One direct observation: 0.95. Two independent direct observations: 0.98.
# One conversation report: 0.60, however often it is repeated, because
# repetition of the same source is not corroboration.
Rules that follow:
- Corroboration counts independent sources only. Two summaries of
the same observation are one source, not two.
- A derived record inherits the weakest quality in its chain, not
the average, because a chain breaks at its weakest link.
- A claim with no sources has confidence 0.0 in the store, whatever
the text says, and recall filters that enforce a confidence floor
will hide it, which is the correct behaviour.
- When a source is retracted, every claim citing it drops to 0.0
until fresh evidence arrives, and the drop is logged.
3. Attribution checks before acting
Before an agent acts on recalled knowledge, it checks that the
knowledge is attributable, meaning each load-bearing claim resolves
to a live, unretracted source of acceptable quality. The check below
runs that gate in code, so it cannot be skipped by enthusiasm.
"""Attribution gate: block actions resting on unattributed claims."""
def attribution_gate(store, claims, min_quality="document"):
quality_rank = {"direct_observation": 3, "document": 2,
"conversation": 1, "derived": 2}
floor = quality_rank[min_quality]
failures = []
for claim in claims:
sources = store.sources_for(claim.id)
if not sources:
failures.append((claim.id, "no sources attached"))
continue
live = [s for s in sources if not s.retracted]
if not live:
failures.append((claim.id, "all sources retracted"))
continue
best = max(quality_rank.get(s.quality, 0) for s in live)
if best < floor:
failures.append((claim.id, "best source below quality floor"))
return failures
# An empty failures list means the action may proceed. Any failure
# means verify live first, or choose a different course of action.
Set the quality floor per action, not per store. A report draft can
rest on conversation sources flagged as such. A change to a system
needs direct observation or a trusted document, verified fresh. When
the gate fails, the correct response is fresh verification, not
lowering the floor to make the check pass.
4. Attribution audits and retraction propagation
Attribution decays. Sources are deleted, documents move, and
summaries get copied without their links. A regular audit finds the
decay before it causes a wrong action. The audit below reports the
three numbers that matter, meaning how many semantic records lack
sources, how many cite retracted sources, and how many cite sources
that no longer resolve.
-- Attribution audit: sourceless facts, retracted sources, dead links
SELECT 'semantic_without_sources' AS problem, COUNT(*) AS records
FROM memory_records
WHERE layer = 'semantic'
AND (sources IS NULL OR sources = '[]')
UNION ALL
SELECT 'citing_retracted_sources', COUNT(*)
FROM memory_records r
JOIN memory_sources s ON s.id IN (SELECT value FROM json_each(r.sources))
WHERE s.retracted = 1
UNION ALL
SELECT 'citing_missing_sources', COUNT(*)
FROM memory_records r
WHERE EXISTS (
SELECT 1 FROM json_each(r.sources) j
WHERE NOT EXISTS (SELECT 1 FROM memory_sources s WHERE s.id = j.value)
);
Retraction propagation procedure:
- Mark the source retracted, with a reason and a date, instead of
deleting it outright, so existing citations resolve to a clear
tombstone rather than a mystery.
- Find every record citing the source, drop its confidence to 0.0,
and flag it for review.
- Notify owners of open tasks that cited the retracted source, when
the task is still active.
- After the review window closes, delete or rewrite the affected
records, and keep the tombstone so future citations fail loudly
instead of silently pointing nowhere.
Edge cases
- A source is a live system state, such as an open port. Its
identifier records the observation time, and the claim is only as
fresh as that time. Re-verify before acting, however good the
attribution looks.
- A claim has many sources but they all derive from one observation.
Count it as one source. The chain, not the count, decides strength.
- A source is sensitive and cannot be shared with the reader. Cite
the identifier and the quality level, and let an authorized reader
resolve the content, rather than dropping the citation entirely.
- A summary quotes a source verbatim. The quote keeps the source
identifier attached, so the quote cannot drift away from its
evidence in later copies.
- Attribution and privacy conflict, because a source contains
personal data. Keep the identifier and the quality, redact the
content, and record that the content was redacted and when.
Key references
1---2name: memory-source-attribution3description: Use when a recalled fact must be traced back to the observation, document, or conversation that produced it, or when an agent answer needs verifiable provenance. Covers source identifiers and citation formats, confidence propagation from source quality, attribution checks before acting, and audits that catch unattributed or misattributed claims, with scoring terms for source attribution, provenance tracking, citation verification, and evidence chains.4version: 1.0.05domain: memory6lifecycle: stable7last_verified: "2026-10-27"8requires: [memory-capture]9extends: []10relates: [memory-recall, memory-consolidation, memory-evaluation-failures]11parent: memory-evaluation-failures12tools:13 - name: memory-store14 version: 1.0.015 - name: SQLite16 version: 3.45.117 - name: Python18 version: "3.12"19metadata:20 source: https://skillmd.com/skills/mizazhaider-ceh/memory-source-attribution21---2223A fact without a source is a rumour with good formatting. Attribution24is the practice of keeping every stored fact linked to the25observation, document, or conversation that produced it, so that any26later reader can check it, any later contradiction can be weighed,27and any later deletion can propagate to the claims built on it. This28sub-skill supports its parent, ../../SKILL.md, because an evaluation29that cannot trace a claim to its source cannot judge whether the30claim is true, only whether it sounds plausible. It builds on31../../../memory-capture/SKILL.md, which covers recording sources at32capture time, and adds the formats, checks, and audits that keep33those links alive.3435## Quick Workflow36371. Give every source a stable identifier at capture time, using the38 scheme in section 1, and never reuse an identifier for new content.392. Attach source identifiers to every derived record, including40 summaries and promoted semantic facts.413. Propagate confidence from source quality, not from how often a42 claim has been repeated, using section 2.434. Check attribution before acting, meaning every claim behind an44 action must resolve to a live source.455. Audit attribution regularly, and demote or quarantine records46 whose sources are gone or broken.476. When a source is corrected or retracted, propagate that change to48 every record that cites it, and log the propagation.4950## 1. Source identifiers and citation formats5152A source identifier must be stable, unique, and resolvable. Stable53means the same source keeps the same identifier across exports and54restores. Unique means two different observations never share one.55Resolvable means a reader with the identifier can find the source56content, or a clear tombstone explaining why it is gone. The schema57below is the minimum useful shape for a source record.5859```json60{61 "source_record": {62 "id": "src_20261027_0011",63 "kind": "observation",64 "agent": "hunter-01",65 "captured": "2026-10-27T05:00:00Z",66 "location": "scan run 2026-10-27 on 10.0.1.5, port 22 open",67 "content_hash": "sha256:9f2c4a1b8d3e6f50718293a4b5c6d7e8f90123456789abcdef0123456789abcd",68 "quality": "direct_observation",69 "retracted": false70 }71}72```7374Source kinds used in this store:7576- direct_observation, meaning a command output or tool result the77 agent saw itself. Highest quality for operational facts.78- document, meaning a file, page, or report. Quality depends on the79 document's own freshness and authority, recorded alongside.80- conversation, meaning a human or agent statement. Quality depends81 on who said it and whether it was verified afterwards.82- derived, meaning a summary or promotion of other sources. A83 derived source must list its own sources, forming a chain, never a84 dead end.8586Citation format in stored text is the bare identifier, such as87`src_20261027_0011`, placed directly after the claim it supports.88Human-facing output may render it as a footnote or link, but the89stored form keeps the identifier in plain text, so that grep, SQL,90and audits can all follow it without a rendering step.9192## 2. Confidence propagation from source quality9394Confidence must flow from sources to claims, not from repetition.95A claim repeated in ten summaries is still only as strong as its one96original observation. The propagation rules below keep that honest,97and they are deliberately conservative, because inflated confidence98is how a guess becomes an action.99100```python101"""Confidence propagation: a claim is only as strong as its sources."""102103SOURCE_QUALITY = {104 "direct_observation": 0.95,105 "document": 0.80,106 "conversation": 0.60,107 "derived": 0.70,108}109110def claim_confidence(source_qualities, corroboration=1):111 """Weakest-link base, with a small bonus for independent agreement."""112 if not source_qualities:113 return 0.0114 base = min(SOURCE_QUALITY.get(q, 0.5) for q in source_qualities)115 bonus = 0.05 * (corroboration - 1)116 return round(min(0.98, base + bonus), 3)117118# One direct observation: 0.95. Two independent direct observations: 0.98.119# One conversation report: 0.60, however often it is repeated, because120# repetition of the same source is not corroboration.121```122123Rules that follow:124125- Corroboration counts independent sources only. Two summaries of126 the same observation are one source, not two.127- A derived record inherits the weakest quality in its chain, not128 the average, because a chain breaks at its weakest link.129- A claim with no sources has confidence 0.0 in the store, whatever130 the text says, and recall filters that enforce a confidence floor131 will hide it, which is the correct behaviour.132- When a source is retracted, every claim citing it drops to 0.0133 until fresh evidence arrives, and the drop is logged.134135## 3. Attribution checks before acting136137Before an agent acts on recalled knowledge, it checks that the138knowledge is attributable, meaning each load-bearing claim resolves139to a live, unretracted source of acceptable quality. The check below140runs that gate in code, so it cannot be skipped by enthusiasm.141142```python143"""Attribution gate: block actions resting on unattributed claims."""144145def attribution_gate(store, claims, min_quality="document"):146 quality_rank = {"direct_observation": 3, "document": 2,147 "conversation": 1, "derived": 2}148 floor = quality_rank[min_quality]149 failures = []150 for claim in claims:151 sources = store.sources_for(claim.id)152 if not sources:153 failures.append((claim.id, "no sources attached"))154 continue155 live = [s for s in sources if not s.retracted]156 if not live:157 failures.append((claim.id, "all sources retracted"))158 continue159 best = max(quality_rank.get(s.quality, 0) for s in live)160 if best < floor:161 failures.append((claim.id, "best source below quality floor"))162 return failures163164# An empty failures list means the action may proceed. Any failure165# means verify live first, or choose a different course of action.166```167168Set the quality floor per action, not per store. A report draft can169rest on conversation sources flagged as such. A change to a system170needs direct observation or a trusted document, verified fresh. When171the gate fails, the correct response is fresh verification, not172lowering the floor to make the check pass.173174## 4. Attribution audits and retraction propagation175176Attribution decays. Sources are deleted, documents move, and177summaries get copied without their links. A regular audit finds the178decay before it causes a wrong action. The audit below reports the179three numbers that matter, meaning how many semantic records lack180sources, how many cite retracted sources, and how many cite sources181that no longer resolve.182183```sql184-- Attribution audit: sourceless facts, retracted sources, dead links185SELECT 'semantic_without_sources' AS problem, COUNT(*) AS records186FROM memory_records187WHERE layer = 'semantic'188 AND (sources IS NULL OR sources = '[]')189UNION ALL190SELECT 'citing_retracted_sources', COUNT(*)191FROM memory_records r192JOIN memory_sources s ON s.id IN (SELECT value FROM json_each(r.sources))193WHERE s.retracted = 1194UNION ALL195SELECT 'citing_missing_sources', COUNT(*)196FROM memory_records r197WHERE EXISTS (198 SELECT 1 FROM json_each(r.sources) j199 WHERE NOT EXISTS (SELECT 1 FROM memory_sources s WHERE s.id = j.value)200);201```202203Retraction propagation procedure:204205- Mark the source retracted, with a reason and a date, instead of206 deleting it outright, so existing citations resolve to a clear207 tombstone rather than a mystery.208- Find every record citing the source, drop its confidence to 0.0,209 and flag it for review.210- Notify owners of open tasks that cited the retracted source, when211 the task is still active.212- After the review window closes, delete or rewrite the affected213 records, and keep the tombstone so future citations fail loudly214 instead of silently pointing nowhere.215216## Edge cases217218- A source is a live system state, such as an open port. Its219 identifier records the observation time, and the claim is only as220 fresh as that time. Re-verify before acting, however good the221 attribution looks.222- A claim has many sources but they all derive from one observation.223 Count it as one source. The chain, not the count, decides strength.224- A source is sensitive and cannot be shared with the reader. Cite225 the identifier and the quality level, and let an authorized reader226 resolve the content, rather than dropping the citation entirely.227- A summary quotes a source verbatim. The quote keeps the source228 identifier attached, so the quote cannot drift away from its229 evidence in later copies.230- Attribution and privacy conflict, because a source contains231 personal data. Keep the identifier and the quality, redact the232 content, and record that the content was redacted and when.233234## Key references235236- CWE-200 (Exposure of Sensitive Information to an Unauthorized237 Actor): why source content needs scoping even when identifiers238 are shared.239- SQLite json_each documentation: https://sqlite.org/json1.html240- Python sqlite3 module: https://docs.python.org/3/library/sqlite3.html241- ../../SKILL.md and ../../../memory-capture/SKILL.md in this repo.