Skip to main content

Module source

Module source 

Source
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:

Crosswalk navigation: provenance is the source-entry receipt used by entity pages, workflow packets, storage records, and runtime shells. See docs/entity-atlas/contract-crosswalk/source-provider-flows.md for entry and normalization, workflow-packets.md for workflow use, storage-persistence.md for stored source refs, and runtime-exposure.md for API/script exposure.

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 provider mapping vocabulary kept separate from app-owned policy decisions.
record
Source-record identity and relationship vocabulary used for provenance joins.
reservation
Reservation source snapshots and assumptions retained for booking/review workflows.

Structs§

Endpoint
Provider API endpoint or import route that produced source data.
ExtractionBatchId
Identifier that groups records from the same provider extraction run.
ObservedStatus
Status text observed directly from the provider before normalization.
PayloadHash
Hash of the provider payload used for idempotency and drift checks.
Provenance
Lineage metadata that ties normalized data back to its provider record.
ProvenanceBuilder
Use builder syntax to set the inputs and finish with build().
RawPayloadRef
Storage reference for the unnormalized provider payload.
RecordRef
Stable pointer to an upstream record and the system that owns it.
RequestScope
Import or API scope requested from the provider during extraction.
SchemaVersion
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.