Path: redb-route/redb.Route.Llm/Storage/Redb/Schemas/ToolCacheProps.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Llm/Storage/Redb/Schemas/ToolCacheProps.cs
----
using redb.Core.Attributes;
namespace redb.Route.Llm.Storage.Redb.Schemas;
///
/// Cached deterministic tool output. The key is built by Tools/ToolCacheKey.StoreKey and shaped
/// persist:{toolName}:{hash} — the hash folds in the tool name, the resolved endpoint URI, the
/// governance-policy fingerprint, the caller fingerprint and the tool input JSON, so an entry written
/// while a tool was laxer can never answer a call made after the tool got stricter. Only
/// Persist-policy entries reach this store; None and Memoize never do (the latter
/// stays in the in-process memo: layer).
///
/// The key lives on the value_string column of _objects (partial index on
/// PostgreSQL/SQLite; no index on MSSQL), not in props — lookups are server-side via
/// WhereRedb(o => o.ValueUnique == RedbUniqueKey.Normalize(key)); the key also rides,
/// normalized, in value_unique (per-scheme unique race barrier).
/// The store honours lazily — entries past expiry are dropped on read.
///
///
[RedbScheme("LLM Tool Cache")]
public class ToolCacheProps
{
///
/// Optional tool name for scoped invalidation / metrics. Not written today — the tool name already
/// rides in the clear inside the cache key (an _objects column), which is the only place a
/// server-side query can reach it without touching props (Tools/ToolCacheKey.cs).
///
public string? ToolName { get; set; }
/// JSON-serialized tool output.
public string OutputJson { get; set; } = "{}";
/// When the entry was created.
public DateTimeOffset CreatedAtUtc { get; set; }
/// Optional expiry; null = no TTL.
public DateTimeOffset? ExpiresAtUtc { get; set; }
}