v4.0 September 2026 Spec 1.1

Extract Knowledge, Not Text

A local, file-based toolchain for source normalization and structured graphs with evidence attached. Spec 1.1 adds precise locators, stable claims, explicit inference boundaries, safe merging, and deterministic offline artifacts while keeping Spec 1.0 inputs valid. Semantic Segment-to-Graph creation remains an external agent or compiler responsibility.

python3 scripts/validate_knowledge.py tests/fixtures/contextual.knowledge.json

7 Explicit Pipeline Boundaries

The repository implements normalization and deterministic post-compilation stages. Steps 02–04 describe the contract an external semantic graph producer must satisfy; the local runner does not invoke a model or apply a compiler profile. The source adapter and runner are separate tools, not an automatic end-to-end handoff.

01 Adapt Normalize supported local TXT, Markdown, HTML, CSV/TSV, JSON, and non-macro DOCX below an explicit input root
02 Compile externally An external agent or compiler creates concepts, claims, relationships, facts, and chunks under a versioned profile contract
03 Ground Attach reusable evidence IDs with source hashes and exact selectors or locators
04 Bound Record claim origin, short derivation summaries, review state, and retrieval-safe inference flags
05 Validate Enforce Spec 1.1 and JSON Schema, resolve references, and compute format conformance
06 Derive Render Markdown, a safe bundle, an offline SVG viewer, Neo4j Cypher, KD-CTXT/1, and Obsidian Canvas
07 Record Run content-addressed local stages with immutable receipts, output hashes, and resumable manifests

One Graph, Inspectable Views

The .knowledge.json graph is authoritative. Deterministic tools can derive a human-readable Markdown view and additional offline artifacts without changing the source graph.

contextual.knowledge.md Derived Excerpt
## Evidence

### `evidence-alpha-beta`

- Source: `source-1`
- Support: `supports`
- Attribution basis: `source_explicit`
- Review status: `reviewed`

**Selector:**

    {
      "type": "TextQuoteSelector",
      "exact": "Alpha enables Beta in the German deployment profile.",
      "prefix": "The guide states: ",
      "suffix": " Two deployments were observed."
    }

**Excerpt:**

    "Alpha enables Beta in the German deployment profile."
contextual.knowledge.json Spec 1.1 Excerpt
{
  // selected fields from the canonical graph
  "@context": {
    "@vocab": "https://schema.org/",
    "kd": "https://knowledge-distiller.dev/v4/"
  },
  "metadata": {
    "distiller_spec_version": "1.1",
    "conformance_score": 100,
    "sources": [{ "id": "source-1",
      "file": "deployment-guide.txt",
      "content_sha256": "aaaa…" }]
  },
  "evidence": [{
    "id": "evidence-alpha-beta",
    "source": "source-1",
    "selector": {
      "type": "TextQuoteSelector",
      "exact": "Alpha enables Beta…"
    },
    "support": "supports"
  }],
  "nodes": [{
    "id": "alpha",
    "resource": "urn:kd:concept:alpha",
    "statements": ["Alpha enables Beta… [1]"],
    "evidence": ["evidence-alpha-beta"],
    "claim_ids": ["claim-alpha-enables-beta"]
  }],
  "claims": [{
    "id": "claim-alpha-enables-beta",
    "node": "alpha",
    "origin": "source_stated",
    "evidence": ["evidence-alpha-beta"],
    "review_status": "reviewed"
  }]
}

Format as a Contract

The canonical graph follows a versioned specification enforced by code. Validation measures format conformance, not semantic truth; derived artifacts are regenerated from the graph, and Spec 1.0 files remain valid inputs.

Formal Contract
SPEC.md and the JSON Schema define producer rules, compatibility, references, and versioning. The validator reports a reproducible conformance_score and states that semantic accuracy was not evaluated.
Evidence + Claims
Reusable evidence records carry exact source selectors or locators. Stable claims link those records to a node and make origin, short derivation summaries, and review status inspectable.
Safe Local Adapters
Bounded adapters normalize supported local text, HTML, tabular, JSON, and DOCX inputs into hashed segments. They never fetch URLs or execute document content, and unsupported formats fail explicitly.
Payload-Aware Merge
The additive merge keys nodes by resource, then ID, unions compatible payloads, and never silently overwrites them. Contradictions fail or become explicit fact conflicts; every successful CLI merge archives the prior bytes and writes JSON plus Markdown diffs.
Runner + Manifests
The content-addressed runner uses immutable receipts, verified resume/reuse, a 512 MiB run quota and 4 GiB output-root quota. A pinned process toolchain fails sticky on code, schema, or viewer-asset drift.
Offline SVG Viewer
A self-contained, CSP-hardened .knowledge.html provides search, zoom, pan, drag, cluster focus, backlinks, and supersession views through safe DOM rendering—with no CDN or third-party runtime.

Temporal Dimension

Source dates, validity intervals, and distillation dates keep time claims explicit. These fields do not decide whether two values agree: distinct facts remain distinct, and a reviewed fact_conflict can link a tension or supersession.

LayerFieldsPurpose
Source source_date, source_period When was the knowledge published?
Validity valid_from, valid_until When does this information apply?
Distillation metadata.distillation_date When was the extraction performed?
2024-12-31 2024-Q4 FY2024 2020/2024

ISO 8601 with flexible granularity: exact date, quarter, fiscal year, or interval

temporal resolution
// Both payloads are retained
"facts": [{
  "id": "deployments-source",
  "value": "2",
  "temporal": {
    "source_period": "2026-Q3",
    "temporal_confidence": "explicit"
  },
  "evidence": ["evidence-alpha-beta"]
}, {
  "id": "deployments-review",
  "value": "3",
  "origin": "human_added"
}],

// The disagreement is explicit
"fact_conflicts": [{
  "id": "deployment-count",
  "facts": ["deployments-source",
            "deployments-review"],
  "relation": "tension",
  "reason": "Different retained counts"
}]
Represent source and validity periods
Keep distinct time-scoped facts explicit
Link reviewed tensions or supersession
Display supersession metadata offline

Built for Knowledge Systems

Evidence-Located Graph
Nodes, claims, edges, facts, chunks, assessments, and conflicts can reference reusable evidence with source-specific selectors. References are checked before the graph conforms.
Temporal + Spatial Roles
Optional time fields distinguish publication, validity, and distillation. Role-qualified places distinguish jurisdiction, market, event, mention, origin, and destination without inventing precision.
Collision-Safe Bundles
The one-file-per-concept bundle preflights every path, uses deterministic collision-safe components, and writes atomically below the chosen output root.
Retrieval-Safe Chunks
Source-backed chunks may enter default retrieval. Inference chunks require explicit derivation and are excluded by default so generated synthesis cannot silently outrank source claims.
Real Exporters
build_exports.py emits deterministic Neo4j 5 Cypher, KD-CTXT/1, and Obsidian/JSON Canvas files while preserving source graph payloads in the target representation.
Guarded Local API
An optional bearer-authenticated loopback HTTP/MCP facade exposes only validate/build under exact Host/Origin and fixed limits. It generates a random token or reads a protected --token-file; CORS and arbitrary command execution remain disabled.

Typed Relationships

Eight relationship types define the compatible edge vocabulary. Each edge carries a type, numeric weight, and confidence rating; Spec 1.1 can also attach evidence, origin, derivation, time, and spatial roles.

TypeMeaningSymbol
usesDependency→
enablesCausality→
based-onFoundation→
part-ofComposition→
tensionTrade-off / Contradiction↔
replacesSupersession→
extendsExtension→
example-ofInstantiation→
trust layer excerpt (spec 1.1)
// Evidence locates support; it does not assert truth
"evidence": [{
  "id": "evidence-1",
  "source": "source-1",
  "selector": {
    "type": "TextQuoteSelector",
    "exact": "Located source text"
  },
  "support": "supports"
}],

// Inference boundaries are explicit and reviewable
"claims": [{
  "id": "claim-1",
  "node": "concept-a",
  "statement": "Conservative synthesis [1]",
  "confidence": "medium",
  "origin": "model_inferred",
  "evidence": ["evidence-1"],
  "derivation": {
    "kind": "model_inferred",
    "activity": "profile-synthesis-v1",
    "inputs": ["evidence:evidence-1"],
    "summary": "Short transformation summary",
    "review_status": "unreviewed"
  }
}]

Version History

v4.0 · spec 1.1
Evidence-Bound Local Toolchain
Added exact evidence selectors, stable claims, source agents and hashes, origin/derivation/review boundaries, spatial roles, assessments and explicit conflicts. The implemented toolchain now includes safe local adapters, payload-aware merge with exact archive plus JSON/Markdown diffs, collision-safe bundles, an offline SVG viewer, real Cypher/CTXT/Canvas exports, quota-guarded content-addressed manifests, toolchain-pinned local endpoints, profiles and scoped golden evaluation.
v4.0 · spec 1.0
Format as a Contract
Introduced the formal schema and validator, numbered citations, resource identity, the temporal graph, deterministic Markdown/graph builders, the bundle, and the initial non-destructive merge contract. Spec 1.1 remains additive to this baseline.
v3.1
Temporal Dimension
Added source period, validity range, and distillation date fields. Nodes and optional fact/chunk context can retain flexible ISO-style granularity such as a date, quarter, fiscal year, or interval without automatically resolving contradictions.
v3.0
Dual Output Architecture
Rich graph nodes with definitions and statements as properties. Dual output: .knowledge.md + .knowledge.json. Embedding-ready clean-text chunks. JSON-LD with schema.org context.
v2.0
Hierarchical Clusters + Confidence
Added thematic cluster grouping, YAML machine-readable graph in frontmatter, and per-block confidence ratings (high / medium / low).
v1.0
Initial Release
6-phase workflow. Atomic knowledge blocks with Obsidian wikilinks. Concept map, facts table, open questions.

Implemented Local Input Adapters

TXT Markdown HTML CSV TSV JSON DOCX

Local paths only. PDF/OCR, images, audio/video, PPTX/XLSX, URLs, macros, encrypted files, unknown binaries, unsafe archives, and invalid UTF-8 are rejected rather than guessed.

deterministic outputs
Spec 1.1 JSON-LD Markdown Offline SVG HTML Safe Bundle Neo4j 5 Cypher KD-CTXT/1 Obsidian Canvas Run Manifest

Use the Local Toolchain

Clone the repository, validate the shipped Spec 1.1 fixture, then derive only the artifacts you need. Unsupported inputs and unsafe paths fail explicitly.

View on GitHub See Examples Unstract Review Historical PR Review Runtime Contract