Record Class Provenance
java.lang.Object
java.lang.Record
ai.doctruth.Provenance
- Record Components:
model- logical model identifier, e.g."claude-sonnet-4-7".modelVersion- provider-reported model version, e.g. a date stamp or build id.extractedAt- UTC timestamp at which the extraction call completed.sourcePublishedAt- UTC timestamp at which the source document was published, if known.details- retry / residency / retention metadata.
public record Provenance(String model, String modelVersion, Instant extractedAt, Optional<Instant> sourcePublishedAt, ProvenanceDetails details)
extends Record
Bi-temporal provenance for an
ExtractionResult: the model that produced it, when
the extraction ran, and (optionally) when the source document was authored, the region
the extraction was processed in, and the retention horizon of the audit record.
The bi-temporal pair (extractedAt, sourcePublishedAt) is the
differentiator vs. typical Java extraction pipelines: downstream auditors can answer
"did we extract this value before or after the source was updated?" without storing
extra metadata on every record.
The two compliance fields region and retainUntil close the
AU-bank-tier audit gap: when a regulator asks "where was this processed?" or "how long
are you keeping the audit record?", these fields give a verifiable answer per record.
Invariants (enforced by the compact constructor):
model,modelVersionare non-null and non-blank.extractedAtis non-null.sourcePublishedAtis a non-nullOptional. PassOptional.empty(), notnull, when absent.detailsis non-null and carries retry / residency / retention metadata.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionProvenance(String model, String modelVersion, Instant extractedAt, Optional<Instant> sourcePublishedAt, ProvenanceDetails details) Creates an instance of aProvenancerecord class.Provenance(String model, String modelVersion, Instant extractedAt, Optional<Instant> sourcePublishedAt, Optional<String> region, Optional<Instant> retainUntil, int retries) -
Method Summary
Modifier and TypeMethodDescriptiondetails()Returns the value of thedetailsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theextractedAtrecord component.final inthashCode()Returns a hash code value for this object.model()Returns the value of themodelrecord component.Returns the value of themodelVersionrecord component.region()intretries()Returns the value of thesourcePublishedAtrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Provenance
-
Provenance
public Provenance(String model, String modelVersion, Instant extractedAt, Optional<Instant> sourcePublishedAt, ProvenanceDetails details) Creates an instance of aProvenancerecord class.- Parameters:
model- the value for themodelrecord componentmodelVersion- the value for themodelVersionrecord componentextractedAt- the value for theextractedAtrecord componentsourcePublishedAt- the value for thesourcePublishedAtrecord componentdetails- the value for thedetailsrecord component
-
-
Method Details
-
region
-
retainUntil
-
retries
public int retries() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
model
-
modelVersion
Returns the value of themodelVersionrecord component.- Returns:
- the value of the
modelVersionrecord component
-
extractedAt
Returns the value of theextractedAtrecord component.- Returns:
- the value of the
extractedAtrecord component
-
sourcePublishedAt
Returns the value of thesourcePublishedAtrecord component.- Returns:
- the value of the
sourcePublishedAtrecord component
-
details
-