Documentation
¶
Overview ¶
Package model defines the engine's transport-independent contracts.
Index ¶
- Constants
- Variables
- func ArchiveConsumer(stream string) string
- func AttestationEvidence(a Attestation) []string
- func AttestationIdentityDigest(r AttestationIdentityRequest) string
- func AuditExportConsumer(stream string) string
- func BytesDigest(b []byte) string
- func CalculationDigest(r CalculationReceipt) string
- func ChangesMemoryDependency(e Event) bool
- func ContextDigest(m ContextManifest) string
- func ContextScopes(m ContextManifest) []string
- func ConversationDigest(r ConversationRequest) string
- func ConversationRecordID(tenant string, r ConversationRequest) string
- func DecisionArtifacts(r DecisionReceipt) map[string]ArtifactReference
- func DecisionDigest(r DecisionReceipt) string
- func Digest(v any) string
- func EvidenceDisposalConsumer() string
- func ExtractionConsumer(stream string) string
- func ExtractionProfileDigest(p ExtractionProfile) string
- func FactDigest(p FactProposal) string
- func IsMemoryRefreshSweep(e Event) bool
- func MemoryDigest(p MemoryProposal) string
- func MemoryRecordID(k MemoryKey) string
- func MemoryRefreshConsumer(stream string) string
- func ProjectionConsumer(generation string) string
- func ProjectionID(d ProjectionDocument) string
- func SnapshotDigest(s FactSnapshot) string
- func SortTimeline(entries []Acceptance)
- func ValidAttestationTombstone(a Attestation, tenant, id string) bool
- func ValidCalculationTombstone(r CalculationRecord, tenant, id string) bool
- func ValidConversationTombstone(r ConversationRecord, tenant, id string) bool
- func ValidDecisionTombstone(r DecisionRecord, tenant, id string) bool
- func ValidExtractionTombstoneJSON(kind string, raw []byte) bool
- func ValidID(s string) bool
- func ValidateProjectionPage(page ProjectionPage, after ProjectionCursor) error
- type Acceptance
- type AcceptancePolicy
- type ActiveProjection
- type Approval
- type ApprovedExtractor
- type ArchiveBatch
- type ArchiveCoverageReceipt
- type ArchiveCoverageVerifier
- type ArchiveManifest
- type ArchivePayload
- type ArchiveSource
- type ArchiveStore
- type ArtifactReference
- type Attestation
- type AttestationDelegation
- type AttestationDisposalRequest
- type AttestationDisposalTx
- type AttestationIdentityOptions
- type AttestationIdentityReceipt
- type AttestationIdentityRequest
- type AttestationIdentityVerifier
- type AttestationRequest
- type AttestationRequirement
- type AuditBundle
- type AuditEntry
- type AuditExportJob
- type AuditExportQuery
- type AuditExportRequest
- type AuditExportResult
- type AuditExportRunner
- type AuditGap
- type AuditManifest
- type AuditManifestEntry
- type AuditOptions
- type AuditSignature
- type AuditSigner
- type AuditTx
- type AuthorizationDecision
- type AuthorizationRequest
- type Authorizer
- type CalculationDisposalRequest
- type CalculationQuery
- type CalculationReceipt
- type CalculationRecord
- type CalculationRetentionBinding
- type Caller
- type ChangesQuery
- type ChangesResult
- type ChangesTx
- type ClientConfirmation
- type Command
- type CommitResult
- type ConsumerKey
- type ConsumerStatus
- type ContextArchiveOptions
- type ContextArchiveReceipt
- type ContextDisposalRequest
- type ContextDisposalTx
- type ContextManifest
- type ContextQuery
- type ContextRequest
- type ContextRetentionBinding
- type ContextTx
- type ConversationDisposalRequest
- type ConversationDisposalTx
- type ConversationMessage
- type ConversationQuery
- type ConversationRecord
- type ConversationRequest
- type ConversationTx
- type DecisionDisposalRequest
- type DecisionQuery
- type DecisionReceipt
- type DecisionRecord
- type DecisionRetentionBinding
- type DelegatedAttestationRequest
- type Delivery
- type DisposalBatchRequest
- type DisposalBatchResult
- type DisposalBatchTx
- type Embedder
- type EngineOptions
- type Event
- type Evidence
- type EvidenceContent
- type EvidenceCopyRange
- type EvidenceDerivation
- type EvidenceDisposalRequest
- type EvidenceLineageDisposalTx
- type EvidenceQuery
- type EvidenceRequest
- type EvidenceStore
- type EvidenceVersionDeleter
- type ExtractedProposal
- type ExtractionAdmission
- type ExtractionAttempt
- type ExtractionCandidate
- type ExtractionChunk
- type ExtractionChunkPlan
- type ExtractionChunkQuery
- type ExtractionCostBudget
- type ExtractionDisposalRequest
- type ExtractionDisposalTx
- type ExtractionInput
- type ExtractionInputMessage
- type ExtractionInputRange
- type ExtractionIssue
- type ExtractionJob
- type ExtractionOptions
- type ExtractionOutput
- type ExtractionPayloadRange
- type ExtractionPayloadRedaction
- type ExtractionProfile
- type ExtractionProvider
- type ExtractionRelation
- type ExtractionRequest
- type ExtractionReservation
- type ExtractionResponse
- type ExtractionResult
- type ExtractionRetentionBinding
- type ExtractionRun
- type ExtractionRunQuery
- type ExtractionRunRequest
- type ExtractionRunTx
- type ExtractionRunner
- type ExtractionTx
- type FactKey
- type FactProposal
- type FactQuery
- type FactResult
- type FactSnapshot
- type FactSnapshotRequest
- type FactsPage
- type FactsQuery
- type GenerationKey
- type HistoryPage
- type HistoryPageQuery
- type HistoryPageTx
- type HistoryQuery
- type HistoryResult
- type IdentityQuery
- type IdentityTx
- type Interval
- type JobQuery
- type JobRetryRequest
- type JobStatus
- type Ledger
- type LegalHoldRequest
- type LifecycleChange
- type MemoriesPage
- type MemoriesQuery
- type MemoryDependency
- type MemoryExtractionCandidate
- type MemoryExtractionOutput
- type MemoryExtractionTarget
- type MemoryExtractionTx
- type MemoryHistoryPageTx
- type MemoryKey
- type MemoryLifecycleTx
- type MemoryListItem
- type MemoryProjection
- type MemoryProposal
- type MemoryQuery
- type MemoryRecallItem
- type MemoryRecallResult
- type MemoryRefreshBinding
- type MemoryRefreshDependency
- type MemoryRefreshInput
- type MemoryRefreshOutput
- type MemoryRefreshRequest
- type MemoryRefreshScan
- type MemoryRefreshScanResult
- type MemoryRefreshScanTx
- type MemoryRefreshScheduler
- type MemoryRefreshSweep
- type MemoryRefreshSweepRequest
- type MemoryRefreshSweepStarter
- type MemoryRefreshTrigger
- type MemoryResult
- type MemoryTx
- type MemoryType
- type MemoryTypeRequest
- type MemoryVersion
- type MemoryVersionQuery
- type ObjectRef
- type OperationsOptions
- type OrphanEvidenceDisposalRequest
- type OrphanEvidenceDisposalTx
- type OrphanEvidenceEngine
- type OrphanEvidenceQuery
- type OrphanEvidenceScannerTx
- type Outbox
- type OutboxProgress
- type OutboxProgressReader
- type PagedRebuildIndex
- type PagedRebuildStore
- type PendingEvidenceUpload
- type PolicyRequest
- type PredicateBinding
- type PredicateMigration
- type PredicateRequest
- type PredicateVersion
- type ProjectionCheck
- type ProjectionCleanupCursor
- type ProjectionCleanupEngine
- type ProjectionCleanupGate
- type ProjectionCleanupKey
- type ProjectionCleanupOptions
- type ProjectionCleanupPlan
- type ProjectionCleanupQuery
- type ProjectionCleanupReader
- type ProjectionCleanupRequest
- type ProjectionCleanupScanner
- type ProjectionCleanupStatus
- type ProjectionCleanupTarget
- type ProjectionCleanupTx
- type ProjectionCursor
- type ProjectionDestinationInventory
- type ProjectionDestinationRegistry
- type ProjectionDisposal
- type ProjectionDisposalSealer
- type ProjectionDisposer
- type ProjectionDocument
- type ProjectionInventory
- type ProjectionPage
- type ProjectionPageLoader
- type ProjectionReceipt
- type ProjectionRegistry
- type ProjectionSource
- type ProjectionStatus
- type ProjectionStatusQuery
- type ProjectionWaitRequest
- type ReadOptions
- type ReadTx
- type RebuildActor
- type RebuildIndex
- type RebuildRequest
- type RebuildStatus
- type RebuildStore
- type RecallItem
- type RecallRequest
- type RecallResult
- type Record
- type RedactedEvidenceRequest
- type ReleaseLegalHoldRequest
- type RetentionDomain
- type RetentionEvent
- type RetentionPolicy
- type RetentionPolicyRequest
- type RetentionStatus
- type RetentionStatusQuery
- type RetentionTx
- type RetrievalDescriber
- type RetrievalIdentity
- type RetrievalIndex
- type RetrievalOptions
- type RevisionConflict
- type ScopeDefinition
- type ScopeRequest
- type ScopeVersion
- type SearchCandidate
- type SnapshotDisposalRequest
- type SnapshotDisposalTx
- type SnapshotItem
- type SnapshotQuery
- type SnapshotRetentionBinding
- type SourceSpan
- type SubjectDefinition
- type SubjectLookupQuery
- type SubjectRequest
- type SubjectVersion
- type Supersession
- type TelemetryOptions
- type TemporalTx
- type Tx
- type Value
- type ValueConstraints
- type ValueKind
- type Version
- type VersionDisposalRequest
- type VersionDisposalTx
- type VersionReference
- type VersionRetentionBinding
- type Withdrawal
Constants ¶
const AuditExportLease = 3 * time.Minute
AuditExportLease outlasts the bounded export attempt. Delivery retries must wait at least this long after an attempt that may have claimed the job.
const MaxProjectionPageBytes = 8 << 20
const MaxProjectionPageDocuments = 256
const ProjectionInventoryV2 = "projection-inventory-v2"
Variables ¶
var ( ErrInvalid = errors.New("invalid input") ErrDenied = errors.New("permission denied") ErrNotFound = errors.New("not found") ErrConflict = errors.New("command identity conflict") ErrRevision = errors.New("stream revision conflict") ErrPrecondition = errors.New("precondition failed") ErrQuota = errors.New("quota exhausted") )
var ErrRefreshNotNeeded = fmt.Errorf("memory refresh is no longer needed: %w", ErrPrecondition)
ErrRefreshNotNeeded is distinct from configuration, evidence and schema failures so event consumers may skip only an obsolete or restored target.
Functions ¶
func ArchiveConsumer ¶
func AttestationEvidence ¶
func AttestationEvidence(a Attestation) []string
func AttestationIdentityDigest ¶
func AttestationIdentityDigest(r AttestationIdentityRequest) string
func AuditExportConsumer ¶
func BytesDigest ¶
func CalculationDigest ¶
func CalculationDigest(r CalculationReceipt) string
func ChangesMemoryDependency ¶
func ContextDigest ¶
func ContextDigest(m ContextManifest) string
func ContextScopes ¶
func ContextScopes(m ContextManifest) []string
ContextScopes includes every scope whose content is retained in the manifest.
func ConversationDigest ¶
func ConversationDigest(r ConversationRequest) string
func ConversationRecordID ¶
func ConversationRecordID(tenant string, r ConversationRequest) string
func DecisionArtifacts ¶
func DecisionArtifacts(r DecisionReceipt) map[string]ArtifactReference
func DecisionDigest ¶
func DecisionDigest(r DecisionReceipt) string
func EvidenceDisposalConsumer ¶
func EvidenceDisposalConsumer() string
EvidenceDisposalConsumer identifies the trusted consumer that performs post-commit deletion from external immutable evidence stores.
func ExtractionConsumer ¶
func ExtractionProfileDigest ¶
func ExtractionProfileDigest(p ExtractionProfile) string
func FactDigest ¶
func FactDigest(p FactProposal) string
FactDigest is the canonical content digest used by fact proposals. Command metadata and disposal state do not participate in the content identity.
func IsMemoryRefreshSweep ¶
func MemoryDigest ¶
func MemoryDigest(p MemoryProposal) string
func MemoryRecordID ¶
func MemoryRefreshConsumer ¶
func ProjectionConsumer ¶
func ProjectionID ¶
func ProjectionID(d ProjectionDocument) string
func SnapshotDigest ¶
func SnapshotDigest(s FactSnapshot) string
SnapshotDigest covers the immutable selection payload. Creation revision and authorization receipts are retained separately from this canonical content digest.
func SortTimeline ¶
func SortTimeline(entries []Acceptance)
func ValidAttestationTombstone ¶
func ValidAttestationTombstone(a Attestation, tenant, id string) bool
func ValidCalculationTombstone ¶
func ValidCalculationTombstone(r CalculationRecord, tenant, id string) bool
ValidCalculationTombstone rejects content smuggled into a marked envelope.
func ValidConversationTombstone ¶
func ValidConversationTombstone(r ConversationRecord, tenant, id string) bool
func ValidDecisionTombstone ¶
func ValidDecisionTombstone(r DecisionRecord, tenant, id string) bool
ValidDecisionTombstone rejects content smuggled into a marked envelope.
func ValidExtractionTombstoneJSON ¶
ValidExtractionTombstoneJSON checks the shape of content-free retained metadata. It is not authorization or validation of the original unavailable content.
func ValidateProjectionPage ¶
func ValidateProjectionPage(page ProjectionPage, after ProjectionCursor) error
ValidateProjectionPage checks scan progress independently of the retained document inventory. Skipped tombstones may advance the cursor past the last document, but no returned document may fall behind a previously scanned row.
Types ¶
type Acceptance ¶
type AcceptancePolicy ¶
type AcceptancePolicy struct {
Scope, ID string
Mode string
AcceptingServices, SourceClasses []string
Required []AttestationRequirement
}
type ActiveProjection ¶
type ApprovedExtractor ¶
type ApprovedExtractor struct {
Profile ExtractionProfile
Provider ExtractionProvider
}
type ArchiveBatch ¶
type ArchiveBatch struct {
Manifest ArchiveManifest
Signature AuditSignature
}
type ArchiveCoverageReceipt ¶
type ArchiveCoverageReceipt struct {
Tenant, Scope, Stream, HeadDigest, KeyID string
ThroughRevision int64
VerifiedAt time.Time
}
ArchiveCoverageReceipt records a chain verification anchored to the export's tenant revision. It carries no archived event or other-scope metadata.
type ArchiveCoverageVerifier ¶
type ArchiveManifest ¶
type ArchivePayload ¶
type ArchivePayload struct {
Scopes []string
Event Event
Entries []AuditEntry
Gaps []AuditGap
}
type ArchiveSource ¶
type ArchiveSource interface {
ArchivePayload(context.Context, Delivery) (ArchivePayload, error)
}
type ArchiveStore ¶
type ArchiveStore interface {
Put(context.Context, string, string, []byte) (ObjectRef, error)
Load(context.Context, string, string) (ObjectRef, []byte, error)
Read(context.Context, string, ObjectRef) ([]byte, error)
}
ArchiveStore is separately administered immutable object storage. Put is create-once by logical key, returning the same version on identical retries. Digest covers plaintext; Version identifies immutable encrypted stored bytes.
type ArtifactReference ¶
type ArtifactReference struct{ EvidenceID, Digest string }
type Attestation ¶
type Attestation struct {
PayloadDisposed bool `json:",omitempty"`
DisposedPayloadDigest string `json:",omitempty"`
RecordedAt *time.Time `json:",omitempty"`
ReviewAuthorization *AuthorizationDecision `json:",omitempty"`
Recorder *Caller `json:",omitempty"`
Delegation *AttestationDelegation `json:",omitempty"`
EvidenceAuthorization *AuthorizationDecision `json:",omitempty"`
Confirmation *ClientConfirmation `json:",omitempty"`
ID, Scope, RecordID, VersionID, ContentDigest, Kind, EvidenceID string
Attestor Caller
ExpiresAt *time.Time
}
func AttestationTombstone ¶
func AttestationTombstone(a Attestation) Attestation
AttestationTombstone retains exact version/evidence binding and provenance while omitting confirmation presentation details and delegated proof content.
type AttestationDelegation ¶
type AttestationDelegation struct {
Receipt AttestationIdentityReceipt
Authorization []AuthorizationDecision
}
type AttestationDisposalRequest ¶
type AttestationDisposalRequest struct {
Command
Kind, Scope, RecordID, VersionID, AttestationID, PolicyID, Jurisdiction, Purpose, Reason string
}
AttestationDisposalRequest selects one fact or memory attestation payload. Structural identity and the tombstone remain after disposal.
type AttestationDisposalTx ¶
type AttestationDisposalTx interface {
DisposeAttestation(context.Context, AttestationDisposalRequest) (int64, error)
}
type AttestationIdentityOptions ¶
type AttestationIdentityOptions struct {
Verifier AttestationIdentityVerifier
Authority string
Timeout, MaxAuthenticationAge time.Duration
}
type AttestationIdentityRequest ¶
type AttestationIdentityRequest struct {
Recorder Caller
Request DelegatedAttestationRequest
}
The verifier must authenticate the grant and bind ALL request fields, including actor, tenant, scope, command, exact version/digest, artifacts and timestamps. Returning the request's claimed identity without independent verification is unsafe.
type AttestationIdentityVerifier ¶
type AttestationIdentityVerifier interface {
VerifyAttestationIdentity(context.Context, AttestationIdentityRequest) (AttestationIdentityReceipt, error)
}
type AttestationRequest ¶
type AttestationRequest struct {
Command
Attestation Attestation
}
type AttestationRequirement ¶
type AuditBundle ¶
type AuditBundle struct {
Manifest AuditManifest
Entries []AuditEntry
Signature AuditSignature
}
type AuditEntry ¶
type AuditEntry struct {
Kind, ID string
Payload json.RawMessage
}
type AuditExportJob ¶
type AuditExportQuery ¶
type AuditExportQuery struct{ ID, Scope, Purpose string }
type AuditExportRequest ¶
type AuditExportResult ¶
type AuditExportResult struct {
ID, State string
CreatedRevision, CompletedRevision int64
Artifact ObjectRef
Bundle *AuditBundle
}
type AuditExportRunner ¶
type AuditExportRunner interface {
RunAuditExport(context.Context, Caller, AuditExportQuery) (AuditExportResult, error)
}
type AuditManifest ¶
type AuditManifest struct {
SchemaVersion, Encoding, Tenant, Scope, ExportID string
ThroughRevision int64
EntryCount int
Entries []AuditManifestEntry
Gaps []AuditGap
Authorization []AuthorizationDecision
ArchiveCoverage *ArchiveCoverageReceipt `json:",omitempty"`
}
type AuditManifestEntry ¶
type AuditManifestEntry struct{ Kind, ID, Digest string }
type AuditOptions ¶
type AuditOptions struct {
Signer AuditSigner
ArchiveCoverage ArchiveCoverageVerifier
}
type AuditSignature ¶
type AuditSigner ¶
type AuditSigner interface {
Sign(context.Context, []byte) (AuditSignature, error)
}
type AuditTx ¶
type AuditTx interface {
TemporalTx
CalculationRun(context.Context, string, string) (CalculationRecord, error)
Calculation(context.Context, string) (CalculationRecord, error)
StageCalculation(context.Context, CalculationRecord, []FactSnapshot) error
StageAuditJob(context.Context, AuditExportJob) error
AuditJob(context.Context, string) (AuditExportJob, error)
ClaimAuditJob(context.Context, string, time.Duration) (AuditExportJob, error)
StageAuditBundle(context.Context, AuditExportJob, AuditBundle) error
AuditExport(context.Context, string) (AuditExportResult, error)
AuditEntries(context.Context, string) ([]AuditEntry, []AuditGap, error)
}
AuditTx keeps business receipts and export completion in the same append transaction.
type AuthorizationDecision ¶
type AuthorizationDecision struct {
Allowed bool
ModelID, ContextDigest, Consistency string
CheckedAt time.Time
Request AuthorizationRequest
}
type AuthorizationRequest ¶
type Authorizer ¶
type Authorizer interface {
Check(context.Context, AuthorizationRequest) (AuthorizationDecision, error)
}
type CalculationDisposalRequest ¶
type CalculationDisposalRequest struct {
Command
CalculationID, Reason string
Bindings []CalculationRetentionBinding
}
CalculationDisposalRequest selects independently governed scope policies.
type CalculationQuery ¶
type CalculationQuery struct{ ID, Purpose string }
type CalculationReceipt ¶
type CalculationReceipt struct {
Command
Scope, SnapshotID, ApplicationID, ExternalRunID string
MethodID, MethodVersion, ExecutableDigest, ConfigurationDigest, NormalizationVersion string
ReferenceSnapshotIDs []string
Input, Output ArtifactReference
StartedAt, CompletedAt time.Time
Outcome string
}
CalculationReceipt reports an externally executed run; the engine never executes it.
type CalculationRecord ¶
type CalculationRecord struct {
PayloadDisposed bool `json:",omitempty"`
Authorization []AuthorizationDecision
ID, Tenant, Digest, SnapshotDigest string
Caller Caller
Receipt CalculationReceipt
LedgerRevision int64
}
func CalculationTombstone ¶
func CalculationTombstone(r CalculationRecord) CalculationRecord
CalculationTombstone retains identity, lineage and integrity digests without method metadata, runtime configuration identity or execution details.
type CalculationRetentionBinding ¶
type CalculationRetentionBinding struct{ Scope, PolicyID, Jurisdiction string }
type ChangesQuery ¶
type ChangesResult ¶
type ClientConfirmation ¶
type ClientConfirmation struct {
Presentation, Response ArtifactReference
PresentationVersion string
PresentedAt, RespondedAt time.Time
}
ClientConfirmation retains the application's presentation and affirmative response for the attestation's exact record/version/content digest. The trusted attestor binds their meaning; the engine does not interpret PDFs, images, or natural language as consent.
type CommitResult ¶
type ConsumerKey ¶
type ConsumerKey struct{ Tenant, Consumer string }
ConsumerKey is trusted host configuration, never unchecked client input. Each consumer receives the complete tenant stream from revision one.
type ConsumerStatus ¶
type ContextArchiveOptions ¶
type ContextArchiveOptions struct {
Stream string
MaxPendingRevisions int64
Progress OutboxProgressReader
}
ContextArchiveOptions is trusted host policy for all context deliveries on an engine. Progress must read the configured archive consumer's ledger domain.
type ContextArchiveReceipt ¶
type ContextArchiveReceipt struct {
Stream string
MaxPendingRevisions, LedgerRevision, AcknowledgedRevision int64
CheckedAt time.Time
}
ContextArchiveReceipt records the preparation-time policy check. It is not a signed archive-head proof; current delivery is rechecked independently.
type ContextDisposalRequest ¶
type ContextDisposalRequest struct {
Command
ContextID, Reason string
Bindings []ContextRetentionBinding
}
type ContextDisposalTx ¶
type ContextDisposalTx interface {
DisposeContext(context.Context, ContextDisposalRequest) error
}
ContextDisposalTx adapters must serialize disposal with new references, scope holds, exports and archive reads, and retain an immutable tombstone.
type ContextManifest ¶
type ContextManifest struct {
PayloadDisposed bool `json:",omitempty"`
Archive *ContextArchiveReceipt `json:",omitempty"`
ID, Tenant, Scope string
Caller Caller
Request ContextRequest
CanonicalVersion, RedactionVersion, QueryReference string
Retrieval RetrievalIdentity
Items []RecallItem
Memories []MemoryRecallItem `json:",omitempty"`
Order []VersionReference `json:",omitempty"`
Rendered []byte
RenderedDigest, Digest string
SelectionRevision, IndexedRevision, CreationRevision int64
Incomplete bool
Authorization []AuthorizationDecision
}
func ContextTombstone ¶
func ContextTombstone(m ContextManifest) ContextManifest
ContextTombstone removes copied content while retaining the original digests, version inventory, scope boundaries and authorization provenance. It does not authorize disposal or validate its input. The returned metadata cannot be used to reconstruct or verify the original context content. Input is not mutated.
type ContextQuery ¶
type ContextQuery struct{ ID, Purpose string }
type ContextRequest ¶
type ContextRequest struct {
Command
Scope string
Query RecallRequest
IncludeMemories bool `json:",omitempty"`
}
type ContextRetentionBinding ¶
type ContextRetentionBinding struct{ Scope, PolicyID, Jurisdiction string }
type ContextTx ¶
type ContextTx interface {
AuditTx
ContextManifest(context.Context, string) (ContextManifest, error)
StageContext(context.Context, ContextManifest) error
Decision(context.Context, string) (DecisionRecord, error)
DecisionRun(context.Context, string, string) (DecisionRecord, error)
StageDecision(context.Context, DecisionRecord, map[VersionReference]string) error
}
type ConversationDisposalTx ¶
type ConversationDisposalTx interface {
DisposeConversation(context.Context, ConversationDisposalRequest) error
}
type ConversationMessage ¶
type ConversationMessage struct {
ID, Revision, Speaker, SpeakerRole, SourceClass string
SourceTime time.Time
MediaType, Classification, RetentionPolicy string
Object ObjectRef
}
ConversationMessage points at already finalized immutable UTF-8 source bytes. SpeakerRole and SourceClass preserve source authority; neither proves truth.
type ConversationQuery ¶
type ConversationQuery struct{ ID, Scope, Purpose string }
type ConversationRecord ¶
type ConversationRecord struct {
ID, Tenant, Digest string
Caller Caller
Request ConversationRequest
EvidenceIDs []string
Authorization []AuthorizationDecision
LedgerRevision int64
PayloadDisposed bool `json:",omitempty"`
}
func ConversationTombstone ¶
func ConversationTombstone(r ConversationRecord) ConversationRecord
ConversationTombstone removes message references and object locators while retaining the conversation identity, original digest and source inventory.
type ConversationRequest ¶
type ConversationRequest struct {
Command
Scope, SourceSystem, ConversationID, Revision, Timezone string
Messages []ConversationMessage
}
type ConversationTx ¶
type ConversationTx interface {
Tx
Conversation(context.Context, string) (ConversationRecord, error)
StageConversation(context.Context, ConversationRecord) error
}
type DecisionDisposalRequest ¶
type DecisionDisposalRequest struct {
Command
DecisionID, Reason string
Bindings []DecisionRetentionBinding
}
DecisionDisposalRequest selects independently governed scope policies.
type DecisionQuery ¶
type DecisionQuery struct{ ID, Purpose string }
type DecisionReceipt ¶
type DecisionReceipt struct {
Command
Scope, ApplicationID, ExternalDecisionID string
ContextID, SnapshotID, CalculationID string
SelectedItems, UsedItems []VersionReference
MethodKind, MethodID, MethodVersion, TransformationVersion string
Input, Output ArtifactReference
ModelRequest, ModelResponse, ActionReceipt *ArtifactReference
DecidedAt time.Time
Outcome string
}
type DecisionRecord ¶
type DecisionRecord struct {
PayloadDisposed bool `json:",omitempty"`
ID, Tenant, Digest, SourceDigest, CalculationDigest string
Caller Caller
Receipt DecisionReceipt
Scopes []string
LedgerRevision int64
Authorization []AuthorizationDecision
}
func DecisionTombstone ¶
func DecisionTombstone(r DecisionRecord) DecisionRecord
DecisionTombstone retains identity, declared-use lineage and integrity digests while removing method, transformation, execution-time and outcome metadata.
type DecisionRetentionBinding ¶
type DecisionRetentionBinding struct{ Scope, PolicyID, Jurisdiction string }
type DelegatedAttestationRequest ¶
type DelegatedAttestationRequest struct {
AttestationRequest
GrantID string
}
GrantID is an opaque reference, never a bearer token or raw identity assertion.
type DisposalBatchRequest ¶
type DisposalBatchRequest struct {
Command
Scope, Reason string
Evidence []EvidenceDisposalRequest `json:",omitempty"`
Conversations []ConversationDisposalRequest `json:",omitempty"`
Attestations []AttestationDisposalRequest `json:",omitempty"`
Decisions []DecisionDisposalRequest `json:",omitempty"`
Calculations []CalculationDisposalRequest `json:",omitempty"`
Snapshots []SnapshotDisposalRequest `json:",omitempty"`
Contexts []ContextDisposalRequest `json:",omitempty"`
Versions []VersionDisposalRequest
Extractions []ExtractionDisposalRequest
}
DisposalBatchRequest explicitly selects related evidence lineages, versions, extraction artifacts and other retained payloads. Child commands/reasons may be empty or equal to the parent; the service normalizes them to the parent before authorization and replay checks. Other retained copies remain blockers. Index removal remains asynchronous.
func (DisposalBatchRequest) Scopes ¶
func (r DisposalBatchRequest) Scopes() []string
Scopes includes every scope carried by a batch for audit/archive disclosure.
func (DisposalBatchRequest) SelectionCount ¶
func (r DisposalBatchRequest) SelectionCount() int
SelectionCount bounds the complete transaction across all artifact classes.
type DisposalBatchResult ¶
type DisposalBatchTx ¶
type DisposalBatchTx interface {
DisposeBatch(context.Context, DisposalBatchRequest) (DisposalBatchResult, error)
}
DisposalBatchTx must remove the complete authorized selection atomically, including all individual policy/age/hold/reference checks. Returned version and attestation revisions correspond to their selections in input order. Any error must abort the transaction.
type EngineOptions ¶
type EngineOptions struct {
ProjectionCleanup ProjectionCleanupOptions
ContextArchive *ContextArchiveOptions
Telemetry TelemetryOptions
Operations OperationsOptions
RedactionPolicyVersions []string
AttestationIdentity AttestationIdentityOptions
Extraction ExtractionOptions
Audit AuditOptions
Retrieval RetrievalOptions
Reads ReadOptions
}
EngineOptions composes optional capabilities without global configuration. Hosts own every injected connection, provider, signing key and worker lifecycle.
type Event ¶
type Event struct {
RefreshSweep *MemoryRefreshSweep `json:",omitempty"`
RecordKind string `json:",omitempty"`
DefinitionPredicate string `json:",omitempty"`
EntityID, Reason string
Affected *Interval
ReplacedVersionIDs []string
ID, Type, Scope, RecordID, VersionID string
StreamRevision, LedgerRevision int64
Caller Caller
Command Command
Authorization AuthorizationDecision
RecordedAt time.Time
}
type Evidence ¶
type Evidence struct {
Derivation *EvidenceDerivation `json:",omitempty"`
ID, Scope, SourceSystem, SourceObject, SourceRevision, Speaker, SourceClass, MediaType, Classification, RetentionPolicy string
SourceTime time.Time
Object ObjectRef
}
func MessageEvidence ¶
func MessageEvidence(tenant string, r ConversationRequest, m ConversationMessage) Evidence
type EvidenceContent ¶
type EvidenceCopyRange ¶
type EvidenceCopyRange struct {
OriginalStart, OriginalEnd, DerivedStart int
}
EvidenceCopyRange maps an unchanged derivative segment to original bytes.
type EvidenceDerivation ¶
type EvidenceDerivation struct {
ParentEvidenceID, TransformationVersion, PolicyVersion string
Ranges []EvidenceCopyRange
}
EvidenceDerivation is server-validated omission provenance. Classification, source authority and retention policy are inherited from the original.
func (EvidenceDerivation) OriginalSpan ¶
func (d EvidenceDerivation) OriginalSpan(span SourceSpan) (SourceSpan, error)
OriginalSpan translates a citation only when it fits within one unchanged segment. It never joins text across an omission or cites inserted text.
type EvidenceDisposalRequest ¶
type EvidenceDisposalRequest struct {
// DerivativeEvidenceIDs explicitly selects the complete direct derivative set.
// Empty preserves single-object disposal; custom adapters must implement EvidenceLineageDisposalTx.
DerivativeEvidenceIDs []string `json:",omitempty"`
// DeferObjectDeletion is service-owned and excluded from command identity.
// External stores are deleted by a retryable outbox worker after the ledger tombstone commits.
DeferObjectDeletion bool `json:"-"`
Command
Scope, EvidenceID, PolicyID, Jurisdiction, Reason string
}
type EvidenceLineageDisposalTx ¶
type EvidenceLineageDisposalTx interface {
DisposeEvidenceLineage(context.Context, EvidenceDisposalRequest) error
}
EvidenceLineageDisposalTx atomically disposes an original and its explicitly enumerated derivatives under the same retention policy and scope.
type EvidenceQuery ¶
type EvidenceQuery struct{ ID, Scope, Purpose string }
EvidenceQuery includes the claimed scope so authorization can precede lookup. Object-store credentials are never returned by evidence access operations.
type EvidenceRequest ¶
type EvidenceStore ¶
EvidenceStore reads only immutable references. Implementations must enforce tenant isolation. Temporary dependency outages should wrap ErrUnavailable; missing or corrupt content must not use that classification. Reads must honor context cancellation.
type EvidenceVersionDeleter ¶
type EvidenceVersionDeleter interface {
DeleteEvidenceVersion(context.Context, string, ObjectRef) error
}
EvidenceVersionDeleter removes one exact immutable object version. It must be tenant-isolated, idempotent, and treat an already missing version as success. The engine invokes it only from a post-commit disposal worker.
type ExtractedProposal ¶
type ExtractionAdmission ¶
type ExtractionAdmission struct {
JobStatus
Reservation ExtractionReservation
}
type ExtractionAttempt ¶
type ExtractionAttempt struct {
PayloadDisposed bool `json:",omitempty"`
Reservation *ExtractionReservation `json:",omitempty"`
ContentScopes []string `json:",omitempty"`
RefreshScopes []string `json:",omitempty"`
ID, Tenant, Scope, JobID, OwnerNonce, ProfileDigest, RequestDigest string
Caller Caller
Fence, LedgerRevision int64
LeaseUntil time.Time
Number int
StartedAt time.Time
RequestBytes []byte
Authorization []AuthorizationDecision
}
func ExtractionAttemptTombstone ¶
func ExtractionAttemptTombstone(a ExtractionAttempt) ExtractionAttempt
ExtractionAttemptTombstone removes the provider request. Original request digests, admission reservations, authorization and attempt identity remain.
type ExtractionCandidate ¶
type ExtractionChunk ¶
type ExtractionChunk struct {
InputRanges []ExtractionInputRange
SourceBytes int
}
type ExtractionChunkPlan ¶
type ExtractionChunkPlan struct {
RedactedEvidenceIDs []string `json:",omitempty"`
Version, Tenant, Scope, ConversationID, ConversationDigest string
ProfileID, ProfileDigest string
MaxSourceBytes int
Chunks []ExtractionChunk
ExcludedRanges []ExtractionInputRange
}
ExtractionChunkPlan is an authorized preview, not a persisted job or a quota reservation. StartExtraction rechecks authorization and current profile approval.
type ExtractionChunkQuery ¶
type ExtractionChunkQuery struct {
RedactedEvidenceIDs []string
Scope, ConversationID, ProfileID, Purpose string
InputRanges []ExtractionInputRange
MaxSourceBytes int
}
ExtractionChunkQuery plans original evidence ranges without creating jobs or consuming provider quota. MaxSourceBytes excludes the serialized envelope.
type ExtractionCostBudget ¶
Cost units are host-approved integer accounting units, e.g. USD micro-units. Amounts are conservative reservations, not provider billing measurements.
type ExtractionDisposalRequest ¶
type ExtractionDisposalRequest struct {
Command
JobID, Reason string
Bindings []ExtractionRetentionBinding
}
ExtractionDisposalRequest selects a terminal job and all of its retained attempts/results, including attempts from earlier retries.
type ExtractionDisposalTx ¶
type ExtractionDisposalTx interface {
DisposeExtraction(context.Context, ExtractionDisposalRequest) error
}
ExtractionDisposalTx must atomically verify terminal state, complete content scope/input inventories, class-specific policy ages, holds, live derivatives, exports and archive progress before retaining tombstones and deleting payloads. Implementations must serialize with execution, retries and new references. This interface grants no authority to dispose source facts, memories or evidence.
type ExtractionInput ¶
type ExtractionInput struct {
PayloadRedactionVersion string `json:",omitempty"`
PayloadOmittedPaths []string `json:",omitempty"`
PayloadRanges []ExtractionPayloadRange `json:",omitempty"`
InputSelectionVersion string `json:",omitempty"`
ExcludedRanges []ExtractionInputRange `json:",omitempty"`
Schema, Tenant, JobID, AttemptID, ConversationID, ConversationDigest, Timezone string
Profile ExtractionProfile
Subjects []string
Predicates []PredicateVersion
Messages []ExtractionInputMessage
OmittedRanges []string
RedactionVersion string
Refresh *MemoryRefreshInput `json:",omitempty"`
MemoryTargets []MemoryExtractionTarget `json:",omitempty"`
MemoryTypes []MemoryType `json:",omitempty"`
DependencyVersions []Version `json:",omitempty"`
}
type ExtractionInputMessage ¶
type ExtractionInputRange ¶
ExtractionInputRange uses half-open UTF-8 byte offsets in original evidence.
type ExtractionIssue ¶
type ExtractionJob ¶
type ExtractionJob struct {
PayloadDisposed bool `json:",omitempty"`
ID, Tenant, ProfileDigest string
Caller Caller
Request ExtractionRequest
Profile ExtractionProfile
Predicates []PredicateVersion
RefreshScopes []string `json:",omitempty"`
Authorization []AuthorizationDecision
CreatedRevision int64
MemoryTypes []MemoryType `json:",omitempty"`
DependencyVersions []Version `json:",omitempty"`
ContentScopes []string `json:",omitempty"`
}
func ExtractionJobTombstone ¶
func ExtractionJobTombstone(j ExtractionJob) ExtractionJob
ExtractionJobTombstone removes copied content from a scheduling artifact while preserving IDs, scopes, profile/schema bindings and original digests. It does not authorize disposal or validate the input. The input is not mutated.
type ExtractionOptions ¶
type ExtractionOptions struct {
// ScheduleOnly allows profile validation and durable job creation without a
// provider. Profiles must omit Provider; RunExtraction is disabled in this host.
// A separate execution host must configure the same profile digest and budgets.
ScheduleOnly bool
CostUnit string
DailyCostBudgetUnits int64
Profiles []ApprovedExtractor
MaxConcurrentPerTenant int
DailyTokenBudget int64
}
type ExtractionOutput ¶
type ExtractionOutput struct {
Candidates []ExtractionCandidate `json:"candidates"`
}
type ExtractionPayloadRange ¶
ExtractionPayloadRange selects a half-open UTF-8 byte range in a specific provider-input string, addressed by its canonical JSON pointer.
type ExtractionPayloadRedaction ¶
type ExtractionPayloadRedaction struct {
PolicyVersion string
DependencyPayloads bool
OriginalMemoryPayload bool
RefreshEvidence bool
DependencyPayloadRanges bool `json:",omitempty"`
OriginalMemoryPayloadRanges bool `json:",omitempty"`
RefreshEvidenceRanges bool `json:",omitempty"`
}
ExtractionPayloadRedaction applies field-omit-v1 to provider input only. The policy and selected fields are included in the approved profile digest.
type ExtractionProfile ¶
type ExtractionProfile struct {
PayloadRedaction *ExtractionPayloadRedaction `json:",omitempty"`
RedactionPolicyVersion string `json:",omitempty"`
InputSelectionVersion string `json:",omitempty"`
CostUnit string `json:",omitempty"`
MaxCostUnitsPerAttempt int64 `json:",omitempty"`
ID, ProviderID, RequestedModel, PromptVersion, PromptDigest, ParserVersion, ApplicationBuild string
Prompt []byte
Parameters json.RawMessage
Timeout time.Duration
MaxInputBytes, MaxOutputBytes, MaxCandidates, MaxAttempts int
MaxTokensPerAttempt int64
RetryDelay time.Duration
}
type ExtractionProvider ¶
type ExtractionProvider interface {
Extract(context.Context, []byte) (ExtractionResponse, error)
}
ExtractionProvider receives the exact retained request bytes. Implementations must honor cancellation and enforce transport response limits. It has no tools or ledger mutation capability through this interface.
type ExtractionRelation ¶
type ExtractionRequest ¶
type ExtractionRequest struct {
RedactedEvidenceIDs []string `json:",omitempty"`
ExpectedProfileDigest string `json:",omitempty"`
InputRanges []ExtractionInputRange `json:",omitempty"`
PayloadRanges []ExtractionPayloadRange `json:",omitempty"`
Command
Scope, ConversationID, ProfileID string
Subjects []string
Predicates []PredicateBinding
Refresh *VersionReference `json:",omitempty"`
RefreshTrigger *MemoryRefreshTrigger `json:",omitempty"`
MemoryTargets []MemoryExtractionTarget `json:",omitempty"`
}
type ExtractionReservation ¶
type ExtractionResponse ¶
type ExtractionResult ¶
type ExtractionResult struct {
PayloadDisposed bool `json:",omitempty"`
ContentScopes []string `json:",omitempty"`
RefreshScopes []string `json:",omitempty"`
AttemptID, JobID, Tenant, Scope, Outcome, ModelIdentity, RequestDigest, ResponseDigest string
ResponseBytes []byte
ResponseComplete bool
InputTokens, OutputTokens int64
Issues []ExtractionIssue
Relations []ExtractionRelation
Proposals []ExtractedProposal
Authorization []AuthorizationDecision
CompletedAt time.Time
LedgerRevision int64
}
func ExtractionResultTombstone ¶
func ExtractionResultTombstone(r ExtractionResult) ExtractionResult
ExtractionResultTombstone removes retained response bytes, including truncated responses. ResponseComplete describes the original capture; PayloadDisposed states that those bytes are no longer available. Proposals and issue codes remain structural provenance. Digests are not anonymization.
type ExtractionRetentionBinding ¶
type ExtractionRetentionBinding struct {
Scope, JobPolicyID, RequestPolicyID, ResponsePolicyID, Jurisdiction string
}
ExtractionRetentionBinding selects independently governed scheduling, request, and response payload policies for one content scope.
type ExtractionRun ¶
type ExtractionRun struct {
Attempt ExtractionAttempt
Result *ExtractionResult
}
type ExtractionRunQuery ¶
type ExtractionRunQuery struct{ ID, Scope, Purpose string }
type ExtractionRunRequest ¶
type ExtractionRunTx ¶
type ExtractionRunTx interface {
ExtractionTx
TemporalTx
BeginExtraction(context.Context, string, string, int, int64, int64, time.Duration, ExtractionCostBudget) (ExtractionAdmission, error)
FailExpiredExtraction(context.Context, string, int64) error
RejectExtractionInput(context.Context, string) error
StageExtractionAttempt(context.Context, ExtractionAttempt) error
ExtractionAttempt(context.Context, string) (ExtractionAttempt, error)
ExtractionResult(context.Context, string) (ExtractionResult, error)
FinishExtraction(context.Context, string, string, int64, string, string, time.Duration) error
StageExtractionResult(context.Context, ExtractionResult) error
}
type ExtractionRunner ¶
type ExtractionRunner interface {
GetJob(context.Context, Caller, JobQuery) (JobStatus, error)
RunExtraction(context.Context, Caller, ExtractionRunRequest) (JobStatus, error)
}
ExtractionRunner is the authorized engine boundary used by explicit workers.
type ExtractionTx ¶
type FactProposal ¶
type FactResult ¶
type FactSnapshot ¶
type FactSnapshotRequest ¶
type FactsPage ¶
type FactsPage struct {
Items []SnapshotItem
LedgerRevision int64
EvaluatedAt time.Time
NextPageToken string
}
type FactsQuery ¶
type GenerationKey ¶
type GenerationKey struct{ Tenant, Generation string }
type HistoryPage ¶
type HistoryPageQuery ¶
type HistoryPageQuery struct {
HistoryQuery
Limit int
PageToken string
}
HistoryPageQuery orders one record's immutable events by stream revision.
type HistoryPageTx ¶
type HistoryQuery ¶
type HistoryQuery struct{ Scope, RecordID, Purpose string }
type HistoryResult ¶
type IdentityQuery ¶
Revision zero selects current metadata; positive revisions select immutable history.
type IdentityTx ¶
type IdentityTx interface {
Tx
StageScope(context.Context, ScopeVersion, int64) error
StageSubject(context.Context, SubjectVersion, int64) error
ScopeIdentity(context.Context, string, int64) (ScopeVersion, error)
SubjectIdentity(context.Context, string, string, int64) (SubjectVersion, error)
LookupSubject(context.Context, string, string, string) (SubjectVersion, error)
}
type JobRetryRequest ¶
type LegalHoldRequest ¶
type LifecycleChange ¶
LifecycleChange applies to an exact accepted version over a bounded interval. RejectFact ignores Valid and only allows versions still in proposal state.
type MemoriesPage ¶
type MemoriesPage struct {
Items []MemoryListItem
LedgerRevision int64
EvaluatedAt time.Time
NextPageToken string
}
type MemoriesQuery ¶
type MemoriesQuery struct {
Scope, Subtype, Purpose string
ValidAt time.Time
KnowledgeRevision int64
KnownAt *time.Time
Limit int
PageToken string
}
MemoriesQuery lists one scope's memories as GetMemory would resolve each at ValidAt and the selected knowledge revision. Subtype is an optional filter.
type MemoryDependency ¶
type MemoryExtractionCandidate ¶
type MemoryExtractionCandidate struct {
ID, Subtype, SchemaVersion, Body string
Valid Interval
Sources []SourceSpan
Uncertainty, Rationale string
Confidence float64
}
type MemoryExtractionOutput ¶
type MemoryExtractionOutput struct {
Candidates []MemoryExtractionCandidate `json:"candidates"`
}
type MemoryExtractionTarget ¶
type MemoryExtractionTarget struct {
ID, Subtype, SchemaVersion string
Dependencies []MemoryDependency
}
type MemoryExtractionTx ¶
type MemoryExtractionTx interface {
MemoryLifecycleTx
MemoryVersions(context.Context, string, int64) ([]MemoryVersion, error)
}
type MemoryHistoryPageTx ¶
type MemoryKey ¶
type MemoryKey struct{ Scope, ID string }
MemoryKey is an explicit application-issued identity, independent of fact keys.
type MemoryLifecycleTx ¶
type MemoryLifecycleTx interface {
MemoryTx
TemporalTx
MemoryTimeline(context.Context, string, int64) ([]Acceptance, error)
StageMemoryTimeline(context.Context, string, []Acceptance) error
MemoryRejected(context.Context, string, string, int64) (bool, error)
MemoryHasAcceptance(context.Context, string, string) (bool, error)
StageMemoryRejection(context.Context, string, string) error
MemoryStreamRevisionAt(context.Context, string, int64) (int64, error)
MemoryAttestations(context.Context, string, int64) ([]Attestation, error)
StageMemoryAttestation(context.Context, Attestation) error
}
type MemoryListItem ¶
type MemoryListItem struct {
Key MemoryKey
Memory MemoryResult
}
type MemoryProjection ¶
type MemoryProjection struct {
Key MemoryKey
Subtype, SchemaVersion, Body string
Dependencies []MemoryDependency
}
type MemoryProposal ¶
type MemoryProposal struct {
Command
Key MemoryKey
Subtype, SchemaVersion, Body string
Valid Interval
Sources []SourceSpan
Dependencies []MemoryDependency
ExpectedRevision int64
}
type MemoryQuery ¶
type MemoryRecallItem ¶
type MemoryRecallItem struct {
Key MemoryKey
Memory MemoryResult
Score float64
}
type MemoryRecallResult ¶
type MemoryRecallResult struct {
Items []MemoryRecallItem
Generation string
LedgerRevision, IndexedRevision int64
Incomplete bool
}
type MemoryRefreshBinding ¶
type MemoryRefreshBinding struct{ Scope, ProfileID string }
type MemoryRefreshDependency ¶
type MemoryRefreshDependency struct {
Scope, RecordID string
Timeline []Acceptance
Versions []Version
}
type MemoryRefreshInput ¶
type MemoryRefreshInput struct {
Schema string
Original MemoryVersion
Definition MemoryType
LedgerRevision, StreamRevision int64
Dependencies []MemoryRefreshDependency
Evidence []ExtractionInputMessage
}
type MemoryRefreshOutput ¶
type MemoryRefreshOutput struct {
Body string
Dependencies []MemoryDependency
DeclineReason string
}
type MemoryRefreshRequest ¶
type MemoryRefreshRequest struct {
Trigger *MemoryRefreshTrigger `json:",omitempty"`
PayloadRanges []ExtractionPayloadRange `json:",omitempty"`
Command
Scope, RecordID, VersionID, ProfileID string
}
MemoryRefreshRequest binds an asynchronous replacement proposal to an exact accepted memory version. The job never accepts or supersedes it automatically.
type MemoryRefreshScan ¶
type MemoryRefreshScan struct {
Scope, Purpose string
Trigger MemoryRefreshTrigger
AfterVersionID string
Limit int
}
type MemoryRefreshScanResult ¶
type MemoryRefreshScanResult struct{ Versions []VersionReference }
type MemoryRefreshScanTx ¶
type MemoryRefreshScheduler ¶
type MemoryRefreshScheduler interface {
ScanMemoryRefresh(context.Context, Caller, MemoryRefreshScan) (MemoryRefreshScanResult, error)
StartMemoryRefresh(context.Context, Caller, MemoryRefreshRequest) (JobStatus, error)
}
type MemoryRefreshSweep ¶
type MemoryRefreshSweepStarter ¶
type MemoryRefreshSweepStarter interface {
StartMemoryRefreshSweep(context.Context, Caller, MemoryRefreshSweepRequest) (CommitResult, error)
}
type MemoryRefreshTrigger ¶
type MemoryResult ¶
type MemoryResult struct {
State, RecordID, VersionID, Body string
StreamRevision, LedgerRevision int64
Dependencies []MemoryDependency
}
type MemoryTx ¶
type MemoryTx interface {
Tx
MemoryType(context.Context, string, string, string) (MemoryType, error)
ActiveMemoryType(context.Context, string, string) (string, error)
StageMemoryType(context.Context, MemoryType) error
LockMemory(context.Context, MemoryKey) (Record, error)
StageMemoryVersion(context.Context, MemoryVersion) error
MemoryVersion(context.Context, string, string) (MemoryVersion, error)
}
type MemoryType ¶
type MemoryType struct {
Scope, Subtype, Version, PolicyID, Classification string
Migration *PredicateMigration `json:",omitempty"`
}
type MemoryTypeRequest ¶
type MemoryTypeRequest struct {
Command
Definition MemoryType
}
type MemoryVersion ¶
type MemoryVersion struct {
PayloadDisposed bool `json:",omitempty"`
Authorization []AuthorizationDecision
ID, RecordID, Digest, PolicyID string
Proposal MemoryProposal
Proposer Caller
LedgerRevision int64
}
func MemoryVersionTombstone ¶
func MemoryVersionTombstone(v MemoryVersion) MemoryVersion
MemoryVersionTombstone removes the body and source quotes while preserving dependency identities and their assertion/uncertainty labels. As with VersionTombstone, the original digest is provenance, not a digest of metadata.
type MemoryVersionQuery ¶
type MemoryVersionQuery struct{ Scope, RecordID, VersionID, Purpose string }
type OperationsOptions ¶
type OperationsOptions struct {
Scope string
Store RebuildStore
Index RebuildIndex
Progress Outbox
}
OperationsOptions uses separately provisioned administrative ports. Scope is host-owned and grants tenant-wide projection operations through can_operate.
type OrphanEvidenceDisposalRequest ¶
type OrphanEvidenceDisposalRequest struct {
Command
Scope, PolicyID, Jurisdiction, Reason string
Object ObjectRef
}
OrphanEvidenceDisposalRequest selects exactly one immutable upload version. It can only delete an object that has never been registered as evidence.
type OrphanEvidenceDisposalTx ¶
type OrphanEvidenceDisposalTx interface {
DisposeOrphanEvidence(context.Context, OrphanEvidenceDisposalRequest) error
}
type OrphanEvidenceEngine ¶
type OrphanEvidenceEngine interface {
ScanOrphanEvidence(context.Context, Caller, OrphanEvidenceQuery) ([]ObjectRef, error)
DisposeOrphanEvidence(context.Context, Caller, OrphanEvidenceDisposalRequest) (CommitResult, error)
}
type OrphanEvidenceQuery ¶
type OrphanEvidenceQuery struct {
Scope, PolicyID, Jurisdiction, Purpose string
AfterLocator, AfterVersion string
Limit int
}
OrphanEvidenceQuery is a bounded, live scan, not a deletion authorization. The optional cursor is the last locator/version pair returned by a prior page.
type OrphanEvidenceScannerTx ¶
type OrphanEvidenceScannerTx interface {
ScanOrphanEvidence(context.Context, OrphanEvidenceQuery) ([]ObjectRef, error)
}
type Outbox ¶
type Outbox interface {
RegisterConsumer(context.Context, ConsumerKey, int) error
ClaimDelivery(context.Context, ConsumerKey, time.Duration) (Delivery, error)
RenewDelivery(context.Context, Delivery, time.Duration) error
AcknowledgeDelivery(context.Context, Delivery) error
FailDelivery(context.Context, Delivery, time.Duration) error
ConsumerStatus(context.Context, ConsumerKey) (ConsumerStatus, error)
RetryConsumer(context.Context, ConsumerKey, int64) error
}
Outbox is an operational port for trusted workers. External effects must be idempotent by (tenant,event ID); lease fencing cannot undo external effects.
type OutboxProgress ¶
type OutboxProgress struct {
LedgerRevision, AcknowledgedRevision int64
OldestRecordedAt *time.Time
State string
}
OutboxProgress is a consistent snapshot for operational monitoring. Pending includes leased, delayed and failed work, not only immediately claimable work.
type OutboxProgressReader ¶
type OutboxProgressReader interface {
ReadOutboxProgress(context.Context, ConsumerKey) (OutboxProgress, error)
}
type PagedRebuildIndex ¶
type PagedRebuildIndex interface {
VerifyProjectionPages(context.Context, GenerationKey, int64, ProjectionPageLoader) (ProjectionCheck, error)
}
type PagedRebuildStore ¶
type PagedRebuildStore interface {
ProjectionDocumentPage(context.Context, GenerationKey, int64, int64, ProjectionCursor, int) (ProjectionPage, error)
}
PagedRebuildStore pins every page to one frozen source revision and fence. These are trusted administrative ports, not user-facing cursor APIs.
type PendingEvidenceUpload ¶
type PendingEvidenceUpload struct{ ID, Scope, PolicyID string }
PendingEvidenceUpload binds a new development-store object to its intended scope and orphan cleanup policy before ledger registration. It grants no permission to disclose content or to register evidence.
type PolicyRequest ¶
type PolicyRequest struct {
Command
Policy AcceptancePolicy
}
type PredicateBinding ¶
type PredicateBinding struct{ Predicate, SchemaVersion string }
type PredicateMigration ¶
type PredicateMigration struct {
FromVersion, Mode, Reason string
}
PredicateMigration declares a reviewed schema transition. Existing versions are never rewritten; replacement values require new proposals and acceptance.
type PredicateRequest ¶
type PredicateRequest struct {
Command
Definition PredicateVersion
}
type PredicateVersion ¶
type PredicateVersion struct {
Scope, Predicate, Version, PolicyID string
Kind ValueKind
Classification string
Migration *PredicateMigration `json:",omitempty"`
Constraints *ValueConstraints `json:",omitempty"`
Cardinality string `json:",omitempty"`
TemporalPrecision string `json:",omitempty"`
}
func (PredicateVersion) ValidateFact ¶
func (p PredicateVersion) ValidateFact(v Value, interval Interval) error
ValidateFact applies the same deterministic schema to manual and model proposals.
func (PredicateVersion) ValidateSchema ¶
func (p PredicateVersion) ValidateSchema() error
type ProjectionCheck ¶
type ProjectionCleanupCursor ¶
type ProjectionCleanupCursor struct{ Kind, VersionID, Generation string }
ProjectionCleanupCursor orders captured targets within one tenant.
func (ProjectionCleanupCursor) Compare ¶
func (c ProjectionCleanupCursor) Compare(other ProjectionCleanupCursor) int
func (ProjectionCleanupCursor) Valid ¶
func (c ProjectionCleanupCursor) Valid() bool
type ProjectionCleanupEngine ¶
type ProjectionCleanupEngine interface {
CleanupProjection(context.Context, Caller, ProjectionCleanupRequest) (CommitResult, error)
}
type ProjectionCleanupGate ¶
type ProjectionCleanupGate interface {
ProjectionDisposalSealer
SetProjectionGate(context.Context, GenerationKey, int64, bool) error
}
type ProjectionCleanupKey ¶
type ProjectionCleanupKey struct{ Tenant, Kind, VersionID string }
ProjectionCleanupKey identifies index cleanup for one disposed version.
type ProjectionCleanupOptions ¶
type ProjectionCleanupOptions struct{ Destination ProjectionDisposer }
ProjectionCleanupOptions uses separately provisioned retention credentials. Destinations must implement idempotent atomic deletion with durable write fences, and honor context cancellation. Terminal generations also require ProjectionCleanupGate. No connections or workers are started by the engine.
type ProjectionCleanupPlan ¶
type ProjectionCleanupPlan struct {
Target ProjectionDisposal
TerminalFence int64
}
ProjectionCleanupPlan is prepared while the transaction holds scope and generation guards. A positive TerminalFence requires permanent destination sealing before cleanup; only retired/abandoned generations may receive it.
type ProjectionCleanupQuery ¶
type ProjectionCleanupQuery struct {
Tenant string
After ProjectionCleanupCursor
Limit int
}
type ProjectionCleanupReader ¶
type ProjectionCleanupReader interface {
ProjectionCleanupStatus(context.Context, ProjectionCleanupKey) (ProjectionCleanupStatus, error)
}
ProjectionCleanupReader is a trusted maintenance port, not an end-user API.
type ProjectionCleanupRequest ¶
type ProjectionCleanupRequest struct {
Command
Kind, Scope, RecordID, VersionID, DisposalEventID, Generation, Reason string
Bindings []VersionRetentionBinding
}
ProjectionCleanupRequest selects one captured destination and binds it to the original policy-authorized version disposal. Bindings must match that event.
type ProjectionCleanupScanner ¶
type ProjectionCleanupScanner interface {
ScanProjectionCleanup(context.Context, ProjectionCleanupQuery) ([]ProjectionCleanupRequest, error)
}
ProjectionCleanupScanner is a trusted maintenance reader. Returned requests have the original policy purpose/bindings but no command key or cleanup reason. Execution must still pass the engine's fresh authorization and hold checks.
type ProjectionCleanupStatus ¶
type ProjectionCleanupStatus struct {
Key ProjectionCleanupKey
InventoryEpoch int64
CreatedAt time.Time
Targets []ProjectionCleanupTarget
Complete bool
}
ProjectionCleanupStatus reports acknowledgements for the destinations captured atomically with a version tombstone. Complete means every captured target has an acknowledgement; it does not prove independent destination state, authorize disposal, or claim that evidence, derivatives, backups or archives were erased.
type ProjectionCleanupTarget ¶
type ProjectionCleanupTx ¶
type ProjectionCleanupTx interface {
PrepareProjectionCleanup(context.Context, ProjectionCleanupRequest) (ProjectionCleanupPlan, error)
}
type ProjectionCursor ¶
type ProjectionCursor struct{ Kind, VersionID string }
func ProjectionDocumentCursor ¶
func ProjectionDocumentCursor(d ProjectionDocument) ProjectionCursor
func (ProjectionCursor) Before ¶
func (c ProjectionCursor) Before(next ProjectionCursor) bool
func (ProjectionCursor) Valid ¶
func (c ProjectionCursor) Valid() bool
type ProjectionDestinationInventory ¶
type ProjectionDestinationInventory struct {
Destinations []GenerationKey
MissingConsumers []string
Epoch int64
}
ProjectionDestinationInventory is a point-in-time inventory of ledger-known destinations, including retired and abandoned generations. MissingConsumers lists projection consumers without a generation binding; it is not safe to infer their destination names from hashes. This is not disposal authorization or proof that a host has registered all externally provisioned indexes.
type ProjectionDestinationRegistry ¶
type ProjectionDestinationRegistry interface {
RegisterProjectionDestination(context.Context, GenerationKey) error
ProjectionDestinationInventory(context.Context, string) (ProjectionDestinationInventory, error)
}
ProjectionDestinationRegistry is a trusted host maintenance port. Register a destination before writing to it; its ProjectionConsumer must already exist. Registration never resets consumer progress or removes old destinations.
type ProjectionDisposal ¶
type ProjectionDisposal struct{ Tenant, Generation, Kind, VersionID string }
ProjectionDisposal identifies one immutable version in one destination. Kind is explicitly "fact" or "memory". This adapter contract is not disposal authorization: the host must coordinate ledger policy, holds and every copy.
type ProjectionDisposalSealer ¶
type ProjectionDisposalSealer interface {
SealProjectionForDisposal(context.Context, GenerationKey, int64) error
}
ProjectionDisposalSealer permanently excludes a generation from verification and activation, while allowing individual projection cleanup. The host must authorize disposal and establish a retired/abandoned ledger state first. fence is the exact sealed generation fence. An exact retry is idempotent; the transition must reject stale fences and prevent any future reopening.
type ProjectionDisposer ¶
type ProjectionDisposer interface {
DisposeProjection(context.Context, ProjectionDisposal) error
}
ProjectionDisposer atomically removes content and leaves a durable fence against delayed writes. A sealed generation must first enter the permanent disposal state through ProjectionDisposalSealer before accepting new cleanup.
type ProjectionDocument ¶
type ProjectionDocument struct {
Memory *MemoryProjection `json:",omitempty"`
Tenant, Generation, RecordID, VersionID, VersionDigest, PolicyID, Classification string
Key FactKey
Value Value
Valid Interval
SourceClasses []string
}
ProjectionDocument contains canonical accepted fact or memory content, never source-span quotes.
func (ProjectionDocument) Scope ¶
func (d ProjectionDocument) Scope() string
type ProjectionInventory ¶
type ProjectionInventory struct {
// contains filtered or unexported fields
}
ProjectionInventory hashes an ordered, length-delimited canonical transcript without retaining the whole inventory. Order is kind then version ID, using bytewise string comparison. The algorithm version is retained with the check.
func NewProjectionInventory ¶
func NewProjectionInventory() *ProjectionInventory
func (*ProjectionInventory) Add ¶
func (i *ProjectionInventory) Add(d ProjectionDocument) error
func (*ProjectionInventory) Check ¶
func (i *ProjectionInventory) Check() ProjectionCheck
type ProjectionPage ¶
type ProjectionPage struct {
Documents []ProjectionDocument
// Next is the last scanned acceptance, including disposed versions. A page
// may contain no documents and still advance. Nil means the scan is complete.
Next *ProjectionCursor
}
type ProjectionPageLoader ¶
type ProjectionPageLoader func(context.Context, ProjectionCursor) (ProjectionPage, error)
type ProjectionReceipt ¶
type ProjectionRegistry ¶
type ProjectionRegistry interface {
ActiveProjection(context.Context, string) (ActiveProjection, error)
}
type ProjectionSource ¶
type ProjectionSource interface {
ProjectionDocument(context.Context, Delivery, string) (*ProjectionDocument, error)
}
ProjectionSource returns nil for an event with no projectable content, including a version whose durable disposal tombstone has been validated. Missing or malformed retained content must return an error, not nil.
type ProjectionStatus ¶
type ProjectionStatus struct {
Active ActiveProjection
Rebuild RebuildStatus
Consumer ConsumerStatus
LedgerRevision int64
Incomplete bool
}
type ProjectionStatusQuery ¶
type ProjectionStatusQuery struct{ Generation, Purpose string }
type ProjectionWaitRequest ¶
ProjectionWaitRequest binds a wait to one generation and committed revision. Callers must provide a context deadline; waits are additionally capped at two minutes.
type ReadOptions ¶
type ReadTx ¶
type ReadTx interface {
TemporalTx
RevisionAt(context.Context, time.Time) (int64, error)
FactRecords(context.Context, FactsQuery, int64, string, int) ([]Record, error)
// MemoryRecords returns memory records in the scope, ordered by record ID,
// whose key is carried as Record.Key.Scope and Record.Key.Discriminator.
MemoryRecords(context.Context, MemoriesQuery, int64, string, int) ([]Record, error)
}
type RebuildActor ¶
type RebuildActor struct {
Principal, Purpose string
// Present for application-authorized operations; legacy trusted worker callers
// retain their host-supplied principal and purpose contract.
Caller *Caller `json:",omitempty"`
Authorization *AuthorizationDecision `json:",omitempty"`
}
RebuildActor is a trusted operator identity supplied by the host. The administrative port must not be exposed as an unchecked end-user API.
type RebuildIndex ¶
type RebuildIndex interface {
RetrievalIndex
SetProjectionGate(context.Context, GenerationKey, int64, bool) error
VerifyProjection(context.Context, GenerationKey, int64, []ProjectionDocument) (ProjectionCheck, error)
}
type RebuildRequest ¶
type RebuildRequest struct {
Generation, Action, Purpose string
MaxAttempts int
ExpectedFence int64
}
RebuildRequest selects an explicit administrative transition. Generation is also the start identity; retries cannot change its configured attempt budget.
type RebuildStatus ¶
type RebuildStore ¶
type RebuildStore interface {
ProjectionRegistry
StartRebuild(context.Context, GenerationKey, RebuildActor, int) (RebuildStatus, error)
RebuildStatus(context.Context, GenerationKey) (RebuildStatus, error)
FreezeRebuild(context.Context, GenerationKey, RebuildActor) (RebuildStatus, error)
VerifyRebuild(context.Context, GenerationKey, RebuildActor, int64, ProjectionCheck) (RebuildStatus, error)
ResumeRebuild(context.Context, GenerationKey, RebuildActor, int64) (RebuildStatus, error)
FinishResume(context.Context, GenerationKey, RebuildActor, int64) (RebuildStatus, error)
ActivateRebuild(context.Context, GenerationKey, RebuildActor, int64) (RebuildStatus, error)
FinishActivation(context.Context, GenerationKey, RebuildActor, int64) (RebuildStatus, error)
AbandonRebuild(context.Context, GenerationKey, RebuildActor, int64) (RebuildStatus, error)
ProjectionDocuments(context.Context, GenerationKey, int64) ([]ProjectionDocument, error)
}
type RecallItem ¶
type RecallItem struct {
Key FactKey
Fact FactResult
Score float64
}
type RecallRequest ¶
type RecallResult ¶
type RecallResult struct {
Items []RecallItem
Generation string
LedgerRevision, IndexedRevision int64
Incomplete bool
}
type RedactedEvidenceRequest ¶
type RedactedEvidenceRequest struct {
Command
ID, Scope, ParentEvidenceID, PolicyVersion string
Object ObjectRef
Ranges []EvidenceCopyRange
}
type ReleaseLegalHoldRequest ¶
type RetentionDomain ¶
RetentionDomain binds synchronous object deletion to the ledger database. External stores use EvidenceVersionDeleter and post-commit outbox delivery.
type RetentionEvent ¶
type RetentionEvent struct {
DecisionDisposal *DecisionDisposalRequest `json:",omitempty"`
CalculationDisposal *CalculationDisposalRequest `json:",omitempty"`
BatchID string `json:",omitempty"`
DisposalBatch *DisposalBatchRequest `json:",omitempty"`
ProjectionCleanup *ProjectionCleanupRequest `json:",omitempty"`
VersionDisposal *VersionDisposalRequest `json:",omitempty"`
AttestationDisposal *AttestationDisposalRequest `json:",omitempty"`
ConversationDisposal *ConversationDisposalRequest `json:",omitempty"`
ExtractionDisposal *ExtractionDisposalRequest `json:",omitempty"`
ContextDisposal *ContextDisposalRequest `json:",omitempty"`
SnapshotDisposal *SnapshotDisposalRequest `json:",omitempty"`
AdditionalAuthorization []AuthorizationDecision `json:",omitempty"`
ID, Tenant, Scope, Kind, TargetID string
Caller Caller
Command Command
Policy *RetentionPolicy
Hold *LegalHoldRequest
Release *ReleaseLegalHoldRequest
Disposal *EvidenceDisposalRequest
OrphanDisposal *OrphanEvidenceDisposalRequest `json:",omitempty"`
LedgerRevision int64
Limitations []string
}
type RetentionPolicy ¶
type RetentionPolicy struct {
ID, Scope, RecordClass, Purpose, Jurisdiction string
MinimumAgeSeconds int64
}
RetentionPolicy is immutable and application-owned. Evidence-byte durations start at registration; orphan-evidence durations start at recorded upload time. Snapshot/context and extraction artifact durations start at their database creation event times; each extraction payload class has its own policy. None uses a caller-supplied historical source timestamp.
type RetentionPolicyRequest ¶
type RetentionPolicyRequest struct {
Command
Policy RetentionPolicy
}
type RetentionStatus ¶
type RetentionStatusQuery ¶
type RetentionStatusQuery struct{ Scope, EvidenceID, Purpose string }
type RetentionTx ¶
type RetrievalDescriber ¶
type RetrievalIdentity ¶
type RetrievalIndex ¶
type RetrievalOptions ¶
type RetrievalOptions struct {
Registry ProjectionRegistry
Index RetrievalIndex
Progress Outbox
Generation string
}
type RevisionConflict ¶
RevisionConflict describes the record state observed under the mutation's record lock. It is a refresh hint, not a reservation or permission to overwrite. Error deliberately contains no record identifiers or revision values.
func (*RevisionConflict) Error ¶
func (e *RevisionConflict) Error() string
func (*RevisionConflict) Unwrap ¶
func (e *RevisionConflict) Unwrap() error
type ScopeDefinition ¶
type ScopeDefinition struct{ ID, Label string }
IDs are application-issued opaque identifiers. Labels never resolve identities.
type ScopeRequest ¶
type ScopeRequest struct {
Command
Definition ScopeDefinition
ExpectedRevision int64
Reason string
}
type ScopeVersion ¶
type ScopeVersion struct {
Definition ScopeDefinition
Revision, LedgerRevision int64
Caller Caller
Reason string
}
type SearchCandidate ¶
type SnapshotDisposalRequest ¶
type SnapshotDisposalRequest struct {
Command
SnapshotID, Reason string
Bindings []SnapshotRetentionBinding
}
type SnapshotDisposalTx ¶
type SnapshotDisposalTx interface {
DisposeSnapshot(context.Context, SnapshotDisposalRequest) error
}
SnapshotDisposalTx adapters must serialize disposal with new references, scope holds, exports and archive reads, and retain an immutable tombstone.
type SnapshotItem ¶
type SnapshotQuery ¶
type SnapshotRetentionBinding ¶
type SnapshotRetentionBinding struct{ Scope, PolicyID, Jurisdiction string }
type SourceSpan ¶
type SubjectDefinition ¶
type SubjectLookupQuery ¶
type SubjectLookupQuery struct{ Scope, Namespace, Value, Purpose string }
type SubjectRequest ¶
type SubjectRequest struct {
Command
Definition SubjectDefinition
ExpectedRevision int64
Reason string
}
type SubjectVersion ¶
type SubjectVersion struct {
Definition SubjectDefinition
Revision, LedgerRevision int64
Caller Caller
Reason string
}
type Supersession ¶
type TelemetryOptions ¶
type TelemetryOptions struct {
TracerProvider trace.TracerProvider
MeterProvider metric.MeterProvider
Logger *slog.Logger
}
TelemetryOptions injects host-owned providers. Nil providers are local no-ops, never global defaults. The host owns exporters, sampling, flush and shutdown.
type TemporalTx ¶
type TemporalTx interface {
Tx
StageTimeline(context.Context, string, []Acceptance) error
StageRejection(context.Context, string, string) error
Rejected(context.Context, string, string, int64) (bool, error)
HasAcceptance(context.Context, string, string) (bool, error)
Versions(context.Context, string, int64) ([]Version, error)
HistoricalAttestations(context.Context, string, int64) ([]Attestation, error)
RevisionTime(context.Context, int64) (time.Time, error)
StreamRevisionAt(context.Context, string, int64) (int64, error)
StageSnapshot(context.Context, FactSnapshot) error
Snapshot(context.Context, string) (FactSnapshot, error)
History(context.Context, string) ([]Event, error)
}
TemporalTx is implemented by ledgers supporting the second delivery slice.
type Tx ¶
type Tx interface {
// RequireScope and RequireSubject reject unregistered write identities.
RequireScope(context.Context, string) error
RequireSubject(context.Context, string, string) error
Receipt(context.Context, Caller, string, string, string) (*CommitResult, error)
SaveReceipt(context.Context, Caller, string, string, string, CommitResult) error
Policy(context.Context, string, string) (AcceptancePolicy, error)
InsertPolicy(context.Context, AcceptancePolicy) error
Predicate(context.Context, string, string, string) (PredicateVersion, error)
InsertPredicate(context.Context, PredicateVersion) error
ActivePredicate(context.Context, string, string) (string, error)
Evidence(context.Context, string) (Evidence, error)
InsertEvidence(context.Context, Evidence) (string, error)
// LockRecord must require a registered subject before locking or creating a record.
LockRecord(context.Context, FactKey) (Record, error)
Record(context.Context, string) (Record, error)
SetRevision(context.Context, string, int64) error
Version(context.Context, string, string) (Version, error)
InsertVersion(context.Context, Version) error
Attestations(context.Context, string) ([]Attestation, error)
InsertAttestation(context.Context, Attestation) error
WithdrawAttestation(context.Context, string, string, Caller) (CommitResult, error)
Acceptances(context.Context, string, int64) ([]Acceptance, error)
InsertAcceptance(context.Context, string, Acceptance) error
Append(context.Context, Event) (Event, error)
Revision(context.Context) (int64, error)
}
type Value ¶
type Value struct {
Kind ValueKind
Text *string
Boolean *bool
Integer *int64
Decimal *string
Unit string
Date *string
Instant *time.Time
Entity *string
}
Value has exactly one payload. Unknown has no payload. Decimal strings are canonical.
type ValueConstraints ¶
type ValueConstraints struct {
AllowUnknown *bool `json:",omitempty"`
AllowedValues []Value `json:",omitempty"`
MinTextRunes, MaxTextRunes *int `json:",omitempty"`
MinInteger, MaxInteger *int64 `json:",omitempty"`
MinDecimal, MaxDecimal *string `json:",omitempty"`
DecimalPlaces *int `json:",omitempty"`
Units []string `json:",omitempty"`
}
ValueConstraints are immutable, application-owned restrictions. Nil fields preserve the base value contract. Bounds are inclusive; text length is runes.
type Version ¶
type Version struct {
PayloadDisposed bool `json:",omitempty"`
ExtractionAttemptID string `json:",omitempty"`
ID, RecordID, Digest string
Proposal FactProposal
Proposer Caller
PolicyID string
}
func VersionTombstone ¶
VersionTombstone removes the typed value and source quotes, preserving the original digest, identities, locators and governance provenance. This is not disposal authorization, and the metadata cannot reconstruct original content. It does not mutate the input.
type VersionDisposalRequest ¶
type VersionDisposalRequest struct {
Command
Kind, Scope, RecordID, VersionID, Reason string
Bindings []VersionRetentionBinding
}
VersionDisposalRequest selects one immutable fact or memory payload. Its index cleanup obligations are durable but may remain pending after commit.
type VersionDisposalTx ¶
type VersionDisposalTx interface {
DisposeVersion(context.Context, VersionDisposalRequest) (int64, error)
}
VersionDisposalTx atomically validates retention policy and retained copies, fences references/lifecycle writes, retains a tombstone, captures index cleanup obligations and increments the owning record revision. It returns that revision.
type VersionReference ¶
type VersionReference struct{ RecordID, VersionID string }
type VersionRetentionBinding ¶
type VersionRetentionBinding struct{ Scope, PolicyID, Jurisdiction string }
type Withdrawal ¶
Source Files
¶
- archive.go
- attestation_identity.go
- attestation_tombstone.go
- audit.go
- calculation_tombstone.go
- confirmation.go
- conflicts.go
- context.go
- conversation.go
- conversation_retention.go
- decision_tombstone.go
- disposal_batch.go
- evidence.go
- evidence_derivation.go
- extraction.go
- extraction_budget.go
- extraction_chunks.go
- extraction_retention.go
- extraction_tombstone_validation.go
- identities.go
- memory.go
- memory_refresh.go
- operations.go
- options.go
- outbox.go
- projection.go
- projection_cleanup.go
- projection_destinations.go
- projection_disposal.go
- reads.go
- rebuild.go
- rebuild_pages.go
- retention.go
- schema.go
- telemetry.go
- temporal.go
- timeline.go
- types.go
- version_retention.go