SourceRevisionQueryCapable

Opt-in capability for asking which propositions were read from a source, and from which revision of that source.

These finders live outside PropositionStore and PropositionRepository deliberately. Answering them takes provenance, and plenty of backends store evidence without projecting it on an ordinary context read. A shared default body written over such a read would return an empty list on those backends, and an empty list already has a meaning here: nothing in this context cites that source. A store that cannot look would then be indistinguishable from one that looked and found nothing.

Implementing this interface is the promise that the backend really can look. A caller holding a plain PropositionRepository asks for the capability with an as? test and handles its absence as its own case:

val revisionQueries = repository as? SourceRevisionQueryCapable
?: error("this backend cannot answer source-revision queries")

Each finder is a pair: a typed entry point taking a ContextId, and a plain-String variant that carries the work. The typed one forwards to the String one, matching findByContextId -> findByContextIdValue on PropositionStore. Implementations live on the String variant, because ContextId is a value class: the typed method's JVM name is mangled and a Java backend cannot override it, so an implementation placed there would be invisible to Java callers. The String variant has an ordinary JVM signature and sits on the path of every typed call.

A store whose reads already carry every provenance entry can pick up all three String variants from ProvenanceScanningSourceRevisionQueries.

Inheritors

Properties

Link copied to clipboard

Whether this particular instance can actually answer these queries. Implementing the interface is a type-level promise; this is the runtime truth. A decorator that forwards to a backend it only discovers at construction time reports here whether the backend it got can answer. Callers check this before trusting an empty result.

Functions

Link copied to clipboard
open fun findBySourceKey(contextId: <Error class: unknown class>, sourceKey: String): List<Proposition>

Find propositions in contextId with evidence from any revision of sourceKey.

abstract fun findBySourceKey(contextIdValue: String, sourceKey: String): List<Proposition>

findBySourceKey by plain context-id string — the implementation point, and what Java callers use.

Link copied to clipboard
open fun findBySourceRevision(contextId: <Error class: unknown class>, ref: SourceRevisionRef): List<Proposition>

Find propositions in contextId with evidence from exactly ref's source key and revision.

abstract fun findBySourceRevision(contextIdValue: String, ref: SourceRevisionRef): List<Proposition>

findBySourceRevision by plain context-id string — the implementation point, and what Java callers use.

Link copied to clipboard
open fun findRevisionlessBySourceLocator(contextId: <Error class: unknown class>, locator: SourceLocator): List<Proposition>

Find propositions in contextId with revisionless evidence whose locator key equals locator's key.

abstract fun findRevisionlessBySourceLocator(contextIdValue: String, locator: SourceLocator): List<Proposition>

findRevisionlessBySourceLocator by plain context-id string — the implementation point, and what Java callers use.