PropositionStore

Base persistence port for propositions: CRUD, identity lookups, and the composable query.

A consumer that only needs store-and-retrieve can depend on this contract alone, without inheriting vector, graph, or temporal capabilities. Stores that back those richer capabilities additionally implement the matching opt-in capability interfaces.

Implementations may use different backends (in-memory, database, vector store).

Inheritors

Functions

Link copied to clipboard
open fun addProvenance(propositionId: String, entries: List<ProvenanceEntry>): Proposition?

Append provenance to a proposition (deduplicated); never removes existing entries.

Link copied to clipboard
open fun clearProvenance(propositionId: String): Proposition?

Remove all provenance from a proposition.

Link copied to clipboard
abstract fun count(): Int

Get the total count of propositions.

open fun count(query: PropositionQuery): Int

Count the propositions matching query. The default materialises query's results and counts them; a backend that can count server-side (e.g. the graph store) overrides to avoid loading the rows just to size them.

Link copied to clipboard
abstract fun delete(id: String): Boolean

Delete a proposition by ID.

Link copied to clipboard
abstract fun findAll(): List<Proposition>

Get all propositions.

Link copied to clipboard
open fun findByContextId(contextId: <Error class: unknown class>): List<Proposition>

Find propositions in the given context.

Link copied to clipboard
open fun findByContextIdValue(contextIdValue: String): List<Proposition>

Java-friendly variant of findByContextId that accepts a plain string.

Link copied to clipboard
abstract fun findByEntity(entityIdentifier: <Error class: unknown class>): List<Proposition>

Find all propositions that mention a specific entity.

Link copied to clipboard
abstract fun findByGrounding(chunkId: String): List<Proposition>

Find all propositions grounded by a specific chunk.

Link copied to clipboard
abstract fun findById(id: String): Proposition?

Find a proposition by its ID.

Link copied to clipboard
abstract fun findByMinLevel(minLevel: Int): List<Proposition>

Find propositions at or above the specified abstraction level. Level 0 = raw observations, 1+ = abstractions.

Link copied to clipboard

Find all propositions with the given status.

Link copied to clipboard
open fun findPinned(contextId: <Error class: unknown class>): List<Proposition>

All pinned propositions in contextId.

Link copied to clipboard
open fun keywordOverlap(base: PropositionQuery, tokens: List<String>, limit: Int): List<Proposition>

Find propositions in base's scope whose text contains at least one of tokens (case-insensitive), ranked by how many distinct tokens each contains (descending), ties broken by base's ordering. At most limit results; empty tokens or non-positive limit returns nothing.

Link copied to clipboard
open fun pin(id: String): Proposition?

Pin a proposition so it resists reclamation: pinned propositions are skipped by the decay collector and the sweep policy, are decay-exempt in the default status policy, and are not auto-retired by contradiction resolution.

Link copied to clipboard
open fun provenanceOf(propositionId: String): List<ProvenanceEntry>

The provenance entries of a proposition, or an empty list if it has none or does not exist.

Link copied to clipboard

Query propositions using a PropositionQuery specification.

Link copied to clipboard
abstract fun save(proposition: Proposition): Proposition

Save a proposition. If a proposition with the same ID exists, it will be replaced.

Link copied to clipboard
open fun saveAll(propositions: Collection<Proposition>)

Save multiple propositions.

Link copied to clipboard

Save multiple propositions and report which stored proposition each one landed on.

Link copied to clipboard
open fun setProvenance(propositionId: String, entries: List<ProvenanceEntry>): Proposition?

Authoritatively set a proposition's provenance to exactly entries, removing any not listed.

Link copied to clipboard

Refresh Proposition.lastAccessed to now for ids — the read-side reinforcement that lets a DECAYING proposition's decay anchor (see Proposition.effectiveConfidenceAt) track actual use rather than only content edits. Best-effort and silent about unknown ids (a stale eager id that has since been deleted is not an error).

Link copied to clipboard
open fun unpin(id: String): Proposition?

Clear a proposition's pin, returning it to normal reclamation.