DrivineProjectionRecordStore

class DrivineProjectionRecordStore(persistenceManager: <Error class: unknown class>) : ProjectionRecordStore

Drivine / Neo4j ProjectionRecordStore: persists projection lineage as (:ProjectionRecord) nodes so it survives a restart and stays queryable by proposition or lifecycle. The graph counterpart of the in-memory store, shipping here alongside DrivinePropositionRepository.

The query methods on the SPI default to filtering all in memory, so this only supplies the writer (record), the reader (all), and a real markStaleByProposition — the SPI default for that one is a no-op, which against a durable store would silently leave the lifecycle cascade dead. Every statement is parameterized; user-derived values are never interpolated into Cypher.

Constructors

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

Functions

Link copied to clipboard
open override fun all(): List<ProjectionRecord>
Link copied to clipboard
open override fun findByContext(contextId: String): List<ProjectionRecord>

Find all records for propositions in a given context. Used to scope projection-health summaries so one context never sees another's lineage.

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

Find all records for a given proposition.

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

Find all records produced by a given run.

Link copied to clipboard
open override fun findByTarget(target: String): List<ProjectionRecord>

Find all records for a given target.

Link copied to clipboard
open override fun findByTargetRef(targetRef: String): List<ProjectionRecord>

Trace from a produced/adopted artifact back to the projection records that reference it. Starting from a target artifact reference (e.g. a graph node ID), this returns every record whose ProjectionRecord.targetRef matches, across all lifecycles — so a reviewer can see whether the artifact was created (PROJECTED), adopted/aligned (ADOPTED), skipped, failed, or has gone stale.

Link copied to clipboard
open override fun findStale(): List<ProjectionRecord>

Find all records currently in the ProjectionLifecycle.STALE state.

Link copied to clipboard
open override fun markStaleByProposition(propositionId: String): Int

Flip every non-stale record for the proposition to ProjectionLifecycle.STALE in one statement and return how many were actually transitioned. Scoping to records that are not already stale keeps the operation idempotent: a replayed status-change event for an already-stale proposition transitions nothing and returns 0.

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

Upsert the record on the natural key LineageSchema declares for it (proposition + run + target), so a replayed projection outcome updates in place and no duplicate node piles up. The pattern is built from that key, which keeps the write and the uniqueness constraint protecting it on one definition.