DivineTree.DCPVault 1.0.0

dotnet add package DivineTree.DCPVault --version 1.0.0
                    
NuGet\Install-Package DivineTree.DCPVault -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.DCPVault" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DivineTree.DCPVault" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DivineTree.DCPVault" />
                    
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.DCPVault --version 1.0.0
                    
#r "nuget: DivineTree.DCPVault, 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.DCPVault@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.DCPVault&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DivineTree.DCPVault&version=1.0.0
                    
Install as a Cake Tool

DivineTree.DCPVault

Sovereign Intelligence Accumulation Layer — Domain Corpus Vault for DCP Envelopes

NuGet License: MIT .NET 9


The Problem

DivineTree.DCP carries rich intelligence across every service boundary — lineage, context, intent, observability. When the workflow completes, DataEnvelope<T> goes out of scope and is garbage collected.

21 steps of sovereign reasoning. Gone.

ToAuditSummary() survives. The complete intelligence molecule does not — the full lineage chain, the confidence progression, the regulatory context that governed every decision, the observability data across every act.

The platform processes thousands of applications but learns nothing from them.

DivineTree.DCPVault is the sovereign intelligence accumulation layer that fixes this. It persists sanitised, PII-free vault records to a storage backend — accumulating a domain corpus for training, analytics, and platform improvement.


What Is DCPVault?

DivineTree.DCPVault ships the pattern — the contract, the record model, the sanitiser base class, and an in-memory implementation for dev/test. Your platform provides the storage implementation.

Zero storage SDK in the NuGet. Storage is always a platform decision.

Component What It Is
IEnvelopeVault<TDomain> Storage contract — PersistAsync · QueryAsync · CountAsync
VaultRecord<TDomain> Sanitised record — pattern fields + typed TDomain DomainContext
BaseEnvelopeSanitiser<T, TDomain> Template method — NuGet extracts pattern fields · platform implements ExtractDomainContext
InMemoryEnvelopeVault<TDomain> Dev/test implementation — zero infra — ships with the NuGet
VaultQuery Structured query — Outcome · LineageDepth · DateRange · MaxResults

Installation

dotnet add package DivineTree.DCPVault

For the connection framework (retry, pooling, base storage adapter):

dotnet add package DivineTree.DCPVault.Storage

Quick Start

Step 1 — Define your domain context (PII-free):

public sealed class LoanVaultDomainContext
{
    public string  ProductType    { get; init; } = string.Empty;
    public string  RiskTier       { get; init; } = string.Empty;
    public double  ConfidenceScore { get; init; }
    public string? HaltCode       { get; init; }
    public bool    HITLTriggered  { get; init; }
}

Step 2 — Implement the sanitiser:

public sealed class LoanEnvelopeSanitiser
    : BaseEnvelopeSanitiser<LoanApplication, LoanVaultDomainContext>
{
    protected override LoanVaultDomainContext ExtractDomainContext(
        DataEnvelope<LoanApplication> envelope)
    {
        // Extract PII-free domain context only
        // Never include: names, SSN, account numbers, addresses
        return new LoanVaultDomainContext
        {
            ProductType     = envelope.Payload.ProductType,
            RiskTier        = envelope.Payload.RiskTier,
            ConfidenceScore = envelope.Observability.GetMetric("confidence_score"),
            HaltCode        = envelope.Context.Properties.GetValueOrDefault("halt_code"),
            HITLTriggered   = envelope.Context.Properties.ContainsKey("hitl_tier")
        };
    }
}

Step 3 — Persist at workflow close:

// At workflow completion — orchestrator owns this, never the agents
var sanitiser   = new LoanEnvelopeSanitiser();
var vaultRecord = sanitiser.Sanitise(envelope);
await _vault.PersistAsync(vaultRecord);

Step 4 — Query the corpus:

var results = await _vault.QueryAsync(new VaultQuery
{
    Outcome         = "HALT",
    MinLineageDepth = 10,
    From            = DateTime.UtcNow.AddDays(-30),
    MaxResults      = 100
});

VaultRecord Structure

VaultRecord<TDomain>
├── Pattern fields (NuGet owns — always present)
│   ├── VaultId               — GUID
│   ├── CorrelationId         — W3C trace-id
│   ├── WorkflowId
│   ├── FacadeId
│   ├── SchemaVersion         — "1.0"
│   ├── Outcome               — APPROVED · HALT · HITL · REJECTED · FAILED
│   ├── ActReachedBeforeClose
│   ├── CreatedAtUtc
│   ├── ClosedAtUtc
│   ├── TotalDuration
│   ├── LineageChain          — IReadOnlyList<VaultLineageStep> — never empty
│   ├── LineageStepCount      — denormalised
│   ├── Observability         — VaultObservability
│   ├── VaultedAtUtc
│   └── PlatformVersion
│
└── DomainContext: TDomain    — Platform owns — PII-free by contract

BaseEnvelopeSanitiser — Template Method

The NuGet owns extraction of all pattern fields from the envelope. Your platform implements one method: ExtractDomainContext.

// NuGet does this — you never rewrite it
public VaultRecord<TDomain> Sanitise(DataEnvelope<T> envelope)
{
    return new VaultRecord<TDomain>
    {
        VaultId          = Guid.NewGuid().ToString("N"),
        CorrelationId    = envelope.Context.CorrelationId,
        WorkflowId       = envelope.Context.WorkflowId,
        // ... all pattern fields extracted here
        DomainContext    = ExtractDomainContext(envelope)  // ← you implement this
    };
}

// Your platform implements this — one method, no boilerplate
protected abstract TDomain ExtractDomainContext(DataEnvelope<T> envelope);

The payload never enters the vault. BaseEnvelopeSanitiser never touches envelope.Payload directly — only your ExtractDomainContext implementation does, and only to read PII-free domain fields.


InMemoryEnvelopeVault

Ships with the NuGet for dev/test. Zero infrastructure required.

var vault = new InMemoryEnvelopeVault<LoanVaultDomainContext>();

await vault.PersistAsync(record);          // idempotent — duplicate CorrelationId is no-op
var results = await vault.QueryAsync(query);
var count   = await vault.CountAsync();

vault.Clear();                             // test utility
var all = vault.All;                       // test utility

PII Boundary — Enforced by Contract

VaultRecord<TDomain> carries zero PII. This is enforced by the pattern, not by validation:

  • BaseEnvelopeSanitiser never touches envelope.Payload
  • ExtractDomainContext is the only seam where payload is accessed
  • Your platform is contractually responsible for extracting only PII-free fields
  • The vault stores what you give it — the sanitiser is your PII boundary

The payload dies with the envelope. The domain corpus lives forever.


Implementing a Storage Backend

Extend BaseVaultStorageAdapter<TDomain> from DivineTree.DCPVault.Storage:

public sealed class Neo4jEnvelopeVault<TDomain>
    : BaseVaultStorageAdapter<TDomain>
    where TDomain : class
{
    protected override async Task ExecutePersistAsync(
        VaultRecord<TDomain> record, CancellationToken ct)
    {
        // Pure storage query — no guard clauses, no retry logic
        // The framework owns that
    }

    protected override async Task<IReadOnlyList<VaultRecord<TDomain>>> ExecuteQueryAsync(
        VaultQuery query, CancellationToken ct) { ... }

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

The framework owns: guard clauses, connection management, retry with exponential backoff, exception translation to VaultStorageException, and disposal.


NuGet Dependency Chain

DivineTree.DCP v1.0.0
    ↓
DivineTree.DCPVault v1.0.0
    ↓
DivineTree.DCPVault.Storage v1.0.0

Consuming platform references both DivineTree.DCPVault and DivineTree.DCPVault.Storage, implements the sanitiser and storage adapter, and wires them via DI.


VaultQuery

new VaultQuery
{
    Outcome          = "HALT",           // filter by outcome
    MinLineageDepth  = 5,                // minimum lineage steps
    MaxLineageDepth  = 21,               // maximum lineage steps
    From             = DateTime.UtcNow.AddDays(-30),
    To               = DateTime.UtcNow,
    MaxResults       = 100               // default: 50
}

VaultQuery.All   // returns all records up to MaxResults

The Two Vaults

DivineTree.DCPVault accumulates the domain corpus — what decisions were made, under what conditions, with what confidence. Its sibling DivineTree.ICPVault (coming) accumulates the reasoning corpus — how the platform thought its way to those decisions.

Vault Corpus Training Value
DivineTree.DCPVault Domain decisions Decision patterns · HITL rates · halt frequency
DivineTree.ICPVault Agentic reasoning Decomposition quality · routing accuracy · replan patterns

Neither NuGet depends on the other. The cross-corpus link is a string reference resolved at query time.


Design Principles

  1. The vault accumulates intelligence. It never reconstructs it.
  2. The payload never enters the vault. PII dies with the envelope.
  3. The NuGet owns the pattern. The platform owns the domain context.
  4. Storage is always a platform decision. Zero storage SDK in the NuGet.
  5. Lineage is mandatory. An empty lineage chain is a contract violation.
  6. Vault write failure is non-blocking. Corpus loss is acceptable — workflow failure is not.
  7. Idempotency is guaranteed. Duplicate CorrelationId is a silent no-op.

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 (1)

Showing the top 1 NuGet packages that depend on DivineTree.DCPVault:

Package Downloads
DivineTree.DCPVault.Storage

Connection framework for DivineTree.DCPVault storage implementations. Provides connection lifecycle, retry with exponential backoff, exception translation, and base storage adapter.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 138 5/17/2026