Documentation
¶
Overview ¶
Package materialize orchestrates the kernel's materialize transition: it reads the addressed declaration records, dispatches them to the witness-stamped substrate, appends the returned capture drafts, and commits the completed-intent ledger that makes replays idempotent. The ordering law is load-bearing: captures are appended before the ledger entry, so a crash between them replays safely under the same intent id.
Index ¶
Constants ¶
const MaxOwnerOrdinal = math.MaxInt
MaxOwnerOrdinal is the default cutoff for target reads.
It mirrors Python's MAX_OWNER_ORDINAL (2**63 - 1) on 64-bit platforms, where the store's int-based ordinals are 64-bit — that is every platform the vectors run on. On a 32-bit platform an int cannot carry 2**63 - 1, so the constant is the platform's math.MaxInt instead: the largest cutoff this API can express. Ordinals are bounded by rows in path_entries, so a cutoff that large is a "no cutoff" either way; only the request *digest* would differ from Python's on 32-bit, and no 32-bit consumer exists.
const OpMaterialize = trace.OperationKind("materialize")
OpMaterialize is the reserved operation kind the materialize orchestrator requires (plan 03): Materialize accepts an OperationContext and rejects any context whose Operation is not this kind. It moved here from the kernel's trace package (d7c) — the append/read entry points derive their own operation kinds, so this one is only presentable through Materialize.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MaterializationReceipt ¶ added in v0.23.0
type MaterializationReceipt struct {
Outcome substrate.MaterializationOutcome
SubstrateRef string
TargetRecordIDs []string
ProducedRecordIDs []string
FailureReason string
WorldSideAnchors []map[string]any
}
MaterializationReceipt is the materialize transition receipt handed back to callers and stored in the kernel's completed-intent ledger. Its field set mirrors Python's MaterializationReceipt exactly, because the ledger's receipt_json is serialized from it and must stay cross-readable with the Python reference.
func Materialize ¶
func Materialize(ctx context.Context, store *trace.SQLiteTraceStore, opCtx trace.OperationContext, req MaterializationRequest, reg *substrate.SubstrateRegistry) (MaterializationReceipt, error)
Materialize materializes declarations through their witness-stamped substrate. It enforces the reserved materialize operation kind — the entry point that makes that vocabulary live — and replays stored receipts for repeated intents without re-dispatching the substrate.
type MaterializationRequest ¶
type MaterializationRequest struct {
// AppendIntentID is the idempotency key for the materialize transition.
// The capture batch is appended under this same intent id, which is what
// makes the crash window safe.
AppendIntentID string
// TargetTraceOwnerID is the owner path the targets must be present on.
TargetTraceOwnerID string
// TargetRecordIDs are the declaration records to materialize.
TargetRecordIDs []string
// TargetThroughOwnerOrdinal bounds the target read; targets beyond it
// are invisible and therefore rejected. Callers wanting Python's default
// pass MaxOwnerOrdinal; zero is a real cutoff at ordinal 0.
TargetThroughOwnerOrdinal int
// CaptureTraceOwnerID is the owner path captures are appended to; empty
// means the target owner.
CaptureTraceOwnerID string
}
MaterializationRequest is a path-explicit request to materialize retained declaration records. Bare record ids are insufficient — Python law: the same content appended under two owners allocates the same record id, so the owner path is what makes the request unambiguous.
func (MaterializationRequest) CaptureOwner ¶
func (r MaterializationRequest) CaptureOwner() string
CaptureOwner returns the owner path materialization captures are appended to.