Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:7onez Cti expert Provenance Idempotent Ingest

From Leeroopedia
Knowledge Sources
Domains OSINT, Data_Pipeline
Last Updated 2026-10-28 14:00 GMT

Overview

Design principle that ingest is idempotent and provenance-preserving: re-ingesting the same raw JSON updates observation timestamps but never duplicates facts/edges, never overwrites disagreements, and rejects incomplete or forged records.

Description

Provenance Idempotent Ingest solves two problems: duplicate explosion (re-running collection creates duplicate KB entries) and silent overwrite (a re-collection that disagrees with the first silently replaces it). The principle enforces:

1. Idempotent dedup: facts are deduped on (attribute, value, source, collector); edges on the full edge key. Re-ingesting the same file is a no-op (modulo timestamp updates).

2. Conflict preservation: when two sources disagree on the same attribute, both facts are kept. The KB never resolves a disagreement — the assessment layer decides.

3. Completeness gate: binary analysis JSON must carry a valid SHA-256 hash and pass a completeness check (not truncated, HTTP 2xx, saved file matches hash). A truncated or forged JSON never reaches the KB.

4. Provenance chain: every fact and edge carries source (the API or page that provided it), collector (the tool that extracted it), observed_at (when), confidence (collection confidence), and evidence_ref (link to the evidence capture).

Usage

Use this principle when designing data ingest pipelines where:

  • Re-running the pipeline must be safe (idempotent) — no duplicate facts, no silent overwrites.
  • Conflicting data from different sources must be preserved for later adjudication.
  • Incomplete or corrupted records must be rejected, not partially ingested.
  • Every record must carry enough provenance to answer "who said this, when, and how confidently?"

Theoretical Basis

The principle is a monotonic append with dedup model. The KB is an append-only store: new facts/edges are added, existing ones are updated in place (timestamp only), and nothing is ever deleted by ingest. This is the event-sourcing pattern — the raw JSON is the event, the KB is the projection.

# Abstract algorithm (NOT real implementation)
def ingest_file(kb, path):
    doc = json.load(path)
    if doc.is_binary and not is_complete(doc):
        return 0                         # completeness gate
    for artifact in doc.pivots:
        kb.add_fact(etype, value, attr, fval,
                    source=doc.meta.source,
                    collector=doc.meta.collector,
                    observed_at=file_mtime,
                    confidence=artifact.confidence,
                    evidence_ref=doc.meta.evidence)
    return count

The completeness gate for binary artifacts is a positive check: the SHA-256 must match the file bytes, the HTTP status must be 2xx, and the saved file must exist and match. This prevents a truncated download or a forged JSON from entering the KB and manufacturing false clusters.

Related Pages

Implemented By

Used By Workflow

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment