NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::research::SqliteEvidenceLedger Class Referencefinal

SQLite-backed ledger with BEGIN IMMEDIATE lease/publication transitions. More...

#include <sqlite_evidence_ledger.h>

Inheritance diagram for neograph::research::SqliteEvidenceLedger:
[legend]
Collaboration diagram for neograph::research::SqliteEvidenceLedger:
[legend]

Public Member Functions

std::optional< ResearchTaskLease > acquire_lease (ResearchLeaseRequest request) override
 Atomically claims a ready/expired task.
 
std::vector< std::string > expire_leases (std::string_view owner_scope, std::uint64_t now_unix_ms) override
 Makes this owner's expired leases ready for reassignment.
 
EvidencePublishResult publish (const ResearchTaskLease &lease, EvidenceArtifact artifact, std::uint64_t now_unix_ms) override
 Atomically commits evidence and terminally publishes the claimed task.
 
bool renew_lease (const ResearchTaskLease &lease, std::uint64_t now_unix_ms) override
 Extends only the exact live lease generation.
 
std::vector< ResearchTask > tasks (std::string_view owner_scope, bool include_terminal) const override
 Returns owner-scoped task snapshots in deterministic task-id order.
 

Detailed Description

SQLite-backed ledger with BEGIN IMMEDIATE lease/publication transitions.

Multiple processes may share one database; SQLite serializes writers, while the task generation and lease id prevent stale workers from publishing.

Definition at line 20 of file sqlite_evidence_ledger.h.

Member Function Documentation

◆ acquire_lease()

std::optional< ResearchTaskLease > neograph::research::SqliteEvidenceLedger::acquire_lease ( ResearchLeaseRequest  request)
overridevirtual

Atomically claims a ready/expired task.

Returns nullopt when another unexpired worker holds it or it has reached a terminal state. Repeating the exact active lease request returns the same lease.

Implements neograph::research::EvidenceLedger.

◆ publish()

EvidencePublishResult neograph::research::SqliteEvidenceLedger::publish ( const ResearchTaskLease &  lease,
EvidenceArtifact  artifact,
std::uint64_t  now_unix_ms 
)
overridevirtual

Atomically commits evidence and terminally publishes the claimed task.

A retried identical publication is idempotent; a different artifact for an already published task is rejected rather than last-writer-wins.

Implements neograph::research::EvidenceLedger.


The documentation for this class was generated from the following file: