Drivine Projection Record Store
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.
Functions
Find all records for propositions in a given context. Used to scope projection-health summaries so one context never sees another's lineage.
Find all records for a given proposition.
Find all records produced by a given run.
Find all records for a given target.
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.
Find all records currently in the ProjectionLifecycle.STALE state.
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.
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.