DrivineCollectorRecordStore

class DrivineCollectorRecordStore(persistenceManager: <Error class: unknown class>) : CollectorRecordStore

Drivine / Neo4j CollectorRecordStore: persists the collector audit trail as (:CollectorRecord) and (:CollectorRun) nodes so collection history survives a restart. The graph counterpart of the in-memory store, shipping here alongside DrivinePropositionRepository.

The query methods default to filtering all / runs in memory, so only the writers (record, recordRun) and readers (all, runs) are supplied here. Writes MERGE on the natural key LineageSchema declares, built from that same key, so a retried record updates the node already there and the uniqueness constraint protecting it always covers what the write matched on. Every statement is parameterized; user-derived values are never interpolated into Cypher.

The natural key is (propositionId, runId), so one proposition marked by several strategies in one run keeps one row here and the last write wins — where the in-memory store keeps one row per mark. Anything a reader needs to trust across both stores has to be identical on every record a run writes for a proposition, which is why mergedIntoId carries the survivor the sweep actually merged into rather than the one an individual mark proposed.

undoneAt is the exception to last-write-wins, and it has to be: replaying an outcome is supported, and a replayed record carries no stamp, so a plain SET would clear one already stored and re-authorize a collapse that was undone. It is written through coalesce instead, so a stamp arriving wins and a replay preserves whatever is there. The append-only in-memory store gets the same property for free, since the stamped record stays beside the replayed one.

Constructors

Link copied to clipboard
constructor(persistenceManager: <Error class: unknown class>)

Functions

Link copied to clipboard
open override fun all(): List<CollectorRecord>
Link copied to clipboard
open override fun findByProposition(propositionId: String): List<CollectorRecord>

Find all records for a given proposition.

Link copied to clipboard
open override fun findByRun(runId: String): List<CollectorRecord>

Find all records produced by a given run.

Link copied to clipboard
open override fun findRun(runId: String): CollectorRun?

Find the run header for a given run id.

Link copied to clipboard
open override fun record(record: CollectorRecord)

Record a collector outcome.

Link copied to clipboard
open override fun recordRun(run: CollectorRun)

Record a finished run header.

Link copied to clipboard
open override fun runs(): List<CollectorRun>