Source-Thread Registry in DocsFab
The DocsFab source-thread registry preserves independently inspectable
evidence lineages before claim extraction or synthesis. The current
format is docsfab.knowledge.source-thread/v1. For more information,
refer to Knowledge Contracts in DocsFab.
Directory Layout
Each stable origin has one directory.
thread.json, items/*.json, and events.jsonl are canonical.
views/thread.md is a deterministic projection. Retain artifact bytes only
when governance permits; otherwise use an immutable Git locator or governed
external version.
Choose a Record
One origin is one thread. Items and events hang off that thread.
views/thread.md is generated from those records; it is not a source.
ThreadView is views/thread.md. Do not edit the view to change history.
Append an event and re-render.
Canonical Records
The JSON schemas beside the source-thread contract in
packages/knowledge/skills/register-source-thread/references/ are
authoritative.
Item Representations
Every item contains at least one representation or collection member. A representation records:
- Role and media type.
- Original filename and byte size.
- Retained-artifact, Git, or external-version locator.
- Integrity algorithm and value.
- Parent representations and transformation details.
- Optional access override.
Keep a PDF, presentation, image, audio file, video, or diagram as an original representation. Add extracted text, transcripts, renders, redactions, or summaries as derivatives. Never replace the original with extracted content.
Event Ledger
events.jsonl stores one immutable JSON object per line. Append corrections,
supersessions, transformations, migrations, and relationship changes as later
events. Do not edit an earlier event to make the history appear cleaner.
Registry Invariants
The validator enforces the following invariants:
- Thread and item identifiers remain stable.
- The thread item index equals the item records.
- Event identifiers and sequence numbers are unique.
- Event parents exist and precede their children.
- Thread heads equal the event-ledger leaves.
- Each item contains at least one representation or collection member.
- Derived representations identify existing parents and a transform.
- Original evidence remains inspectable.
Validation Commands
Run the following commands from the repository root:
The commands fail on malformed records, broken lineage, integrity mismatches, or a generated view that differs from canonical records.