Class TemporalIndex
The identity snapshot is computed once, on first use, and cached. Callers
that select Strategy.TEMPORAL must force the full structural check
with validate() before retrieval enters its failure-policy
boundary: malformed temporal metadata is a configuration fault, not a
transport failure, so it must not be routed through
@Search.onFailure.
- Since:
- 0.13.0
-
Constructor Summary
ConstructorsConstructorDescriptionTemporalIndex(List<RetrievedDocument> documents) Creates an index over documents carrying temporal metadata. -
Method Summary
Modifier and TypeMethodDescriptionReturns the source documents in declaration order.Resolves an indexed document by entry ID.identifier(RetrievedDocument document) Resolves the canonical entry ID carried by a child hit.intsize()Returns the validated number of unique documents.sourceGroup(RetrievedDocument document) Resolves the source group used for source fencing.Parses the canonical timestamp for one resolved entry.voidvalidate()Checks every structural invariant this index can decide from its own documents: canonical identity, duplicate entry IDs, and the presence and ISO-8601 syntax of every declaredTemporalMetadata.TIMESTAMP.
-
Constructor Details
-
TemporalIndex
Creates an index over documents carrying temporal metadata.- Parameters:
documents- source documents in declaration order
-
-
Method Details
-
documents
Returns the source documents in declaration order.- Returns:
- immutable source document list
-
size
public int size()Returns the validated number of unique documents.- Returns:
- index size
-
validate
public void validate()Checks every structural invariant this index can decide from its own documents: canonical identity, duplicate entry IDs, and the presence and ISO-8601 syntax of every declaredTemporalMetadata.TIMESTAMP.Whether a document carries a unique entry ID and a parseable timestamp is fixed by the Role's knowledge sources and the installed
SourceLoaders, never by request data, so this runs at strategy-selection time — above the@Search.onFailureguard, the same rulererankerModel,queryExpansionModel,GraphStoreProviderresolution and hierarchy validation follow. Routing malformed temporal metadata through the guard would letCONTINUEemit a silently ungrounded action that reports success andUSE_CACHEanswer it from a stale entry, for what is a deployment fault.Clock-relative faults are deliberately excluded. Whether a timestamp exceeds the tolerated future skew depends on the retrieval instant rather than on configuration — the same index turns valid as wall-clock time advances — so that check stays a runtime concern and still reaches the guard from
retrieve(). Failures raised while traversing a valid index do the same.- Throws:
TemporalException- when any structural invariant is violated
-
find
Resolves an indexed document by entry ID.- Parameters:
id- canonical entry ID- Returns:
- matching document, if present
-
identifier
Resolves the canonical entry ID carried by a child hit.- Parameters:
document- indexed document or child hit- Returns:
- non-blank entry ID, falling back to the document source
-
timestamp
Parses the canonical timestamp for one resolved entry.- Parameters:
id- canonical entry ID- Returns:
- timestamp, or empty when the document is intentionally undated
-
sourceGroup
Resolves the source group used for source fencing.- Parameters:
document- indexed document- Returns:
- temporal source metadata, or document source as fallback
-