Source Capture Flow
How a supplied source becomes an immutable, committed and read-back original with a provenance record before any ingest.
Source Capture Flow
Capture runs before extraction and ingest, for every supplied source, also when ingest later finds nothing new. Each source ends with exactly one outcome. Spec authority: FLOW-002, AC-008–AC-015.
Trigger and actors
- Trigger: a user supplies a file, pasted or exported text, a meeting export, or a URL to fetch.
- Ingesting agent: acquires, preserves, commits and reads back.
- User: supplies the source and decides any push. A local commit authorizes no push.
Steps
- Acquire the original bytes and compute their SHA-256 and byte count. A URL, a summary or an exit status is not proof; only bytes in hand count.
- Reuse or place. Search every
source.jsonin the raw home for the SHA-256. On a match, read the record back; onOK, reuse the identical original and write no second copy. Without a match, create a new revision directory; a changed source becomes a new revision beside the older one. - Preserve the bytes unchanged and write
source.json. Normalization goes into derived files only. - Commit only the revision directory:
git add -- <dir>, thengit commit --only -- <dir>. Hooks run. Unrelated staged and working-tree changes stay as they were. - Read back with
verify-captured-source.mjs. It reads the committed record and blobs at a ref (defaultHEAD) and checks SHA-256, byte count and each derived entry. - Derive (optional, only after
committed): write derived text, add itsderivedentry, then commit and read back again.
Terminal outcomes
| Outcome | Meaning |
|---|---|
| not captured | No original acquired; nothing written. The report names the gap. |
| saved-uncommitted | Files on disk without a verified commit. Retry from Commit. |
| unverified | A commit exists, readback failed. Keep both; correct with a new commit. |
| committed | Readback printed OK. Extraction or synthesis failure later keeps this outcome. |
The record fields and layout are on the provenance record page.
Implemented behavior and evidence
- Skill text and script:
source-capture.mdandverify-captured-source.mjs, skills commit2319349; testtests/wiki-source-capture.contract.test.mjs. - First real run (T9, 2026-10-08): the pinned revision URL of the Karpathy source was fetched again (HTTP 200, 11985 bytes, SHA-256
dc3efe98…7401). The SHA-256 matched the existing record, readback printedOK … at HEAD (56c22bf8e54e), and the run reused the stored original unchanged. Outcome: committed, no new files (AC-012).
The new-revision path (AC-013), the commit step and the derive step have contract-test proof only; the T9 run exercised the reuse path.
Wiki Setup and Adoption Flow
How docs-ingest-phase resolves the project wiki contract, adopts or sets up the wiki, and reports three separate readiness results.
Knowledge Reconciliation Flow
How private/internal ingest turns changed evidence into current flow and concept articles, discovery entries and one truthful outcome.