NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
sqlite_evidence_ledger.h
Go to the documentation of this file.
1
5#pragma once
6
8
9#include <chrono>
10#include <memory>
11#include <string>
12
13namespace neograph::research {
14
20class NEOGRAPH_API SqliteEvidenceLedger final : public EvidenceLedger {
21public:
22 explicit SqliteEvidenceLedger(const std::string& db_path);
23 SqliteEvidenceLedger(const std::string& db_path,
24 std::chrono::milliseconds busy_timeout);
25 ~SqliteEvidenceLedger() override;
26
28 SqliteEvidenceLedger& operator=(const SqliteEvidenceLedger&) = delete;
29
30 void register_source(SourceIdentity source) override;
31 [[nodiscard]] std::optional<SourceIdentity> source(std::string_view source_id) const override;
32
33 void create_task(ResearchTaskSpec task) override;
34 [[nodiscard]] std::optional<ResearchTask>
35 task(std::string_view owner_scope, std::string_view task_id) const override;
36
37 [[nodiscard]] std::vector<ResearchTask>
38 tasks(std::string_view owner_scope, bool include_terminal) const override;
39
40 [[nodiscard]] std::optional<ResearchTaskLease>
42 [[nodiscard]] bool renew_lease(const ResearchTaskLease& lease,
43 std::uint64_t now_unix_ms) override;
44 [[nodiscard]] std::vector<std::string>
45 expire_leases(std::string_view owner_scope, std::uint64_t now_unix_ms) override;
46 [[nodiscard]] EvidencePublishResult
48 std::uint64_t now_unix_ms) override;
49
50 [[nodiscard]] std::vector<EvidenceArtifact>
51 artifacts_for_claim(std::string_view owner_scope, std::string_view claim_id) const override;
52 [[nodiscard]] SourceLifecycle source_lifecycle(std::string_view owner_scope,
53 std::string_view source_id,
54 std::uint64_t now_unix_ms) const override;
55 [[nodiscard]] ClaimResolution resolve_claim(std::string_view owner_scope,
56 std::string_view claim_id) const override;
57
58private:
59 struct Impl;
60 std::shared_ptr<Impl> impl_;
61};
62
63} // namespace neograph::research
SQLite-backed ledger with BEGIN IMMEDIATE lease/publication transitions.
EvidencePublishResult publish(const ResearchTaskLease &lease, EvidenceArtifact artifact, std::uint64_t now_unix_ms) override
Atomically commits evidence and terminally publishes the claimed task.
std::optional< ResearchTaskLease > acquire_lease(ResearchLeaseRequest request) override
Atomically claims a ready/expired task.
bool renew_lease(const ResearchTaskLease &lease, std::uint64_t now_unix_ms) override
Extends only the exact live lease generation.
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.
std::vector< ResearchTask > tasks(std::string_view owner_scope, bool include_terminal) const override
Returns owner-scoped task snapshots in deterministic task-id order.
Durable, typed coordination boundary for research work.
Deterministic planner result derived from committed evidence only.
Caller-supplied idempotency identity for one work claim.
Immutable proof that a worker owns the current task generation.
Immutable version-specific source identity.