DivineTree.ICPVault.Storage 1.0.0

dotnet add package DivineTree.ICPVault.Storage --version 1.0.0
                    
NuGet\Install-Package DivineTree.ICPVault.Storage -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DivineTree.ICPVault.Storage" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DivineTree.ICPVault.Storage" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DivineTree.ICPVault.Storage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DivineTree.ICPVault.Storage --version 1.0.0
                    
#r "nuget: DivineTree.ICPVault.Storage, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DivineTree.ICPVault.Storage@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DivineTree.ICPVault.Storage&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DivineTree.ICPVault.Storage&version=1.0.0
                    
Install as a Cake Tool

DivineTree.ICPVault.Storage

Connection Framework for ICPVault Storage Implementations

NuGet License: MIT .NET 9


What Is This?

DivineTree.ICPVault.Storage is the connection framework for DivineTree.ICPVault storage implementations. It provides connection lifecycle, retry with exponential backoff, exception translation, and disposal so your implementation focuses on pure storage queries only.

Zero storage SDK. No Neo4j, Cosmos, or any other storage dependency ships in this NuGet.


Installation

dotnet add package DivineTree.ICPVault.Storage

Requires:

dotnet add package DivineTree.ICPVault

What Ships in This Package

Component Purpose
IVaultConnectionManager Connection lifecycle — OpenAsync · CloseAsync · IsHealthyAsync · IsOpen
IVaultRetryPolicy Retry contract — ExecuteAsync · ExecuteAsync<T>
DefaultVaultRetryPolicy 3 attempts · exponential backoff 200ms · transient only · configurable
DefaultVaultConnectionManager Abstract state machine · thread-safe · implement 3 methods
BaseVaultStorageAdapter<TAgenticContext> Wires connection + retry + error handling — implement 3 pure query methods
VaultStorageException Typed exception — StorageOperation · IsTransient · InnerException always preserved

Quick Start

Extend BaseVaultStorageAdapter<TAgenticContext> and implement three methods:

public sealed class Neo4jAIEnvelopeVault<TAgenticContext>
    : BaseVaultStorageAdapter<TAgenticContext>
    where TAgenticContext : class
{
    protected override async Task ExecutePersistAsync(
        AIVaultRecord<TAgenticContext> record, CancellationToken ct)
    {
        // Pure storage query only
        // Framework owns: guard clauses · connection · retry · exception translation
    }

    protected override async Task<IReadOnlyList<AIVaultRecord<TAgenticContext>>> ExecuteQueryAsync(
        AIVaultQuery query, CancellationToken ct) { ... }

    protected override async Task<int> ExecuteCountAsync(CancellationToken ct) { ... }
}

What the Framework Owns

Caller
  |
Guard clauses          — null record · empty lineage chain → ArgumentException
  |
EnsureConnectionAsync  — opens if closed · health check before every operation
  |
Retry                  — 3 attempts · exponential backoff · transient only
  |
ExecutePersistAsync    — YOUR CODE — pure storage query
  |
Exception translation  — raw exceptions → VaultStorageException
  |
Dispose                — connection manager lifecycle

Implementing a Connection Manager

Extend DefaultVaultConnectionManager and implement three methods:

public sealed class Neo4jConnectionManager : DefaultVaultConnectionManager
{
    public IDriver? Driver { get; private set; }

    protected override Task OpenConnectionAsync(CancellationToken ct)
    {
        Driver = GraphDatabase.Driver(_uri, AuthTokens.Basic(_username, _password));
        return Task.CompletedTask;
    }

    protected override async Task CloseConnectionAsync(CancellationToken ct)
    {
        if (Driver is not null) { await Driver.DisposeAsync(); Driver = null; }
    }

    protected override async Task<bool> CheckHealthAsync(CancellationToken ct)
    {
        if (Driver is null) return false;
        try { await Driver.VerifyConnectivityAsync(); return true; }
        catch { return false; }
    }
}

AuraDB URI Scheme Note

When using neo4j+s:// URI — do not call WithEncryptionLevel. The +s scheme implies TLS.


Design Principles

  1. The framework owns plumbing. Your implementation owns queries.
  2. Connection is opened lazily — on first operation, not on construction.
  3. Health is checked before every operation.
  4. Only transient failures are retried.
  5. All exceptions are translated to VaultStorageException.
  6. Disposal is deterministic — always await using.

License

MIT — see LICENSE.


DivineTreeDesigns — Sovereign Confidential

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 133 5/17/2026