Expand description
Source-system provenance contracts for Gingr/import facts and normalization assumptions. Source-system provenance and record references for app-owned operational facts.
Provenance travels with facts so an agent draft can cite the app-owned source evidence it used:
use domain::source;
let provenance = source::Provenance::builder()
.system(source::System::Gingr)
.endpoint(source::Endpoint::try_new("/reservations").unwrap())
.record_id(source::record::Id::try_new("reservation-123").unwrap())
.extraction_batch(source::ExtractionBatchId::try_new("batch-2026-06-18").unwrap())
.pulled_at(source::Timestamp::try_new("2026-06-18T13:00:00Z").unwrap())
.request_scope(source::RequestScope::try_new("manager-daily-brief:loc-1").unwrap())
.schema_version(source::SchemaVersion::try_new("gingr-reservations-v1").unwrap())
.payload_hash(source::PayloadHash::try_new("sha256:fixture").unwrap())
.raw_payload_ref(source::RawPayloadRef::try_new("minio://fixtures/reservation-123.json").unwrap())
.build();
let record_ref = source::RecordRef::from_provenance(&provenance);
assert_eq!(record_ref.system(), source::System::Gingr);
assert_eq!(record_ref.record_id().as_str(), "reservation-123");Modules§
- gingr
- Gingr boundary for source contracts.
- record
- Source-record identity and relationship vocabulary used for provenance joins.
- reservation
- Reservation boundary for source contracts.
Structs§
- Endpoint
- Provider API endpoint or import route that produced source data.
- Extraction
Batch Id - Identifier that groups records from the same provider extraction run.
- Observed
Status - Status text observed directly from the provider before normalization.
- Payload
Hash - Hash of the provider payload used for idempotency and drift checks.
- Provenance
- Lineage metadata that ties normalized data back to its provider record.
- Provenance
Builder - Use builder syntax to set the inputs and finish with
build(). - RawPayload
Ref - Storage reference for the unnormalized provider payload.
- Record
Ref - Stable pointer to an upstream record and the system that owns it.
- Request
Scope - Import or API scope requested from the provider during extraction.
- Schema
Version - Version tag for the source payload schema used during mapping.
- Timestamp
- UTC instant reported by an upstream system for source-data lineage.
Enums§
- Error
- Validation failures returned by source domain constructors.
- System
- Upstream systems that can supply operational, POS, labor, or import data.
Type Aliases§
- Result
- Result type returned by fallible source operations.