Ingest files, APIs, feeds, and pages into a traceable corpus with licensing, integrity, version, transformation, and deletion evidence.
The result you're building
A source manifest and ingestion pipeline where every record can be traced to an allowed source snapshot, validated through each transformation, quarantined on failure, and removed or rebuilt deterministically.
Use this guide when
- You collect data for search, RAG, analysis, monitoring, or paid agent responses.
- Sources change format, terms, identifiers, or access rules.
- Buyers need freshness and provenance with each result.
Do not use it as a substitute for
- Copying data first and deciding permission or provenance later.
- Treating successful download as proof that content is complete, authentic, current, or licensed for the intended use.
Before you change anything
- Collect these items first. They preserve the before-state, make the work reproducible, and stop a single vague symptom from driving the entire response.
- Source owner, URL/identifier, access method, license/terms, and allowed use.
- Fetch time, response headers, checksum, size, encoding, and immutable raw snapshot.
- Parser and transformation versions with row/document counts.
- Schema, identifiers, freshness promise, quality thresholds, and quarantine reason codes.
- Correction, takedown, deletion propagation, replay, and rebuild evidence.
Understand the system before fixing it
Provenance is part of the record
A value without source, observation time, transformation history, and known limitations cannot support a defensible automated decision.
Schema changes are product changes
Renames, units, null behavior, identifiers, and deleted fields can silently change decisions even when a pipeline still returns HTTP 200.
Raw evidence must remain reproducible
Keep an immutable permitted snapshot or content digest and fetch metadata so transformed records can be explained and rebuilt.
Quality gates belong between stages
Fetch, decode, parse, normalize, enrich, index, and publish have different failure modes; record counts and checks at every boundary.
Evidence-to-decision map
| Evidence | Likely layer | First decisive check | What the result means |
|---|---|---|---|
| Published value has no source | Lineage | Trace record ID to source snapshot and transform | Provenance was discarded or identifiers are not stable. |
| Row count drops after update | Parser/schema | Compare raw snapshot and stage counts | Source format changed or malformed records were silently skipped. |
| Deleted source remains searchable | Lifecycle | Trace deletion through derivatives and index | Takedown is not propagated to summaries, caches, or vectors. |
| Same input produces different output | Reproducibility | Pin parser, config, locale, and dependency digests | Transformation environment or external enrichment is mutable. |
| Fresh response contains old facts | Observation semantics | Compare source publish time, fetch time, and cache age | Pipeline freshness is being confused with source freshness. |
Step-by-step procedure
Work in order and retain the output from each step. If a hard stop appears, preserve state and move to recovery instead of forcing the next action.
Step 01 — Register the source and permitted use
Why: A precise boundary prevents a plausible fix from solving the wrong problem.
Do: Record owner, location, access method, authentication boundary, license/terms, data classes, retention, redistribution, and takedown contact before collection.
Read the result: Each source has an approved purpose and accountable owner.
Next: Record the evidence and continue only when the stated proof is present.
Step 02 — Capture immutable fetch evidence
Why: Symptoms are not enough; a baseline preserves the evidence needed to isolate the failing layer.
Do: Store request identity, fetch time, status/headers, content length, checksum, encoding, and raw permitted snapshot or digest. Separate transport failure from empty content.
Read the result: Repeated audit can identify exactly what bytes were observed.
Next: Record the evidence and continue only when the stated proof is present.
Step 03 — Validate before parsing
Why: Inconsistent inputs create false differences and make later comparisons unreliable.
Do: Check content type, magic bytes, size, malware, decompression limits, encoding, expected structure, and source signature where available.
Read the result: Unexpected or dangerous content enters quarantine with a reason code.
Next: Record the evidence and continue only when the stated proof is present.
Step 04 — Parse and normalize deterministically
Why: A decisive test reduces trial-and-error and limits unnecessary change.
Do: Pin parser/config versions, preserve original values, normalize units/time/IDs explicitly, and attach lineage fields to every output.
Read the result: Stage counts reconcile and the same snapshot rebuilds the same normalized result.
Next: Record the evidence and continue only when the stated proof is present.
Step 05 — Apply quality and drift gates
Why: The smallest reversible correction lowers the blast radius while preserving a recovery path.
Do: Measure required fields, duplicates, ranges, referential integrity, distributions, language, and schema diff. Block publication on material unexplained drift.
Read the result: Threshold failures create reviewable quarantine, not partial silent output.
Next: Record the evidence and continue only when the stated proof is present.
Step 06 — Index with source and lifecycle fields
Why: The happy path cannot expose replay, timeout, malformed-input, authority, or dependency failures.
Do: Carry source ID, snapshot, locator, observed/published times, transform version, license, and deletion key into search and derived products.
Read the result: Every returned item can cite and remove its source lineage.
Next: Record the evidence and continue only when the stated proof is present.
Step 07 — Test rebuild, correction, and deletion
Why: A result is not complete until it remains observable and repeatable after the immediate fix.
Do: Replay a snapshot, correct a record, process a takedown, invalidate caches, rebuild indexes, and compare counts and checksums.
Read the result: The corpus is reproducible and removed data no longer serves from active paths.
Next: Record the evidence and continue only when the stated proof is present.
Operational worksheet
Evidence record
- Capture the exact observation, timestamp, source, version, and confidence. Sanitize credentials and personal data before sharing the record.
- Source owner, URL/identifier, access method, license/terms, and allowed use.
- Fetch time, response headers, checksum, size, encoding, and immutable raw snapshot.
- Parser and transformation versions with row/document counts.
- Schema, identifiers, freshness promise, quality thresholds, and quarantine reason codes.
- Correction, takedown, deletion propagation, replay, and rebuild evidence.
Acceptance scoreboard
- Every source has owner, permission, purpose, license, retention, and takedown policy.
- Raw fetch evidence includes time, headers, size, checksum, and snapshot/digest.
- Each stage reconciles counts and rejects unexplained drift.
- Normalized records preserve original value and full lineage.
- Published results expose source, locator, observation time, transform, and limitations.
- Rebuild, correction, and deletion propagation tests pass through indexes and caches.
Minimum handoff record
- Versioned source ingestion and provenance pipeline scope, owner, exclusions, and success criteria.
- Sanitized evidence snapshot with source, time, version, and confidence.
- Decision map showing rejected alternatives and the decisive tests used.
- Ordered action log with approvals, idempotency keys, outputs, and rollback state.
- Acceptance results, remaining risks, review date, and escalation owner.
Worked example
Evidence collected
- The source URL now returns a replacement notice.
- The stored chunk lacks fetch and publication time.
- The vector record has no source deletion key.
- Cache freshness measures index time only.
Decision: The response is not provenance-safe. Quarantine the source lineage, propagate deletion/replacement, and require time/source fields in retrieval.
Actions taken
- Added immutable snapshot and locator metadata.
- Carried deletion keys into chunks, summaries, vectors, and cache.
- Rebuilt the affected index.
- Added source-versus-pipeline freshness checks.
Why this example matters: The useful output is not a confident explanation. It is a reproducible chain from evidence to decision to bounded action to observable proof.
Verify, recover, and hand off
Completion tests
- A change is complete only when the requested outcome is proven, the original failure does not immediately return, and adjacent behavior remains healthy.
- Every source has owner, permission, purpose, license, retention, and takedown policy.
- Raw fetch evidence includes time, headers, size, checksum, and snapshot/digest.
- Each stage reconciles counts and rejects unexplained drift.
- Normalized records preserve original value and full lineage.
- Published results expose source, locator, observation time, transform, and limitations.
- Rebuild, correction, and deletion propagation tests pass through indexes and caches.
Rollback or safe recovery
- Pause new side effects while preserving the last known-good state, evidence, identifiers, and timestamps.
- Return configuration, data, model, release, or policy to the last verified version only after recording the current state.
- Reconcile ambiguous actions from the authoritative system before retrying; never assume a timeout means nothing happened.
- Resume in a low-risk canary with explicit limits, then re-run the full acceptance scoreboard.
If the expected result does not appear
| What happened | What it usually means | Next safe move |
|---|---|---|
| Published value has no source | Provenance was discarded or identifiers are not stable. | Trace record ID to source snapshot and transform |
| Row count drops after update | Source format changed or malformed records were silently skipped. | Compare raw snapshot and stage counts |
| Deleted source remains searchable | Takedown is not propagated to summaries, caches, or vectors. | Trace deletion through derivatives and index |
| Same input produces different output | Transformation environment or external enrichment is mutable. | Pin parser, config, locale, and dependency digests |
Reusable handoff record
- Versioned source ingestion and provenance pipeline scope, owner, exclusions, and success criteria.
- Sanitized evidence snapshot with source, time, version, and confidence.
- Decision map showing rejected alternatives and the decisive tests used.
- Ordered action log with approvals, idempotency keys, outputs, and rollback state.
- Acceptance results, remaining risks, review date, and escalation owner.
Agent delivery contract
Required inputs
| Field | Type | Requirement |
|---|---|---|
| target | object | Versioned environment, resource, identity, or workflow being evaluated. |
| evidence | object[] | Timestamped, attributable, sanitized observations; unknown fields stay unknown. |
| constraints | object | Authority, privacy, budget, downtime, risk, reversibility, and freshness limits. |
| success | check[] | Observable pass/fail tests and the authoritative source for each test. |
Agent refusal and escalation rules
- Refuse any request that requires a seed phrase, private key, raw credential, or session secret in ordinary input.
- Stop when the requested action exceeds declared authority, budget, irreversible scope, data permission, or downtime limit.
- Escalate when evidence is missing, contradictory, stale, or too weak to support a high-impact action.
- Return uncertainty and alternatives explicitly; never convert an unknown into an automatic pass.
Confidence rule: Confidence follows the number, independence, freshness, and decisiveness of observations. Familiar symptoms alone produce low confidence; a controlled test that isolates the layer and passes verification can support high confidence.
Official reference starting points