61 / PROVENANCE · LINEAGE / KNOWLEDGE-RESEARCH + QUALITY ENGINE
61 / PRODUCTION / ORIGIN · TRANSFORMATION · EVIDENCE · REPRODUCIBILITY

PROVENANCE
/ LINEAGE.

Provenance отвечает на вопрос: «откуда взялся этот факт, файл, chunk, ответ или решение?» Lineage отвечает: «через какие преобразования и версии компонентов он прошёл?»

Главный принцип: в production AI недостаточно хранить только финальный текст. Система должна уметь пройти назад: answer → claim → evidence → retrieved chunk → parsed block → source artifact → external source, а также видеть parser/model/prompt/tool versions, которые участвовали в преобразовании.
00. ARCHITECTURAL STATUS

PROVENANCE НУЖНА ПО УМОЛЧАНИЮ, ЕСЛИ РЕЗУЛЬТАТЫ ДОЛЖНЫ БЫТЬ ОБЪЯСНИМЫ И ВОСПРОИЗВОДИМЫ

Для production-системы это cross-cutting data/quality capability. Реализовывать можно очень просто: stable IDs + source refs + transformation records в PostgreSQL. Не нужен knowledge graph cluster на старте.
TYPEPRODUCTIONCross-cutting evidence/data lineage.
DEFAULTONМинимальный provenance включён всегда.
ENABLE WHENALWAYS MINIMUMDepth increases with risk/audit needs.
SEPARATE COMPONENTYESLogical lineage registry / graph.
LIVES INR06 + R08Knowledge / Research + Quality Engine.
COMPLEXITYLOW → HIGHRefs/edges first; graph DB only if justified.
IMPLEMENT: YES
Минимум 80% ценности: stable IDs, source/version/hash, parent→child derivation edges, transformation type/version, retrieval/evidence links, claim→evidence mapping, run/trace correlation, immutable-ish provenance records, tenant/security metadata and query «show ancestors / show descendants». LLM-agent не нужен: capture deterministic metadata at system boundaries.
01A. ARCHITECTURE BOUNDARIES & OPERATIONS

EXPLICIT SYSTEM CONTRACT

A. BOUNDARY WITH NEIGHBORS

№46 Observability & Tracing фиксирует execution telemetry: run/span/tool/model latency/errors; №61 фиксирует происхождение и transformation chain данных/artifacts/claims. №25 Evidence-First использует lineage, чтобы связать material claim с evidence. №45 Verification проверяет конкретный result и может читать provenance; №61 сама не решает PASS/FAIL. №55 Ingestion создаёт source/version records; №56 Parsing создаёт derived blocks/tables; №60 Artifact Store хранит bytes и parent refs; №61 связывает всё в derivation graph. №76 Governance позже использует lineage для deletion/retention/impact analysis.

B. PREREQUISITES / CROSS-REFERENCES

Prerequisites: №25 Evidence-First, №45 Verification, №46 Observability, №50 Contracts, №55 Ingestion, №56 Parsing, №60 Artifact Store. Forward references: №66 Vector DB, №67 GraphRAG, №69 Distributed Reliability, №76 Data Governance & Privacy.

C. PLANE PLACEMENT

REQUEST-TIME: YES — capture retrieval/evidence/claim edges while answering. CONTROL PLANE: lineage schemas, transformation types, retention, provenance depth. DATA PLANE: entities, versions, edges, evidence links. OFFLINE: audits, impact analysis, replay/rebuild, quality/eval investigations.

D. FAILURE & OPERATIONS CONTRACT

Success: material output can resolve to its declared source/evidence and transformation history. Retryable: transient lineage-write failure if buffered/outboxed. Permanent: invalid/missing referenced entity/version. Idempotency: deterministic edge/event IDs or unique transformation keys. Persist: entity IDs, versions/hashes, edge type, transform version/config refs, timestamps, run/trace IDs, tenant/access metadata. Security: lineage query cannot reveal inaccessible source metadata. Operations: missing lineage for high-risk output may be release-blocking.

E. WHAT THIS TOPIC DOES NOT OWN

№61 не владеет execution tracing, correctness verification, source storage, artifact bytes, vector retrieval, business audit policy или hidden reasoning. Она владеет EXTERNALIZED ORIGIN, DERIVATION AND EVIDENCE RELATIONSHIPS BETWEEN SYSTEM OBJECTS.

01. PROVENANCE VS LINEAGE

ORIGIN И TRANSFORMATION CHAIN — БЛИЗКИЕ, НО НЕ ОДИНАКОВЫЕ ПОНЯТИЯ

PROVENANCE

Where did it come from?

Source URL/object, external ID, author/system, fetched version, original artifact, evidence page/block, retrieval result.

LINEAGE

How did it become this?

Fetched → parsed → table extracted → chunked → embedded → retrieved → summarized → verified → released.

Практически их удобно хранить одной связной моделью: versioned entities + typed derivation/evidence edges.
02. PROVENANCE VS OBSERVABILITY

RUN GRAPH И DATA GRAPH ПЕРЕСЕКАЮТСЯ, НО НЕ СОВПАДАЮТ

Question№46 Observability№61 Provenance / Lineage
Что система делала?Run/span/tool/model events.References run that produced transformation.
Сколько заняло?Latency/tokens/cost/errors.Usually not primary concern.
Откуда взялся answer?Can show retrieval/tool spans.Explicit answer/claim → evidence/source chain.
Какой parser/model version?Span attributes may record it.Version is part of durable derivation record.
Можно ли rebuild affected outputs?Trace alone often insufficient.Descendant/ancestor graph enables impact/rebuild analysis.
Связка делается через run_id / trace_id / span_id, но lineage должна пережить expiration sampled traces, если reproducibility/audit требует более долгого хранения.
03. MASTER LINEAGE GRAPH

SOURCE → ARTIFACT → IR → CHUNK → RETRIEVAL → CLAIM → ANSWER

SOURCE external object v42 RAW ARTIFACT sha256 / bytes DOCUMENT IR parser=v3 / blocks TABLE / FIGURE derived region CHUNK chunker=v2 EMBEDDING model/version RETRIEVAL HIT query / score / rank CLAIM supported_by ANSWER contains claim Every node: stable identity + version/hash + tenant/access + created_at Every edge: relation type + transform/version/run + timestamps + optional config/model/tool refs
Lineage graph не обязан физически жить в graph DB. Для 80% систем adjacency tables в PostgreSQL достаточно.
04. ENTITY MODEL

ЧТО МОЖЕТ БЫТЬ NODE В LINEAGE

SOURCE

External object

Drive file, webpage, DB row/snapshot, message, API record, user upload.

ARTIFACT

Durable bytes

PDF/image/audio/report/archive/page image/dataset.

DOCUMENT BLOCK

Parsed unit

Page, heading, paragraph, table, figure, structured field.

CHUNK

Retrieval unit

Text/structured chunk built from one or several blocks.

DERIVED DATA

Embedding / feature / graph edge

Vector, entity extraction, normalized record, classification.

RETRIEVAL HIT

Run-specific evidence selection

Query, rank, score, selected chunk/version.

CLAIM

Material assertion

Atomic statement in answer/report that should be supportable.

ARTIFACT OUTPUT

Generated result

Report/document/chart/file produced from inputs.

DECISION RECORD

Operational choice

Optional: released/approved route/result tied to evidence and policy.

05. EDGE TYPES

СВЯЗЬ ДОЛЖНА ОБЪЯСНЯТЬ, ЧТО ИМЕННО ПРОИЗОШЛО

EdgeMeaningExample
FETCHED_FROMArtifact/record obtained from external source.raw PDF → Drive file v42.
PARSED_FROMStructured representation extracted from artifact.Document IR → raw PDF.
DERIVED_FROMGeneric deterministic/semantic derivation.table CSV → table block.
CHUNKED_FROMRetrieval chunk assembled from blocks.chunk 17 → blocks 20–25.
EMBEDDED_FROMVector produced from exact chunk/version.embedding v3 → chunk hash H.
RETRIEVED_FROMRun selected entity from index/source.retrieval hit → chunk 17.
SUPPORTED_BYClaim cites/supports evidence entity.claim C4 → block/page P12.
CONTAINSOutput contains claim/artifact component.answer A → claims C1..C5.
TRANSFORMED_BYResult produced using transformation config/version.summary → model/prompt/tool ref.
SUPERSEDESNew logical version replaces prior version for current use.doc v43 → doc v42.
Не использовать один универсальный edge RELATED_TO. Он почти бесполезен для audit, rebuild и impact analysis.
06. LINEAGE EVENT CONTRACT

CAPTURE DERIVATION КАК STRUCTURED RECORD

{
  "lineage_event_id": "LIN-...",
  "relation": "PARSED_FROM",
  "output": {
    "ref": "document-ir://doc123/v3",
    "version": "3"
  },
  "inputs": [
    {
      "ref": "artifact://tenant_A/raw123",
      "sha256": "sha256:..."
    }
  ],
  "transform": {
    "type": "document.parse",
    "implementation": "parser-profile-v3",
    "config_hash": "sha256:..."
  },
  "run_id": "RUN-...",
  "trace_id": "TRACE-...",
  "tenant_id": "tenant_A",
  "created_at": "..."
}
CAPTURE RULE

Write at the boundary

Producer of a derived object should emit its lineage record when the object becomes durable.

  • Parser records PARSED_FROM.
  • Chunker records CHUNKED_FROM.
  • Embedding pipeline records EMBEDDED_FROM.
  • Retriever records RETRIEVED_FROM.
  • Answer builder records CONTAINS / SUPPORTED_BY.

Не восстанавливать lineage позже из догадок.

07. VERSION EVERYTHING THAT CHANGES MEANING

LINEAGE БЕЗ VERSIONING НЕ ОБЕСПЕЧИВАЕТ REPRODUCIBILITY

SOURCE VERSION

What input?

updated_at/version/content hash/external revision.

PARSER / CHUNKER

How extracted?

Code/config/profile version or hash.

MODEL

Which inference?

Provider/model/version where available; routing decision captured.

PROMPT / SKILL

Which procedure?

Prompt/skill/config version or immutable hash.

TOOL

Which operation?

Tool/connector implementation/version and structured arguments reference.

POLICY

Which rule?

Relevant policy/approval version for released actions when material.

INDEX

Which corpus?

Embedding/index namespace/version/snapshot.

OUTPUT

Which exact result?

Artifact hash/answer version/claim IDs.

Не всё обязано иметь human-readable semver. Immutable config hash уже лучше, чем «какая-то текущая версия».
08. DATA LINEAGE VS EXECUTION LINEAGE

ДВА ГРАФА СВЯЗЫВАЮТСЯ ЧЕРЕЗ RUN

DATA / ARTIFACT LINEAGE

Durable relationships

source → artifact → IR → chunk → embedding → report. Может жить месяцами/годами и использоваться для rebuild/deletion/audit.

EXECUTION LINEAGE

Run-specific path

Run R7 queried index, retrieved chunks X/Y, called model M, verifier V, released answer A. Связано с traces/spans №46.

У одного durable chunk могут быть тысячи retrieval events. Поэтому не смешивать permanent derivation graph и high-volume run events в одну тяжёлую таблицу без retention strategy.
09. CLAIM-LEVEL PROVENANCE

СИЛЬНАЯ СИСТЕМА УМЕЕТ ОТВЕТИТЬ «КАКОЙ ИСТОЧНИК ПОДДЕРЖИВАЕТ ИМЕННО ЭТО УТВЕРЖДЕНИЕ?»

ANSWERFinal user-visible result.
CLAIMSMaterial atomic assertions.
EVIDENCE LINKSsupported_by / contradicted_by / uncertain.
BLOCK / TABLE / FIGUREExact page/region.
DOCUMENT VERSIONExact parsed source.
EXTERNAL SOURCEOrigin/authority/fetched version.
Не каждое stylistic предложение требует отдельного claim ID. Claim-level lineage имеет смысл для externally verifiable/material assertions, особенно в research, legal, finance, infrastructure, analytics и audit outputs.
10. EVIDENCE LINK CONTRACT

SUPPORTED_BY ДОЛЖЕН БЫТЬ СТРУКТУРИРОВАННЫМ

{
  "claim_id": "CLM-4",
  "claim_text_hash": "sha256:...",
  "relation": "SUPPORTED_BY",
  "evidence": {
    "ref": "block://doc123/v3/page12/b7",
    "source_ref": "source://drive/file456/v42"
  },
  "support": {
    "type": "DIRECT",
    "scope": "claim",
    "verified": true
  },
  "retrieval": {
    "run_id": "RUN-...",
    "rank": 2,
    "query_hash": "sha256:..."
  }
}
RELATION TYPES

Don't pretend all citations are equal

  • DIRECT_SUPPORT
  • PARTIAL_SUPPORT
  • BACKGROUND
  • CONTRADICTS
  • DERIVED_CALCULATION
  • UNVERIFIED

Verification policy determines which relations are sufficient for release.

11. DERIVED CALCULATIONS

CLAIM МОЖЕТ БЫТЬ НЕ НАПИСАН В SOURCE ДОСЛОВНО

EVIDENCE A + B

Revenue 2025, Revenue 2026 from source table.

CALCULATION ARTIFACT

Code/tool formula computes growth rate; code hash + inputs + result captured.

CLAIM

«Выручка выросла на X%» supported by calculation + source cells.

Для computed claims lineage должна включать не только source evidence, но и transformation/calculation, иначе citation выглядит правдоподобно, но не объясняет derived value.
12. MULTI-HOP LINEAGE

RESEARCH CLAIM МОЖЕТ ЗАВИСЕТЬ ОТ ЦЕПОЧКИ НЕСКОЛЬКИХ SOURCES

HOP 1

Find entity / identifier

Source A establishes project/company/object identity.

HOP 2

Follow dependent fact

Source B uses resolved identifier to obtain financial/status data.

SYNTHESIS

Claim combines evidence

Claim records all material evidence parents plus transformation/research run.

№26 Multi-Hop Research owns research strategy; №61 keeps the evidence chain that makes the final synthesis inspectable later.
13. TRUST & AUTHORITY

PROVENANCE ДОЛЖНА ПЕРЕНОСИТЬ НЕ ТОЛЬКО ID, НО И TRUST CONTEXT

UNTRUSTED

User/external content

Source text remains untrusted instruction-wise.

AUTHORITY

Source role

Official, internal, secondary, user-provided, generated, inferred.

FRESHNESS

When observed?

Fetched_at, source version, validity interval when known.

ACCESS

Who may see?

Tenant/data classification/ACL propagate to descendants.

Lineage не «повышает доверие». Она делает источник известным, чтобы policy/retrieval/verifier могли учитывать его trust/authority/freshness.
14. ACCESS PROPAGATION

ПРОИЗВОДНЫЙ OBJECT НЕ МОЖЕТ СТАТЬ МЕНЕЕ СЕКРЕТНЫМ САМ ПО СЕБЕ

Derived objectDefault access rule
Parsed block from private documentInherit/restrict to source document access.
Embedding from confidential chunkSame tenant/classification boundary; retrieval filters apply.
Summary combining public + private sourcesAt least as restrictive as the most restrictive material input, unless explicit declassification/redaction policy exists.
Public report derived from private analysisRequires deliberate release/redaction/policy decision; not automatic inheritance relaxation.
Это важный мост между provenance и №76 Data Governance. Lineage позволяет понять, какие descendants затронуты изменением source ACL/classification.
15. IMPACT ANALYSIS

«ЕСЛИ ЭТОТ SOURCE ОШИБОЧНЫЙ — ЧТО НУЖНО ПЕРЕСЧИТАТЬ?»

ANCESTORS

Why does this exist?

Given report/claim/artifact, walk backwards to sources, transformations and versions.

DESCENDANTS

What depends on this?

Given source/chunk/model/config version, find all derived indexes/reports/claims that may need rebuild/invalidation.

source://doc/42/v7
   ↓ PARSED_FROM
document-ir://42/p3
   ↓ CHUNKED_FROM
chunk://42/17
   ↓ EMBEDDED_FROM
embedding://42/17/e3
   ↓ RETRIEVED_FROM
run://R18/hit4
   ↓ SUPPORTED_BY
claim://C9
   ↓ CONTAINS
report://Q4

SOURCE v7 RETRACTED
→ mark descendants potentially stale
→ invalidate retrieval/index if required
→ queue rebuild/reverification
→ notify owners of released artifacts if policy requires
Это одна из самых практичных причин делать lineage даже без compliance: incident repair становится системным, а не ручным поиском по логам.
16. REPRODUCIBILITY

ПОЛНОЕ «ПОВТОРИТЬ БИТ-В-БИТ» НЕ ВСЕГДА ВОЗМОЖНО — НО INPUTS ДОЛЖНЫ БЫТЬ ИЗВЕСТНЫ

LEVEL
SOURCE
TRANSFORMS
MODEL
RESULT
GOAL
TRACEABLE
known
known
name/version
stored
Explain origin.
REPLAYABLE
snapshot/hash
config/code refs
same model access
compare
Re-run pipeline.
DETERMINISTIC
exact
deterministic
LLM often nondeterministic
not guaranteed
Formal/code stages only.
Для LLM results цель обычно traceability + replayability + evaluable equivalence, а не обещание, что повторный inference даст те же токены.
17. MODEL / PROMPT LINEAGE

ГЕНЕРАЦИЯ ТОЖЕ ЯВЛЯЕТСЯ TRANSFORMATION

{
  "output_ref": "answer://RUN-42/final",
  "relation": "GENERATED_FROM",
  "inputs": [
    "task://...",
    "context://RUN-42/v1",
    "evidence-set://RUN-42/e3"
  ],
  "transform": {
    "model_route": "router-decision://...",
    "model": "provider/model-id",
    "prompt_ref": "prompt://answer/v7",
    "skill_refs": ["skill://research/v4"],
    "structured_output": "answer.v3"
  },
  "run_id": "RUN-42"
}
NO CHAIN-OF-THOUGHT

Capture external contract, not hidden reasoning

Нужно сохранять:

  • which model/router decision;
  • prompt/skill/config version;
  • visible/structured inputs;
  • retrieved evidence refs;
  • tool outputs/artifacts;
  • final structured output.

Не требуется хранить приватное внутреннее рассуждение модели.

18. TOOL LINEAGE

ЕСЛИ CLAIM ОСНОВАН НА TOOL RESULT — TOOL RESULT ДОЛЖЕН БЫТЬ ADDRESSABLE

CALL

Structured input

Tool name/version, sanitized arguments/ref, tenant, run/span.

RESULT

Stable output

Structured result or artifact_ref + provider/source IDs and timestamps.

CLAIM

Evidence relation

Claim may be supported by tool result, calculation artifact or fetched external object.

Tool lineage особенно важна для current facts: exchange rate/API state/database query. Источник — не «модель сказала», а конкретный tool observation at time T.
19. PROVENANCE QUALITY

НАЛИЧИЕ LINK ЕЩЁ НЕ ЗНАЧИТ, ЧТО LINK КОРРЕКТНЫЙ

COVERAGE

How much is linked?

% material claims/derived artifacts with complete provenance.

RESOLUTION

Can refs resolve?

No dangling source/artifact/block references.

VERSION

Exactness

Link points to exact version/hash, not generic latest.

SUPPORT

Semantic validity

Verification checks that cited evidence actually supports claim.

FRESHNESS

Temporal fit

Evidence current enough for claim's time sensitivity.

AUTHORITY

Source quality

Official/primary/secondary/user-generated classification where useful.

ACCESS

Security fit

Lineage does not expose inaccessible source metadata.

COMPLETE

Transform chain

No unexplained gap between source and released output.

20. PROVENANCE & VERIFICATION

LINEAGE ДАЁТ VERIFIER-У ОБЪЕКТЫ, КОТОРЫЕ МОЖНО ПРОВЕРИТЬ

PROVENANCE

Claim C4 declares evidence E2/E5 and transform T1.

№45 VERIFICATION

Checks evidence exists, supports claim, calculation correct, source acceptable.

RESULT

PASS / REVISE / FAIL / UNCERTAIN, with verification record linked back to claim.

№61 не сама решает truth. Она делает origin inspectable и machine-addressable для deterministic/LLM/human verification.
21. PROVENANCE & EVALS

ПЛОХОЙ RESULT МОЖНО РАЗЛОЖИТЬ ПО PIPELINE STAGE

SOURCE FAILURE

Wrong/old evidence

Correct reasoning from stale/incorrect source.

RETRIEVAL FAILURE

Right source not selected

Corpus contains evidence, retrieval hit missed it.

GENERATION FAILURE

Evidence selected, answer wrong

Model misread/ignored/miscombined correct evidence.

Lineage turns failure clustering from guesswork into stage attribution. Это напрямую полезно для №40 Eval-Driven Optimization и №47 Evals.
22. DATA CORRECTION & RETRACTION

КАК РЕАГИРОВАТЬ, ЕСЛИ SOURCE ИСПРАВИЛИ ИЛИ ОТОЗВАЛИ

SOURCE CHANGEDv42 superseded/retracted.
LINEAGE QUERYFind descendants depending on v42.
CLASSIFYindex / claim / report / decision impact.
INVALIDATEMark stale / block retrieval / queue rebuild.
REPROCESSNew source version through pipeline.
REVERIFYReleased material if policy requires.
Lineage — foundational mechanism for safe correction propagation. Без него система знает, что source изменился, но не знает, какие outputs затронуты.
23. DELETION & PRIVACY

LINEAGE НУЖНА НЕ ТОЛЬКО ДЛЯ AUDIT, НО И ДЛЯ УДАЛЕНИЯ

DELETE SOURCE

Find descendants

Parsed blocks, embeddings, caches, summaries and artifacts may contain copied data.

POLICY

Decide treatment

Delete, tombstone, de-identify, retain under legal hold, or reprocess.

VERIFY

Prove cleanup

Lineage can report which descendants were removed/retained and why.

№76 Data Governance & Privacy задаст policy; №61 предоставляет dependency map, по которой policy можно исполнить.
24. IMMUTABILITY & CORRECTIONS

НЕ ПЕРЕПИСЫВАТЬ ИСТОРИЮ ТИХО

APPEND

New lineage event

Новая версия/edge добавляется, старые records остаются для audit where retention permits.

SUPERSEDE

Current pointer changes

Mark previous version superseded/retracted instead of mutating facts invisibly.

REDACT

Security/privacy exception

Sensitive fields may need removal; preserve non-sensitive audit metadata according to policy.

«Immutable» — operational default, не оправдание хранить personal/sensitive data forever. Governance overrides retention.
25. STORAGE MODEL

POSTGRESQL ADJACENCY TABLES — НОРМАЛЬНЫЙ MVP

lineage_entities(
  entity_ref        text primary key,
  entity_type       text,
  tenant_id         text,
  logical_id        text,
  version           text,
  content_hash      text,
  source_time       timestamptz,
  created_at        timestamptz,
  metadata_json     jsonb
)

lineage_edges(
  edge_id           uuid primary key,
  relation          text,
  from_ref          text,
  to_ref            text,
  transform_type    text,
  transform_version text,
  config_hash       text,
  run_id            text,
  trace_id          text,
  created_at        timestamptz,
  metadata_json     jsonb,
  unique(...)
)

indexes:
  from_ref
  to_ref
  tenant_id
  relation
  run_id
GRAPH DB?

Only when query patterns prove it

PostgreSQL recursive CTEs обычно достаточно для:

  • ancestors of artifact;
  • descendants of source;
  • claim evidence set;
  • objects produced by run;
  • all descendants using parser v2.

Graph DB имеет смысл позже при очень больших/deep lineage graphs и graph-heavy interactive analysis.

26. CAPTURE PATTERN

НЕ ДЕЛАТЬ ВСЕ PRODUCERS ЗАВИСИМЫМИ ОТ ОДНОГО ХРУПКОГО LINEAGE API

SAME TRANSACTION

Best locally

Derived record + lineage edge commit in same DB transaction when they live together.

OUTBOX

Across services

Producer commits output + lineage event intent; relay writes central lineage service asynchronously.

RECONCILE

Repair gaps

Periodic checks detect durable outputs missing required lineage and backfill from deterministic metadata where possible.

Для high-risk release можно fail closed: no required provenance → no publish/release. Для low-risk telemetry enrichment допустим eventual lineage, если documented.
27. SECURITY OF LINEAGE ITSELF

METADATA ТОЖЕ МОЖЕТ БЫТЬ ЧУВСТВИТЕЛЬНОЙ

EXISTENCE LEAK

Names/IDs reveal data

Даже факт существования private document/customer can be sensitive.

ACCESS-AWARE QUERY

Filter graph

Ancestor/descendant queries respect current tenant/principal permissions.

SANITIZE

No raw secrets

Store secret refs or hashes where possible, not credentials/raw confidential payload.

RETENTION

Not forever

Lineage retention/classification follows governance and audit needs.

«Это всего лишь metadata» — опасная иллюзия. Provenance может раскрывать source names, tool calls, resource identifiers and business relationships.
28. FAILURE MODES

КАК PROVENANCE ПРЕВРАЩАЕТСЯ В ДЕКОРАЦИЮ

ONLY FINAL CITATION
Есть ссылка на сайт, но потеряна source version, parsed block, retrieval and transform chain.
END-TO-END REFS
OBSERVABILITY = LINEAGE
Trace expired/sampled; невозможно восстановить durable data derivation.
SEPARATE DURABLE GRAPH
RELATED_TO EDGES
Связи ничего не говорят о transformation semantics.
TYPED RELATIONS
LATEST SOURCE ONLY
Citation resolves to current file, not exact version used for answer.
VERSION / HASH
NO CLAIM MAPPING
Список sources есть, но непонятно, какой source поддерживает какой тезис.
CLAIM → EVIDENCE
RECONSTRUCT LATER
Lineage пытаются угадывать по timestamps/logs после incident.
CAPTURE AT WRITE
NO ACCESS CONTROL
Lineage graph reveals private resources through IDs/metadata.
ACCESS-AWARE QUERY
GRAPH DB TOO EARLY
Infrastructure complexity before basic IDs/edges are stable.
POSTGRES FIRST
STORE HIDDEN CoT
Provenance confused with internal reasoning transcript.
EXTERNALIZED INPUT/OUTPUT ONLY
29. METRICS

ЧТО ИЗМЕРЯТЬ

COV

Provenance Coverage

% material outputs/claims with required lineage.

RES

Reference Resolution

% lineage refs resolving to existing authorized entities.

CLM

Claim Evidence Coverage

% externally verifiable claims mapped to evidence.

DNG

Dangling Edge Rate

Edges referencing missing entity/version.

VER

Exact Version Rate

% source links pinned to exact version/hash rather than latest.

IMP

Impact Query Time

Time to identify descendants of faulty/retracted source.

REP

Replay Success

% sampled pipelines reconstructable from recorded refs/configs.

GAP

Lineage Gap Incidents

Released output where material origin cannot be established.

30. MVP IMPLEMENTATION

НАЧАТЬ С REFS + EDGES, А НЕ С «DATA CATALOG PLATFORM»

provenance/
├── entities.py
├── edges.py
├── capture.py
├── queries.py
├── claims.py
├── access.py
├── reconcile.py
└── tests/

MVP capture points:
  ingestion:
    source → raw artifact

  parsing:
    raw artifact → document IR/block

  chunking:
    blocks → chunk

  embedding:
    chunk → embedding/index record

  retrieval:
    query/run → retrieval hit → chunk

  answer:
    answer → claim
    claim → evidence

  generated files:
    inputs → output artifact

Queries:
  ancestors(ref)
  descendants(ref)
  evidence_for(claim_id)
  outputs_for_run(run_id)
80% VALUE MVP

PostgreSQL lineage registry

  • Stable canonical refs.
  • Entity version/hash fields.
  • Typed parent→child relations.
  • Transform/version/config metadata.
  • Run/trace correlation.
  • Claim→evidence links for material claims.
  • Access-aware ancestor/descendant queries.
  • Reconciliation for missing lineage.
  • Source retraction impact query.
  • Eval that checks lineage coverage/resolution.

No graph DB, no LLM provenance agent, no enterprise catalog required.

31. PRACTICAL DECISION

СТОИТ ЛИ ДЕЛАТЬ ОТДЕЛЬНЫЙ КОМПОНЕНТ?

ВопросОтвет
Стоит ли реализовывать?Да. Минимальный provenance слой нужен для production knowledge/quality systems, особенно если используются RAG, external sources, generated artifacts и evals.
Separate Component?YES логически. Может быть набором общих таблиц/library hooks, а не отдельным microservice.
Минимум 80% ценности?Stable refs + versions/hashes + typed edges + claim/evidence links + transform/run metadata + ancestor/descendant queries.
Когда overkill?Enterprise graph/catalog/semantic ontology до того, как базовые source/artifact IDs и derivation capture дисциплинированы.
Trigger?По умолчанию ON; depth increases for external knowledge, high-risk outputs, regulated data, complex transformations and released artifacts.
Как измерить uplift?Time to debug wrong answer, citation/evidence accuracy, impact-analysis time, replay success, lineage gap rate, stale-output incidents.
Можно ли rule/tool/code вместо LLM-agent?Да — и предпочтительно. Capture is deterministic metadata. LLM может помочь semantic claim/evidence mapping, но не должен быть единственным source of provenance truth.
32. DESIGN RULES

ПРАВИЛА ДЛЯ РЕАЛЬНОЙ СИСТЕМЫ

RULE 01

Capture at creation

Producer writes lineage when derived object becomes durable.

RULE 02

Pin exact versions

Source/ref without version/hash is weak provenance.

RULE 03

Use typed edges

PARSED_FROM/CHUNKED_FROM/SUPPORTED_BY beat generic RELATED_TO.

RULE 04

Link claims to evidence

Material assertions should have machine-addressable support relations.

RULE 05

Bridge traces, don't depend on them

run/trace IDs link execution to durable lineage.

RULE 06

Track transforms

Parser/chunker/model/prompt/tool/config versions explain derivation.

RULE 07

Make impact query easy

Ancestors and descendants are first-class operations.

RULE 08

Preserve access boundaries

Lineage metadata must not leak protected resources.

RULE 09

Don't store hidden reasoning

Record externalized inputs, evidence, actions and outputs — not private CoT.

33. FINAL MAP

EVERY IMPORTANT OUTPUT SHOULD HAVE A WAY BACK TO ITS ORIGIN

EXTERNAL SOURCE
  source_id
  source_version
  fetched_at
  authority / trust
        ↓ FETCHED_FROM
RAW ARTIFACT
  artifact_ref
  sha256
        ↓ PARSED_FROM
DOCUMENT IR / BLOCKS
  parser_version
  page / bbox
        ↓ CHUNKED_FROM
RETRIEVAL CHUNKS
  chunker_version
        ↓ EMBEDDED_FROM
INDEX / EMBEDDING
  embedding_model
  index_version
        ↓ RETRIEVED_FROM
RUN-SPECIFIC EVIDENCE SET
  query
  rank
  score
        ↓ SUPPORTED_BY
CLAIMS
  claim_id
  evidence relation
        ↓ CONTAINS
ANSWER / REPORT / ARTIFACT
  output version/hash

PARALLEL EXECUTION LINK:
  run_id
  trace_id
  span_id
  model route
  prompt/skill version
  tool result refs
  verifier result
        ↓
DURABLE LINEAGE GRAPH

ASK BACKWARDS:
  "Where did this claim come from?"
  "Which exact source version?"
  "Which parser/model/config?"
  "What evidence supported it?"

ASK FORWARDS:
  "What depends on this source?"
  "What becomes stale if it is retracted?"
  "What must be reprocessed if parser v2 is wrong?"
  "What outputs contain deleted private data?"

CORE PRINCIPLE:

OBSERVABILITY TELLS US
WHAT THE SYSTEM DID.

PROVENANCE TELLS US
WHAT THE RESULT CAME FROM.

LINEAGE TELLS US
HOW IT WAS TRANSFORMED.

VERIFICATION TELLS US
WHETHER THAT RESULT
SHOULD BE TRUSTED.

DO NOT STORE ONLY THE ANSWER.

STORE ENOUGH EXTERNALIZED
ORIGIN + VERSION + TRANSFORMATION
TO EXPLAIN, REBUILD,
INVALIDATE AND VERIFY IT.

ECC RETROFIT / PRACTICAL HARNESS INTEGRATION

A. Related ECC ideas. Context-as-cache, scoped memory, lifecycle hooks, selective capabilities, feature flags, deterministic enforcement, provider-neutral adapters and eval-gated learning are applied only where relevant to №61 Provenance / Lineage.

B–E. Existing boundary and placement. The existing conceptual boundary, class PRODUCTION, default ON and owner Knowledge / Research Engine + Quality Engine remain authoritative. Runtime/control/data/offline placement is unchanged; durable state stays outside model context.

F–H. Hooks and contracts. Use bounded PRE_MODEL/POST_MODEL, PRE_TOOL/POST_TOOL, CHECKPOINT and TASK_COMPLETED events as applicable. Illustrative fields and canonical contracts are defined in NEW_CONTRACTS_SPEC.md; no universal schema is implied.

I–J. Security and evaluation. Host-side schema, permission, secret, budget, idempotency and audit checks take precedence over LLM output. Optional mechanisms require a feature flag and WITH/WITHOUT ablation; measure quality, acceptance, correction, latency, cost, escalations and severe errors.

K–L. Task profiles and cross-references. A TaskProfile selects the relevant skill, tool/context slice, memory scope and enforcement profile independently from FAST/STANDARD/DEEP. See cross-reference map, hook spec and ablation plan. Provider adapters remain outside the core.