Table of Contents

Class AuditLedgerRecord

Namespace
AsiBackbone.Core.Audit
Assembly
AsiBackbone.Core.dll

Represents a persistence-ready audit ledger record captured from AsiBackbone decision receipt.

public sealed class AuditLedgerRecord : IDecisionReceipt
Inheritance
AuditLedgerRecord
Implements
Inherited Members

Properties

AcknowledgmentId

Gets the handshake acknowledgment identifier linked to this record, when supplied.

public string? AcknowledgmentId { get; }

Property Value

string

ActorDisplayName

Gets the optional display name or label associated with the actor.

public string? ActorDisplayName { get; }

Property Value

string

ActorId

Gets the stable actor identifier associated with the event.

public string ActorId { get; }

Property Value

string

ActorType

Gets the actor type associated with the event.

public GovernanceActorType ActorType { get; }

Property Value

GovernanceActorType

CapabilityTokenId

Gets the capability token or grant identifier linked to this record, when supplied.

public string? CapabilityTokenId { get; }

Property Value

string

ConstraintCount

Gets the non-negative number of constraints evaluated for the decision, when supplied by the host.

public int? ConstraintCount { get; }

Property Value

int?

ConstraintSetHash

Gets the hash of the evaluated constraint set, when supplied by the host.

public string? ConstraintSetHash { get; }

Property Value

string

CorrelationId

Gets the correlation identifier associated with the event, when supplied by the host.

public string? CorrelationId { get; }

Property Value

string

DecisionLatencyMs

Gets the non-negative decision latency in milliseconds, when supplied by the host.

public long? DecisionLatencyMs { get; }

Property Value

long?

DecisionReceiptId

Gets the decision receipt identifier copied from the source receipt.

public string DecisionReceiptId { get; }

Property Value

string

Remarks

Falls back to EventId when the source receipt does not supply a distinct identifier, so this value is never null.

DecisionStage

Gets the provider-neutral decision stage associated with the event, when supplied by the host.

public string? DecisionStage { get; }

Property Value

string

EmitterProvider

Gets the provider-neutral emitter provider name, when supplied by the host or outbox provider.

public string? EmitterProvider { get; }

Property Value

string

EmitterStatus

Gets the provider-neutral emitter status, when supplied by the host or outbox provider.

public string? EmitterStatus { get; }

Property Value

string

EventId

Gets the stable audit event identifier copied from the source decision receipt.

public string EventId { get; }

Property Value

string

GatewayExecutionId

Gets the gateway execution identifier associated with the event, when supplied by the host or gateway provider.

public string? GatewayExecutionId { get; }

Property Value

string

HandshakeId

Gets the liability handshake identifier linked to this record, when supplied.

public string? HandshakeId { get; }

Property Value

string

HasMetadata

Gets a value indicating whether the record carries at least one metadata entry.

public bool HasMetadata { get; }

Property Value

bool

HasReasonCodes

Gets a value indicating whether the record carries at least one reason code.

public bool HasReasonCodes { get; }

Property Value

bool

Metadata

Gets the framework-neutral audit metadata, merged from the source receipt and any additional metadata supplied when the record was created.

public IReadOnlyDictionary<string, string> Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>

OccurredUtc

Gets the UTC timestamp when the audited event occurred.

public DateTimeOffset OccurredUtc { get; }

Property Value

DateTimeOffset

OperationName

Gets the operation name associated with the audited event.

public string OperationName { get; }

Property Value

string

OrganizationHash

Gets the privacy-preserving organization hash associated with the decision, when supplied by the host.

public string? OrganizationHash { get; }

Property Value

string

OutboxSequence

Gets the non-negative outbox sequence associated with the event, when supplied by the host or outbox provider.

public long? OutboxSequence { get; }

Property Value

long?

Outcome

Gets the governance, constraint, or host-defined outcome associated with the event.

public string Outcome { get; }

Property Value

string

ParentSpanId

Gets the parent span identifier associated with the event, when supplied by the host or observability adapter.

public string? ParentSpanId { get; }

Property Value

string

PolicyHash

Gets the policy hash associated with the event, when supplied by the host.

public string? PolicyHash { get; }

Property Value

string

PolicyScope

Gets the policy scope associated with the decision, when supplied by the host.

public string? PolicyScope { get; }

Property Value

string

PolicyVersion

Gets the policy version associated with the event, when supplied by the host.

public string? PolicyVersion { get; }

Property Value

string

PreviousRecordHash

Gets the hash of the preceding ledger record, when the host chains records for tamper evidence.

public string? PreviousRecordHash { get; }

Property Value

string

ReasonCodes

Gets the trimmed, non-empty machine-readable reason codes associated with the event.

public IReadOnlyList<string> ReasonCodes { get; }

Property Value

IReadOnlyList<string>

RecordHash

Gets the hash of this ledger record, when computed by the host or ledger store.

public string? RecordHash { get; }

Property Value

string

RecordId

Gets the unique identifier of this ledger record.

public string RecordId { get; }

Property Value

string

Remarks

RecordedUtc

Gets the UTC timestamp when this record was captured for the ledger.

public DateTimeOffset RecordedUtc { get; }

Property Value

DateTimeOffset

RiskScore

Gets the finite, non-negative host-defined risk score associated with the decision, when supplied by the host.

public double? RiskScore { get; }

Property Value

double?

SchemaVersion

Gets the normalized serialized schema version for the record shape.

public string SchemaVersion { get; }

Property Value

string

SignatureAlgorithm

Gets the signature algorithm used to sign the record, when signed.

public string? SignatureAlgorithm { get; }

Property Value

string

SignatureKeyId

Gets the identifier of the key used to sign the record, when signed.

public string? SignatureKeyId { get; }

Property Value

string

SignatureKeyVersion

Gets the version of the key used to sign the record, when supplied.

public string? SignatureKeyVersion { get; }

Property Value

string

SignatureProvider

Gets the name of the signing provider that produced the signature, when supplied.

public string? SignatureProvider { get; }

Property Value

string

SignatureValue

Gets the encoded signature value for the record, when signed.

public string? SignatureValue { get; }

Property Value

string

SignedUtc

Gets the UTC timestamp when the record was signed, when supplied.

public DateTimeOffset? SignedUtc { get; }

Property Value

DateTimeOffset?

SigningHash

Gets the hash that was signed or is intended to be signed, when supplied by the host or signing provider.

public string? SigningHash { get; }

Property Value

string

SigningMetadata

Gets the provider-neutral signing metadata assembled from the individual signature properties on this record.

public SigningMetadata SigningMetadata { get; }

Property Value

SigningMetadata

SpanId

Gets the span identifier associated with the event, when supplied by the host or observability adapter.

public string? SpanId { get; }

Property Value

string

TenantHash

Gets the privacy-preserving tenant hash associated with the decision, when supplied by the host.

public string? TenantHash { get; }

Property Value

string

TraceId

Gets the trace identifier associated with the event, when supplied by the host.

public string? TraceId { get; }

Property Value

string

Methods

FromDecisionReceipt(IDecisionReceipt, string?, DateTimeOffset?, string?, string?, string?, string?, string?, string?, string?, string?, string?, string?, string?, DateTimeOffset?, IReadOnlyDictionary<string, string>?, string?)

Creates a persistence-ready ledger record from a decision receipt, attaching optional handshake, capability, hash-chain, and signature references.

public static AuditLedgerRecord FromDecisionReceipt(IDecisionReceipt receipt, string? recordId = null, DateTimeOffset? recordedUtc = null, string? handshakeId = null, string? acknowledgmentId = null, string? capabilityTokenId = null, string? previousRecordHash = null, string? recordHash = null, string? signatureKeyId = null, string? signatureAlgorithm = null, string? signatureValue = null, string? signingHash = null, string? signatureKeyVersion = null, string? signatureProvider = null, DateTimeOffset? signedUtc = null, IReadOnlyDictionary<string, string>? metadata = null, string? schemaVersion = null)

Parameters

receipt IDecisionReceipt

The decision receipt to capture.

recordId string

The ledger record identifier; a new identifier is generated when omitted or blank.

recordedUtc DateTimeOffset?

The capture timestamp; defaults to the current UTC time.

handshakeId string

The optional liability handshake identifier to link.

acknowledgmentId string

The optional handshake acknowledgment identifier to link.

capabilityTokenId string

The optional capability token or grant identifier to link. When omitted or blank, the receipt's CapabilityGrantId is used.

previousRecordHash string

The optional hash of the preceding ledger record.

recordHash string

The optional hash of this ledger record.

signatureKeyId string

The optional identifier of the signing key.

signatureAlgorithm string

The optional signature algorithm.

signatureValue string

The optional encoded signature value.

signingHash string

The optional hash that was signed.

signatureKeyVersion string

The optional version of the signing key.

signatureProvider string

The optional name of the signing provider.

signedUtc DateTimeOffset?

The optional UTC timestamp when the record was signed.

metadata IReadOnlyDictionary<string, string>

Optional metadata merged over the receipt metadata; entries with the same key win.

schemaVersion string

The schema version; defaults to the receipt schema version.

Returns

AuditLedgerRecord

A normalized ledger record with optional values trimmed and blank values treated as absent.

Exceptions

ArgumentNullException

receipt is null.

ArgumentException

A required receipt value, such as the event, actor, operation, or outcome, is blank.

ArgumentOutOfRangeException

A receipt latency, constraint count, outbox sequence, or risk score is negative or not finite.