Documentation
¶
Overview ¶
Package knowl contains the public, transport-neutral Knowl domain contracts.
Index ¶
- Constants
- type AcceptedSource
- type CatalogAddition
- type CatalogLimits
- type ContentCommit
- type ContextBudget
- type ContextDisposition
- type ContextOutcome
- type ContextPage
- type ContextSelectionDiagnostics
- type ContextSelectionReason
- type CorrectionOutcome
- type Document
- type DocumentID
- type DocumentPage
- type DocumentRef
- type DocumentState
- type ExecutionDescriptor
- type Failure
- type FileEdit
- type FilesystemSourceConfig
- type GitAuthConfig
- type GitSourceConfig
- type HierarchyCatalog
- type HierarchyCatalogSpec
- type HierarchyExecutionDescriptor
- type HierarchyInput
- type HierarchyLimits
- type HierarchyModelPlan
- type HierarchyMutation
- type HierarchyPage
- type Lease
- type LinkReference
- type LintFinding
- type LintReport
- type MaintenanceBudgetReport
- type MaintenanceCounts
- type MaintenanceDiagnostic
- type MaintenanceInput
- type MaintenanceInputLimits
- type MaintenanceRequestBudget
- type MaintenanceSample
- type ModelEditPlan
- type Operation
- type OperationContextReport
- type OperationCorrectionReport
- type OperationDetails
- type OperationExecutionDetails
- type OperationID
- type OperationIdentity
- type OperationKey
- type OperationMeta
- type OperationPlanSummary
- type OperationStatus
- type OperatorCatalog
- type OperatorCatalogChild
- type OperatorCatalogSummary
- type OperatorDocumentSummary
- type OperatorList
- type OperatorOperationSummary
- type OperatorPage
- type OperatorPageMetadata
- type OperatorPageSource
- type OperatorPageSummary
- type OperatorSourceDetail
- type OperatorSourceRevision
- type OperatorSourceStatus
- type OperatorSourceSummary
- type OperatorWikiEntry
- type OutputCorrectionLimits
- type OutputCorrectionPolicy
- type OutputSettings
- type OutputValidationCode
- type PageID
- type PageReference
- type PageSnapshot
- type PlanSummary
- type RawSourceRecord
- type ReadLimits
- type RecoveryResult
- type RetirementAction
- type RetirementEvidence
- type RetirementInput
- type RetirementModelPlan
- type RetirementOwnerAuthority
- type RetirementPageExecutionDescriptor
- type RetirementPlanContext
- type RetirementPlanResult
- type RetrievalFailure
- type RetrievalMode
- type RetrievalReport
- type RetrievalStatus
- type SchemaDocument
- type ScopeRef
- type Source
- type SourceAdapterID
- type SourceConfig
- type SourceDiagnostic
- type SourceDocument
- type SourceEnvelope
- type SourceID
- type SourceLifecycle
- type SourceLifecycleAuthority
- type SourceLifecycleState
- type SourceMaintenanceStatus
- type SourceMutation
- type SourceMutationAction
- type SourceMutationPlan
- type SourceOwner
- type SourceRef
- type SourceRetirementDiscovery
- type SourceRetirementOperationCounts
- type SourceRetirementReadinessStatus
- type SourceRetirementStatus
- type SourceStatus
- type SourceSummary
- type SourceSyncPolicy
- type SourceType
- type SourceVersion
- type StagedChange
- type StagedSourceMutation
- type SyncCounts
- type SyncRun
- type SyncRunID
- type SyncStatus
- type ValidatedEditPlan
- type ValidatedHierarchyPlan
- type VectorProjectionState
- type VectorProjectionStatus
- type WorkClaim
- type WorkKind
- type WorkLease
- type WorkspaceInspection
- type WorkspaceSnapshot
Constants ¶
const ( // SourceTypeFilesystem selects the built-in filesystem source contract. SourceTypeFilesystem SourceType = "filesystem" // SourceTypeGit selects the remote Git source contract. SourceTypeGit SourceType = "git" // SourceFlavorMarkdown preserves ordinary Markdown references. SourceFlavorMarkdown = "markdown" // SourceFlavorObsidian enables Obsidian reference normalization. SourceFlavorObsidian = "obsidian" // SourceFlavorOKF preserves validated Open Knowledge Format semantics. SourceFlavorOKF = "okf" // GitRefKindBranch identifies branch ref tracking. GitRefKindBranch = "branch" // GitRefKindTag identifies tag ref tracking. GitRefKindTag = "tag" )
const ( DiagnosticCitationUnknownSource = "citation.unknown_source" DiagnosticOriginalLinkUnresolved = "link.original_unresolved" DiagnosticLinkUnresolved = "link.unresolved" DiagnosticCatalogDependencyReject = "catalog.dependency_rejected" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptedSource ¶
type AcceptedSource struct {
Scope ScopeRef `json:"scope"`
Source SourceRef `json:"source"`
Version SourceVersion `json:"version"`
MediaType string `json:"media_type"`
SourceDocument SourceDocument `json:"source_document,omitzero"`
ManifestRef string `json:"manifest_ref"`
}
AcceptedSource describes an immutable source version stored in the workspace.
type CatalogAddition ¶ added in v0.6.0
type CatalogAddition struct {
Path string `json:"path"`
ExpectedDigest string `json:"expected_digest,omitempty"`
Title string `json:"title,omitempty"`
Children []string `json:"children"`
}
CatalogAddition adds navigation to an existing catalog or creates a new one. Existing catalogs require ExpectedDigest and omit Title. New catalogs require Title and an empty ExpectedDigest. Children are canonical wiki file paths.
type CatalogLimits ¶ added in v0.6.0
type CatalogLimits struct {
MaxCatalogs int `json:"max_catalogs"`
MaxEdges int `json:"max_edges"`
MaxDepth int `json:"max_depth"`
MaxPathBytes int `json:"max_path_bytes"`
MaxCatalogBytes int `json:"max_catalog_bytes"`
MaxSnapshotBytes int `json:"max_snapshot_bytes"`
MaxInputBytes int `json:"max_input_bytes"`
}
CatalogLimits bounds complete source-maintenance navigation independently of the selected factual-page context.
type ContentCommit ¶
type ContentCommit struct {
OperationID string `json:"operation_id"`
Generation string `json:"generation"`
Files []string `json:"files"`
Snapshot WorkspaceSnapshot `json:"snapshot"`
CommittedAt time.Time `json:"committed_at"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
}
ContentCommit describes a canonical workspace commit.
type ContextBudget ¶ added in v0.6.0
type ContextBudget struct {
MaxBytes int `json:"max_bytes"`
UsedBytes *int `json:"used_bytes,omitempty"`
IncludedCount int `json:"included_count"`
OmittedCount int `json:"omitted_count"`
}
ContextBudget retains measured request fitting, including an unknown size.
type ContextDisposition ¶ added in v0.6.0
type ContextDisposition string
ContextDisposition distinguishes completed fitting from unprocessed input.
const ( ContextIncluded ContextDisposition = "included" ContextBudgetOmitted ContextDisposition = "budget_omitted" ContextPending ContextDisposition = "pending" )
type ContextOutcome ¶ added in v0.6.0
type ContextOutcome string
ContextOutcome describes a measured selection/assembly result, not work state.
const ( ContextAssembled ContextOutcome = "assembled" ContextSelectionFailed ContextOutcome = "selection_failed" ContextAssemblyFailed ContextOutcome = "assembly_failed" )
type ContextPage ¶ added in v0.6.0
type ContextPage struct {
PageID PageID `json:"page_id"`
SelectionReason ContextSelectionReason `json:"selection_reason"`
Disposition ContextDisposition `json:"disposition"`
}
ContextPage contains identifiers and categories, never page/source text.
type ContextSelectionDiagnostics ¶ added in v0.6.0
type ContextSelectionDiagnostics struct {
Reasons map[PageID]ContextSelectionReason
VectorProjection *VectorProjectionStatus
}
ContextSelectionDiagnostics is detached metadata from the actual index pass.
type ContextSelectionReason ¶ added in v0.6.0
type ContextSelectionReason string
ContextSelectionReason records the first actual selection phase/channel.
const ( ContextLexical ContextSelectionReason = "lexical" ContextVector ContextSelectionReason = "vector" ContextHybrid ContextSelectionReason = "hybrid" ContextNeighbor ContextSelectionReason = "neighbor" ContextRecent ContextSelectionReason = "recent" ContextUnknown ContextSelectionReason = "unknown" )
type CorrectionOutcome ¶ added in v0.6.0
type CorrectionOutcome string
const ( CorrectionAccepted CorrectionOutcome = "accepted" CorrectionExhausted CorrectionOutcome = "exhausted" CorrectionOutputLimit CorrectionOutcome = "output_limit" CorrectionDeadline CorrectionOutcome = "deadline" CorrectionCanceled CorrectionOutcome = "canceled" CorrectionProviderFailed CorrectionOutcome = "provider_failed" )
type Document ¶ added in v0.3.0
type Document struct {
DocumentRef
Title string `json:"title"`
URI string `json:"uri"`
MediaType string `json:"media_type"`
Content []byte `json:"content"`
}
Document is one fetched immutable source revision.
type DocumentID ¶ added in v0.3.0
type DocumentID string
DocumentID identifies one logical document within a configured source.
type DocumentPage ¶ added in v0.3.0
type DocumentPage struct {
Documents []DocumentRef `json:"documents"`
NextPageToken string `json:"next_page_token,omitempty"`
}
DocumentPage is one deterministic page of source descriptors.
type DocumentRef ¶ added in v0.3.0
type DocumentRef struct {
ExternalID DocumentID `json:"external_id"`
Revision string `json:"revision"`
Path string `json:"path"`
Metadata map[string]string `json:"metadata,omitempty"`
}
DocumentRef is a cheap source descriptor used before content is fetched.
type DocumentState ¶ added in v0.3.0
type DocumentState struct {
Scope ScopeRef `json:"scope"`
SourceID SourceID `json:"source_id"`
DocumentID DocumentID `json:"document_id"`
Revision string `json:"revision"`
AcceptedSource AcceptedSource `json:"accepted_source,omitempty"`
MaintenanceRevision string `json:"maintenance_revision,omitempty"`
MaintenanceOperationID OperationID `json:"maintenance_operation_id,omitempty"`
MaintenanceGeneration string `json:"maintenance_generation,omitempty"`
MirrorPath string `json:"mirror_path,omitempty"`
MirrorDigest string `json:"mirror_digest,omitempty"`
LastSeenRunID SyncRunID `json:"last_seen_run_id"`
Deleted bool `json:"deleted"`
DeletedAt time.Time `json:"deleted_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
DocumentState is the durable head or tombstone for one logical document.
type ExecutionDescriptor ¶
type ExecutionDescriptor struct {
OperationID OperationID `json:"operation_id"`
Kind WorkKind `json:"kind,omitempty"`
Source AcceptedSource `json:"source,omitzero"`
Hierarchy *HierarchyExecutionDescriptor `json:"hierarchy,omitempty"`
RetirementPage *RetirementPageExecutionDescriptor `json:"retirement_page,omitempty"`
Schema SchemaDocument `json:"schema"`
MaintenanceGeneration string `json:"maintenance_generation,omitempty"`
}
ExecutionDescriptor contains the bounded durable inputs needed to resume an accepted operation. It is internal operational state, not a public operation read model.
type Failure ¶
type Failure struct {
Class string `json:"class"`
Reason string `json:"reason,omitempty"`
OperationID string `json:"operation_id"`
}
Failure is a stable, redacted operation failure.
type FileEdit ¶
type FileEdit struct {
Action SourceMutationAction `json:"action,omitempty"`
Path string `json:"path"`
ExpectedDigest string `json:"expected_digest,omitempty"`
Content []byte `json:"content"`
}
FileEdit is one validated canonical workspace file replacement.
type FilesystemSourceConfig ¶ added in v0.3.0
type FilesystemSourceConfig struct {
Root string `json:"root"`
Include []string `json:"include,omitempty"`
Flavor string `json:"flavor,omitempty"`
URIBase string `json:"uri_base,omitempty"`
}
FilesystemSourceConfig configures a filesystem-backed source.
type GitAuthConfig ¶ added in v0.4.0
type GitAuthConfig struct {
SecretEnv string `json:"secret_env,omitempty"`
KeyFile string `json:"key_file,omitempty"`
}
GitAuthConfig configures credentials for Git source authentication.
type GitSourceConfig ¶ added in v0.4.0
type GitSourceConfig struct {
Remote string `json:"remote"`
Ref string `json:"ref"`
RefKind string `json:"ref_kind,omitempty"`
Include []string `json:"include,omitempty"`
Flavor string `json:"flavor,omitempty"`
URIBase string `json:"uri_base,omitempty"`
Auth GitAuthConfig `json:"auth,omitempty"`
AllowRewrite bool `json:"allow_rewrite,omitempty"`
RebindAck bool `json:"rebind_ack,omitempty"`
KnownHosts []string `json:"known_hosts,omitempty"`
RepositoryID string `json:"repository_id,omitempty"`
MaxTransferBytes int64 `json:"max_transfer_bytes,omitempty"`
MaxCacheBytes int64 `json:"max_cache_bytes,omitempty"`
}
GitSourceConfig configures a remote Git repository source.
type HierarchyCatalog ¶ added in v0.4.0
type HierarchyCatalog struct {
Path string `json:"path"`
Digest string `json:"digest"`
Title string `json:"title"`
Children []string `json:"children,omitempty"`
}
HierarchyCatalog describes current catalog membership without exposing catalog Markdown to a semantic planner.
type HierarchyCatalogSpec ¶ added in v0.4.0
type HierarchyCatalogSpec struct {
Path string `json:"path"`
Title string `json:"title"`
Children []string `json:"children"`
}
HierarchyCatalogSpec is one desired managed catalog and its complete child membership. Paths are canonical workspace paths below wiki/.
type HierarchyExecutionDescriptor ¶ added in v0.4.0
type HierarchyExecutionDescriptor struct {
SnapshotDigest string `json:"snapshot_digest"`
PlannerVersion string `json:"planner_version"`
}
HierarchyExecutionDescriptor is the bounded versioned payload needed to re-inspect and execute one reserved hierarchy snapshot.
type HierarchyInput ¶ added in v0.4.0
type HierarchyInput struct {
Scope ScopeRef `json:"scope"`
SchemaDigest string `json:"schema_digest"`
SnapshotDigest string `json:"snapshot_digest"`
MinRootCatalogs int `json:"min_root_catalogs,omitempty"`
Pages []HierarchyPage `json:"pages"`
Catalogs []HierarchyCatalog `json:"catalogs"`
Limits HierarchyLimits `json:"limits"`
}
HierarchyInput is the complete bounded context supplied for one hierarchy plan. MinRootCatalogs is zero for a trivial wiki and at least two when the caller has classified the workspace as multi-domain.
type HierarchyLimits ¶ added in v0.4.0
type HierarchyLimits struct {
MaxPages int `json:"max_pages"`
MaxCatalogs int `json:"max_catalogs"`
MaxEdges int `json:"max_edges"`
MaxDepth int `json:"max_depth"`
MaxInputBytes int `json:"max_input_bytes"`
MaxExcerptCharacters int `json:"max_excerpt_characters"`
MaxPlanBytes int `json:"max_plan_bytes"`
MaxEdits int `json:"max_edits"`
MaxPathBytes int `json:"max_path_bytes"`
MaxCatalogBytes int `json:"max_catalog_bytes"`
MaxManifestBytes int `json:"max_manifest_bytes"`
}
HierarchyLimits bounds semantic hierarchy planning and catalog rendering. A complete input must fit these limits; callers must not silently truncate it.
type HierarchyModelPlan ¶ added in v0.4.0
type HierarchyModelPlan struct {
SchemaDigest string `json:"schema_digest"`
SnapshotDigest string `json:"snapshot_digest"`
Catalogs []HierarchyCatalogSpec `json:"catalogs"`
}
HierarchyModelPlan is structured provider output before application validation and deterministic Markdown rendering.
type HierarchyMutation ¶ added in v0.4.0
type HierarchyMutation struct {
Action SourceMutationAction `json:"action"`
Path string `json:"path"`
ExpectedDigest string `json:"expected_digest,omitempty"`
Content []byte `json:"content,omitempty"`
}
HierarchyMutation is one application-rendered managed catalog write or delete. A model never supplies this type directly.
type HierarchyPage ¶ added in v0.4.0
type HierarchyPage struct {
ID PageID `json:"id"`
Path string `json:"path"`
Digest string `json:"digest"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Excerpt string `json:"excerpt,omitempty"`
Catalogs []string `json:"catalogs,omitempty"`
}
HierarchyPage is bounded semantic context for one ordinary canonical page. It intentionally excludes raw source bytes and source-native paths.
type LinkReference ¶
type LinkReference struct {
From PageID `json:"from"`
To PageID `json:"to"`
Relation string `json:"relation"`
Untrusted bool `json:"untrusted"`
}
LinkReference is an untrusted bounded graph result.
type LintFinding ¶
type LintFinding struct {
Code string `json:"code"`
Severity string `json:"severity"`
Path string `json:"path,omitempty"`
PageID PageID `json:"page_id,omitempty"`
Message string `json:"message"`
Suggestion bool `json:"suggestion,omitempty"`
SourceRefs []string `json:"source_refs,omitempty"`
}
LintFinding is one deterministic or suggestion-only workspace diagnostic.
type LintReport ¶
type LintReport struct {
Scope ScopeRef `json:"scope"`
Findings []LintFinding `json:"findings"`
CheckedAt time.Time `json:"checked_at"`
}
LintReport contains bounded, redacted workspace health findings.
func (LintReport) Healthy ¶
func (report LintReport) Healthy() bool
Healthy reports whether lint found no error or warning findings.
type MaintenanceBudgetReport ¶ added in v0.6.0
type MaintenanceBudgetReport struct {
MaxBytes int
UsedBytes int
IncludedCount int
OmittedCount int
}
MaintenanceBudgetReport contains transient, content-free assembly evidence. It is not a durable HTTP/MCP diagnostics contract.
type MaintenanceCounts ¶ added in v0.3.0
type MaintenanceCounts struct {
Queued int64 `json:"queued"`
Retrying int64 `json:"retrying"`
Replayed int64 `json:"replayed"`
Committed int64 `json:"committed"`
Failed int64 `json:"failed"`
}
MaintenanceCounts summarizes the asynchronous operations reserved by the active documents of one configured source. Replayed counts operations with more than one durable worker attempt and may overlap another outcome.
type MaintenanceDiagnostic ¶ added in v0.5.0
type MaintenanceDiagnostic struct {
Code string `json:"code" yaml:"code"`
Path string `json:"path" yaml:"path"`
Target string `json:"target,omitempty" yaml:"target,omitempty"`
}
MaintenanceDiagnostic is bounded redacted metadata for a preserved warning or a document-local rejection.
type MaintenanceInput ¶
type MaintenanceInput struct {
InputLimits MaintenanceInputLimits `json:"input_limits"`
ContractVersion string `json:"contract_version"`
CatalogLimits CatalogLimits `json:"catalog_limits"`
Scope ScopeRef `json:"scope"`
Schema SchemaDocument `json:"schema"`
Source AcceptedSource `json:"source"`
SourceText string `json:"source_text"`
Pages []PageSnapshot `json:"pages"`
Catalogs []HierarchyCatalog `json:"catalogs,omitempty"`
Limits ReadLimits `json:"limits"`
}
MaintenanceInput is the versioned, bounded data supplied to a maintainer. Pages contains ordinary factual snapshots; Catalogs is the complete compact navigation graph. Authoritative catalog Markdown remains in the application.
type MaintenanceInputLimits ¶ added in v0.6.0
type MaintenanceInputLimits struct {
// Zero selects 4 MiB; embedded custom caps are positive and at most 4 MiB.
MaxRequestBytes int `json:"max_request_bytes"`
}
MaintenanceInputLimits bounds the complete current source-maintenance user prompt, including its envelope and structured wrapper, in UTF-8 bytes.
type MaintenanceRequestBudget ¶ added in v0.6.0
type MaintenanceRequestBudget struct {
// MaxBytes must be positive; the app uses the smaller local/provider cap.
MaxBytes int
// ReservedBytes leaves room for bounded corrective feedback; zero is compatible.
ReservedBytes int
// FormatVersion must be nonempty printable text, at most 256 UTF-8 bytes.
FormatVersion string
}
MaintenanceRequestBudget declares a maintainer's finite request capacity and non-secret serialization/sizing policy identity. It does not identify a URL.
type MaintenanceSample ¶ added in v0.3.0
type MaintenanceSample struct {
DocumentID DocumentID `json:"document_id"`
Revision string `json:"revision"`
OperationID OperationID `json:"operation_id"`
GenerationPrefix string `json:"generation_prefix,omitempty"`
Status OperationStatus `json:"status"`
Replayed bool `json:"replayed"`
WorkAttempt int `json:"work_attempt"`
RetryAttempt int `json:"retry_attempt"`
ManualRetryCount int `json:"manual_retry_count"`
FailureClass string `json:"failure_class,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
NextRetryAt time.Time `json:"next_retry_at,omitempty"`
}
MaintenanceSample is one bounded, redacted source-to-operation correlation.
type ModelEditPlan ¶
type ModelEditPlan struct {
CatalogAdditions []CatalogAddition `json:"catalog_additions,omitempty"`
SchemaDigest string `json:"schema_digest"`
SourceRefs []string `json:"source_refs"`
Edits []FileEdit `json:"edits"`
Rationale string `json:"rationale,omitempty"`
}
ModelEditPlan is structured provider output before application validation. Source maintenance uses CatalogAdditions for navigation; Edits must not replace index.md catalog Markdown.
type Operation ¶
type Operation struct {
ID OperationID `json:"id"`
Kind WorkKind `json:"kind,omitempty"`
Key OperationKey `json:"key,omitzero"`
Status OperationStatus `json:"status"`
Attempt int `json:"attempt"`
WorkAttempt int `json:"work_attempt"`
RetryAttempt int `json:"retry_attempt"`
ManualRetryCount int `json:"manual_retry_count"`
ReadyAt time.Time `json:"ready_at,omitempty"`
Failure *Failure `json:"failure,omitempty"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
Retrieval *RetrievalReport `json:"retrieval,omitempty"`
RetrievalAttempt int `json:"retrieval_attempt,omitempty"`
Context *OperationContextReport `json:"context,omitempty"`
Correction *OperationCorrectionReport `json:"correction,omitempty"`
Plan *OperationPlanSummary `json:"plan,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
Operation is a redacted operation read model.
type OperationContextReport ¶ added in v0.6.0
type OperationContextReport struct {
Version int `json:"version"`
WorkAttempt int `json:"work_attempt"`
Outcome ContextOutcome `json:"outcome"`
CandidateCount *int `json:"candidate_count,omitempty"`
CatalogCount *int `json:"catalog_count,omitempty"`
Pages []ContextPage `json:"pages,omitempty"`
EntriesOmitted int `json:"entries_omitted"`
Budget *ContextBudget `json:"budget,omitempty"`
VectorProjection *VectorProjectionStatus `json:"vector_projection,omitempty"`
}
OperationContextReport is one immutable, bounded snapshot per work attempt.
type OperationCorrectionReport ¶ added in v0.6.0
type OperationCorrectionReport struct {
Version int `json:"version"`
WorkAttempt int `json:"work_attempt"`
MaxCorrections int `json:"max_corrections"`
MaxOutputBytes int `json:"max_output_bytes"`
DeadlineNanos int64 `json:"deadline_nanos"`
Outcome CorrectionOutcome `json:"outcome"`
Turns *int `json:"turns,omitempty"`
Corrections *int `json:"corrections,omitempty"`
OutputBytes *int `json:"output_bytes,omitempty"`
ValidationCode OutputValidationCode `json:"validation_code,omitempty"`
}
OperationCorrectionReport is one immutable, content-free attempt report. OutputBytes counts text accepted by the raw guard; on overflow it is a prefix. Nil counters mean unavailable, never a measured zero.
type OperationDetails ¶ added in v0.6.0
type OperationDetails struct {
Correction *OperationCorrectionReport `json:"correction,omitempty"`
Context *OperationContextReport `json:"context,omitempty"`
Retrieval *RetrievalReport `json:"retrieval,omitempty"`
RetrievalAttempt *int `json:"retrieval_attempt,omitempty"`
Plan *OperationPlanSummary `json:"plan,omitempty"`
Warnings []MaintenanceDiagnostic `json:"warnings,omitempty"`
WarningsOmitted int `json:"warnings_omitted,omitempty"`
Execution *OperationExecutionDetails `json:"execution,omitempty"`
}
OperationDetails is the explicitly allowlisted public operation projection.
type OperationExecutionDetails ¶ added in v0.6.0
type OperationExecutionDetails struct {
WorkAttempt int `json:"work_attempt"`
RetryAttempt int `json:"retry_attempt"`
ManualRetryCount int `json:"manual_retry_count"`
ApplyAttempt int `json:"apply_attempt"`
ReadyAt time.Time `json:"ready_at,omitzero"`
}
OperationExecutionDetails uses existing counters; apply attempts are not inference calls.
type OperationIdentity ¶ added in v0.4.0
type OperationIdentity struct {
Scope ScopeRef `json:"scope"`
Kind WorkKind `json:"kind"`
Subject string `json:"subject"`
Revision string `json:"revision"`
Digest string `json:"digest"`
}
OperationIdentity is the generic deterministic identity of durable work.
type OperationKey ¶
type OperationKey struct {
Scope ScopeRef `json:"scope"`
Source SourceRef `json:"source"`
Version SourceVersion `json:"version"`
MaintenanceGeneration string `json:"maintenance_generation,omitempty"`
}
OperationKey is the idempotency identity for an immutable source revision.
type OperationMeta ¶
type OperationMeta struct {
Key OperationKey `json:"key"`
AcceptedSource AcceptedSource `json:"accepted_source"`
Schema SchemaDocument `json:"schema"`
SchemaDigest string `json:"schema_digest"`
MaintenanceGeneration string `json:"maintenance_generation,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
OperationMeta contains the bounded internal inputs persisted at reservation.
type OperationPlanSummary ¶ added in v0.6.0
type OperationPlanSummary struct {
Digest string `json:"digest"`
FileCount *int `json:"file_count,omitempty"`
}
OperationPlanSummary exposes a stored digest and only a known file count.
type OperationStatus ¶
type OperationStatus string
OperationStatus is the lifecycle state of a maintenance operation.
const ( StatusReceived OperationStatus = "received" StatusPlanned OperationStatus = "planned" StatusAwaitingReview OperationStatus = "awaiting_review" StatusApplying OperationStatus = "applying" StatusCommitted OperationStatus = "committed" StatusFailed OperationStatus = "failed" )
type OperatorCatalog ¶ added in v0.6.0
type OperatorCatalog struct {
Parent OperatorCatalogSummary `json:"parent"`
Items []OperatorCatalogChild `json:"items"`
NextCursor string `json:"next_cursor,omitempty"`
SnapshotVersion string `json:"snapshot_version"`
}
OperatorCatalog contains a parent and its bounded direct children.
type OperatorCatalogChild ¶ added in v0.6.0
type OperatorCatalogChild struct {
ID PageID `json:"id"`
Title string `json:"title"`
Kind string `json:"kind"`
Description string `json:"description,omitempty"`
}
OperatorCatalogChild is one direct catalog or factual-page child.
type OperatorCatalogSummary ¶ added in v0.6.0
OperatorCatalogSummary identifies one canonical navigation catalog.
type OperatorDocumentSummary ¶ added in v0.6.0
type OperatorDocumentSummary struct {
ID DocumentID `json:"id"`
Revision string `json:"revision"`
AcceptedRevision string `json:"accepted_revision,omitempty"`
MaintenanceStatus OperationStatus `json:"maintenance_status,omitempty"`
MaintenanceRevision string `json:"maintenance_revision,omitempty"`
MaintenanceOperationID OperationID `json:"maintenance_operation_id,omitempty"`
Deleted bool `json:"deleted"`
UpdatedAt time.Time `json:"updated_at"`
}
OperatorDocumentSummary exposes stored document processing associations. Revision is the saved head; AcceptedRevision is present only for validated accepted metadata. An empty MaintenanceStatus means the scoped associated operation is unavailable, rather than an inferred maintenance outcome.
type OperatorList ¶ added in v0.6.0
type OperatorList[T any] struct { Items []T `json:"items"` NextCursor string `json:"next_cursor,omitempty"` SnapshotVersion string `json:"snapshot_version,omitempty"` }
OperatorList is the bounded public list envelope. SnapshotVersion identifies only the current canonical read; it does not promise historical storage.
type OperatorOperationSummary ¶ added in v0.6.0
type OperatorOperationSummary struct {
ID OperationID `json:"id"`
Kind WorkKind `json:"kind,omitempty"`
Status OperationStatus `json:"status"`
SourceID SourceID `json:"source_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
OperatorOperationSummary includes the stored source association and immutable creation tuple used for continuation, without execution inputs or raw failures.
type OperatorPage ¶ added in v0.6.0
type OperatorPage struct {
ID PageID `json:"id"`
Title string `json:"title"`
Markdown string `json:"markdown"`
Digest string `json:"digest"`
Version string `json:"version"`
Metadata *OperatorPageMetadata `json:"metadata,omitempty"`
RelatedPageIDs []PageID `json:"related_page_ids"`
Sources []OperatorPageSource `json:"sources"`
}
OperatorPage is a detached current canonical page projection.
type OperatorPageMetadata ¶ added in v0.6.0
type OperatorPageMetadata struct {
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Status string `json:"status,omitempty"`
TrustTier string `json:"trust_tier,omitempty"`
Stale bool `json:"stale"`
}
OperatorPageMetadata allows supported display facts, never arbitrary extensions.
type OperatorPageSource ¶ added in v0.6.0
type OperatorPageSource struct {
SourceRef string `json:"source_ref"`
SourceID SourceID `json:"source_id,omitempty"`
DocumentID DocumentID `json:"document_id,omitempty"`
Revision string `json:"revision"`
OriginalURI string `json:"original_uri,omitempty"`
}
OperatorPageSource is resolved page-level provenance. OriginalURI must be a credential-free safe http/https URL, or empty when unavailable.
type OperatorPageSummary ¶ added in v0.6.0
type OperatorPageSummary struct {
ID PageID `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Digest string `json:"digest"`
Version string `json:"version"`
UpdatedAt time.Time `json:"updated_at"`
}
OperatorPageSummary exposes factual page identity without filesystem paths.
type OperatorSourceDetail ¶ added in v0.6.0
type OperatorSourceDetail struct {
Source OperatorSourceSummary `json:"source"`
Documents OperatorList[OperatorDocumentSummary] `json:"documents"`
}
OperatorSourceDetail combines safe source status and a bounded document list.
type OperatorSourceRevision ¶ added in v0.6.0
type OperatorSourceRevision struct {
SourceRef string `json:"source_ref"`
Source SourceRef `json:"source"`
Version SourceVersion `json:"version"`
MediaType string `json:"media_type"`
Digest string `json:"digest"`
OriginalURI string `json:"original_uri,omitempty"`
Text string `json:"text"`
}
OperatorSourceRevision exposes immutable accepted text without manifest paths.
type OperatorSourceStatus ¶ added in v0.6.0
type OperatorSourceStatus struct {
Status SyncStatus `json:"status,omitempty"`
Counts SyncCounts `json:"counts"`
LastAttemptAt time.Time `json:"last_attempt_at,omitzero"`
LastSuccessfulAt time.Time `json:"last_successful_at,omitzero"`
UpdatedAt time.Time `json:"updated_at"`
MaintenanceCounts MaintenanceCounts `json:"maintenance_counts"`
}
OperatorSourceStatus allows durable processing facts without configuration, checkpoints, repository identities, or arbitrary provider error messages.
type OperatorSourceSummary ¶ added in v0.6.0
type OperatorSourceSummary struct {
ID SourceID `json:"id"`
Type SourceType `json:"type"`
Enabled bool `json:"enabled"`
Status *OperatorSourceStatus `json:"status,omitempty"`
}
OperatorSourceSummary is the safe configured identity and durable status.
type OperatorWikiEntry ¶ added in v0.6.0
type OperatorWikiEntry struct {
Path string `json:"path"`
Name string `json:"name"`
Kind string `json:"kind"`
PageID PageID `json:"page_id,omitempty"`
}
OperatorWikiEntry is one immediate filesystem-path tree node. A folder and its index.md are separate entries; PageID is set only for readable pages. Kind "unsupported" names a canonical Markdown or directory path excluded by the operator alias policy and must not be offered as a navigation link.
type OutputCorrectionLimits ¶ added in v0.6.0
type OutputCorrectionLimits struct {
MaxCorrections int `json:"max_corrections"`
MaxOutputBytes int `json:"max_output_bytes"`
DeadlineNanos int64 `json:"deadline_nanos"`
}
OutputCorrectionLimits bounds one complete planning sequence.
type OutputCorrectionPolicy ¶ added in v0.6.0
type OutputCorrectionPolicy struct {
Supported bool `json:"supported"`
Limits OutputCorrectionLimits `json:"limits"`
}
OutputCorrectionPolicy contains only effective non-secret planning choices.
type OutputSettings ¶ added in v0.6.0
type OutputSettings struct {
MaxCorrections *int `json:"max_corrections,omitempty" mapstructure:"max_corrections"`
}
OutputSettings distinguishes an omitted allowance from explicit zero.
type OutputValidationCode ¶ added in v0.6.0
type OutputValidationCode string
const ( StructuredOutputInvalid OutputValidationCode = "structured_output_invalid" SourcePlanInvalid OutputValidationCode = "source_plan_invalid" HierarchyPlanInvalid OutputValidationCode = "hierarchy_plan_invalid" )
type PageReference ¶
type PageReference struct {
ID PageID `json:"id"`
Path string `json:"path"`
Title string `json:"title"`
Snippet string `json:"snippet"`
SourceRefs []string `json:"source_refs"`
SourceDocument *SourceDocument `json:"source_document,omitempty"`
SourceDocuments []SourceDocument `json:"source_documents,omitempty"`
OKF *okf.Metadata `json:"okf,omitempty"`
Untrusted bool `json:"untrusted"`
}
PageReference is an untrusted bounded search result.
type PageSnapshot ¶
type PageSnapshot struct {
ID PageID `json:"id"`
Path string `json:"path"`
Digest string `json:"digest"`
Title string `json:"title"`
Content string `json:"content"`
Body string `json:"body"`
OKF *okf.Metadata `json:"okf,omitempty"`
SourceRefs []string `json:"source_refs,omitempty"`
SourceDocument *SourceDocument `json:"source_document,omitempty"`
SourceDocuments []SourceDocument `json:"source_documents,omitempty"`
Untrusted bool `json:"untrusted"`
UpdatedAt time.Time `json:"updated_at"`
}
PageSnapshot is a bounded read of a canonical Markdown page.
type PlanSummary ¶
type PlanSummary struct {
OperationID string `json:"operation_id"`
Digest string `json:"digest"`
FileCount int `json:"file_count"`
CreatedAt time.Time `json:"created_at"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
}
PlanSummary is the durable redacted summary of a model plan.
type RawSourceRecord ¶
type RawSourceRecord struct {
Path string `json:"path"`
Source AcceptedSource `json:"source"`
ContentDigest string `json:"content_digest,omitempty"`
Valid bool `json:"valid"`
ErrorClass string `json:"error_class,omitempty"`
}
RawSourceRecord is a bounded, metadata-only inspection of one raw source version.
type ReadLimits ¶
type ReadLimits struct {
Pages int `json:"pages"`
Bytes int `json:"bytes"`
Characters int `json:"characters"`
Depth int `json:"depth"`
Deadline time.Duration `json:"deadline"`
}
ReadLimits bounds context and retrieval operations.
type RecoveryResult ¶
type RecoveryResult struct {
OperationID string `json:"operation_id"`
Action string `json:"action"`
ErrorClass string `json:"error_class,omitempty"`
}
RecoveryResult describes recovery of one interrupted content operation.
type RetirementAction ¶ added in v0.7.0
type RetirementAction string
RetirementAction is the complete result for one canonical page.
const ( // RetirementReplace publishes one complete replacement of the current page. RetirementReplace RetirementAction = "replace" // RetirementDelete removes the current page because no supported page remains. RetirementDelete RetirementAction = "delete" )
type RetirementEvidence ¶ added in v0.7.0
type RetirementEvidence struct {
SourceRef string `json:"source_ref"`
Source AcceptedSource `json:"source"`
Text string `json:"text"`
}
RetirementEvidence is one exact accepted active revision made available to page-scoped source-retirement recomputation.
type RetirementInput ¶ added in v0.7.0
type RetirementInput struct {
ContractVersion string `json:"contract_version"`
InputLimits MaintenanceInputLimits `json:"input_limits"`
CatalogLimits CatalogLimits `json:"catalog_limits"`
Scope ScopeRef `json:"scope"`
Schema SchemaDocument `json:"schema"`
Page PageSnapshot `json:"page"`
Evidence []RetirementEvidence `json:"evidence"`
Catalogs []HierarchyCatalog `json:"catalogs,omitempty"`
Limits ReadLimits `json:"limits"`
}
RetirementInput is the bounded page-scoped request supplied to an optional retirement-aware maintainer. Evidence contains active accepted revisions only and is sorted by SourceRef.
type RetirementModelPlan ¶ added in v0.7.0
type RetirementModelPlan struct {
SchemaDigest string `json:"schema_digest"`
Delete bool `json:"delete"`
SourceRefs []string `json:"source_refs"`
Pages []FileEdit `json:"pages"`
Rationale string `json:"rationale,omitempty"`
}
RetirementModelPlan is untrusted provider output. Delete requires no Pages; replacement requires exactly one complete page with its current preimage.
type RetirementOwnerAuthority ¶ added in v0.7.0
type RetirementOwnerAuthority struct {
Owner SourceOwner `json:"owner" yaml:"owner"`
ConfigDigest string `json:"config_digest" yaml:"config_digest"`
RetirementGeneration string `json:"retirement_generation" yaml:"retirement_generation"`
RetirementEpoch uint64 `json:"retirement_epoch" yaml:"retirement_epoch"`
}
RetirementOwnerAuthority is the exact retiring-owner fence carried by one page-scoped publication unit. Equal source IDs under different adapters are deliberately distinct owners.
type RetirementPageExecutionDescriptor ¶ added in v0.7.0
type RetirementPageExecutionDescriptor struct {
PageID PageID `json:"page_id"`
RetirementGeneration string `json:"retirement_generation"`
Owner SourceOwner `json:"owner"`
}
RetirementPageExecutionDescriptor is the bounded durable input for one page-scoped source-retirement operation. It never carries page content or a collection of pages.
type RetirementPlanContext ¶ added in v0.7.0
type RetirementPlanContext struct {
Scope ScopeRef `json:"scope" yaml:"scope"`
PageID PageID `json:"page_id" yaml:"page_id"`
PagePath string `json:"page_path" yaml:"page_path"`
PageDigest string `json:"page_digest" yaml:"page_digest"`
AuthorityGeneration string `json:"authority_generation" yaml:"authority_generation"`
AuthorityEpoch uint64 `json:"authority_epoch" yaml:"authority_epoch"`
Owners []RetirementOwnerAuthority `json:"owners" yaml:"owners"`
}
RetirementPlanContext confines lineage removal and explicit deletion to one exact current page under one lifecycle authority generation.
type RetirementPlanResult ¶ added in v0.7.0
type RetirementPlanResult struct {
Action RetirementAction `json:"action"`
Page PageSnapshot `json:"page"`
SourceRefs []string `json:"source_refs"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
}
RetirementPlanResult is the application-validated, page-scoped decision. It contains no staging or publication authority.
type RetrievalFailure ¶ added in v0.6.0
type RetrievalFailure string
RetrievalFailure is an allowlisted reason safe for durable/public reports.
const ( RetrievalInvalidConfiguration RetrievalFailure = "invalid_configuration" RetrievalInvalidInput RetrievalFailure = "invalid_input" RetrievalDeadline RetrievalFailure = "deadline" RetrievalInputLimit RetrievalFailure = "input_limit" RetrievalResponseLimit RetrievalFailure = "response_limit" RetrievalInvalidResponse RetrievalFailure = "invalid_response" RetrievalModelMismatch RetrievalFailure = "model_mismatch" RetrievalDimensionMismatch RetrievalFailure = "dimension_mismatch" RetrievalProjectionNotReady RetrievalFailure = "projection_not_ready" RetrievalProjectionDrift RetrievalFailure = "projection_drift" RetrievalProjectionCapacity RetrievalFailure = "projection_capacity" )
type RetrievalMode ¶ added in v0.6.0
type RetrievalMode string
RetrievalMode describes actual read behavior, not configured capabilities.
const ( RetrievalLexical RetrievalMode = "lexical" RetrievalHybrid RetrievalMode = "hybrid" RetrievalDegraded RetrievalMode = "degraded" RetrievalFailed RetrievalMode = "failed" )
type RetrievalReport ¶ added in v0.6.0
type RetrievalReport struct {
Requested RetrievalMode `json:"requested"`
Effective RetrievalMode `json:"effective"`
Reason RetrievalFailure `json:"reason,omitempty"`
ModelSpace string `json:"model_space,omitempty"`
LexicalCandidates int `json:"lexical_candidates"`
VectorCandidates int `json:"vector_candidates"`
FusedCandidates int `json:"fused_candidates"`
// ScannedChunks is the published full-scope population admitted before source
// filtering; it does not imply a repeated integrity audit of stored vectors.
ScannedChunks int `json:"scanned_chunks"`
QueryOmittedRunes int `json:"query_omitted_runes"`
IndexOmittedChunks int `json:"index_omitted_chunks"`
IndexOmittedRunes int `json:"index_omitted_runes"`
}
RetrievalReport is per-call bounded evidence. It contains no source/query text, endpoint URLs, credentials or upstream bodies. Missing legacy reports stay nil.
type RetrievalStatus ¶ added in v0.6.0
type RetrievalStatus struct {
Effective RetrievalMode `json:"effective"`
Reason RetrievalFailure `json:"reason,omitempty"`
}
RetrievalStatus is the public, safe summary of a retrieval attempt.
type SchemaDocument ¶
type SchemaDocument struct {
Scope ScopeRef `json:"scope"`
Digest string `json:"digest"`
Version string `json:"version"`
Content []byte `json:"content"`
UpdatedAt time.Time `json:"updated_at"`
}
SchemaDocument is the operator-owned workspace policy document.
type ScopeRef ¶
type ScopeRef string
ScopeRef identifies an opaque knowledge scope. Knowl does not interpret it.
type Source ¶ added in v0.3.0
type Source struct {
ID SourceID `json:"id"`
Type SourceType `json:"type"`
Enabled bool `json:"enabled"`
Config SourceConfig `json:"config"`
Sync SourceSyncPolicy `json:"sync"`
ConfigDigest string `json:"config_digest,omitempty"`
}
Source describes one configured authoritative source.
type SourceAdapterID ¶ added in v0.7.0
type SourceAdapterID string
SourceAdapterID identifies the provenance adapter that owns a configured source.
const ( // SourceAdapterFilesystem is the canonical provenance adapter for filesystem sources. SourceAdapterFilesystem SourceAdapterID = "wiki-filesystem" // SourceAdapterGit is the canonical provenance adapter for Git sources. SourceAdapterGit SourceAdapterID = "git" )
type SourceConfig ¶ added in v0.3.0
type SourceConfig struct {
Filesystem *FilesystemSourceConfig `json:"filesystem,omitempty"`
Git *GitSourceConfig `json:"git,omitempty"`
}
SourceConfig is the typed configuration union for one source.
type SourceDiagnostic ¶ added in v0.3.0
type SourceDiagnostic struct {
Code string `json:"code"`
Path string `json:"path"`
ObservedVersion string `json:"observed_version,omitempty"`
}
SourceDiagnostic reports one bounded, non-fatal source compatibility observation without exposing source content or host filesystem paths.
type SourceDocument ¶ added in v0.3.0
type SourceDocument struct {
SourceID SourceID `json:"source_id" yaml:"source_id"`
DocumentID DocumentID `json:"document_id" yaml:"document_id"`
Revision string `json:"revision" yaml:"revision"`
URI string `json:"uri" yaml:"uri"`
}
SourceDocument is the canonical provenance of one configured-source revision.
type SourceEnvelope ¶
type SourceEnvelope struct {
Scope ScopeRef `json:"scope"`
Source SourceRef `json:"source"`
Version SourceVersion `json:"version"`
MediaType string `json:"media_type"`
SourceDocument SourceDocument `json:"source_document,omitzero"`
Content []byte `json:"content"`
Provenance map[string]any `json:"provenance,omitempty"`
ReceivedAt time.Time `json:"received_at"`
}
SourceEnvelope is the bounded input accepted from a source adapter.
type SourceID ¶ added in v0.3.0
type SourceID string
SourceID identifies one configured authoritative knowledge source.
type SourceLifecycle ¶ added in v0.7.0
type SourceLifecycle struct {
Scope ScopeRef `json:"scope"`
Owner SourceOwner `json:"owner"`
State SourceLifecycleState `json:"state"`
ConfigDigest string `json:"config_digest"`
AuthorityGeneration string `json:"authority_generation"`
AuthorityEpoch uint64 `json:"authority_epoch"`
ActivatedGeneration string `json:"activated_generation"`
ActivatedEpoch uint64 `json:"activated_epoch"`
RetirementGeneration string `json:"retirement_generation,omitempty"`
RetirementEpoch uint64 `json:"retirement_epoch,omitempty"`
ScanCursor string `json:"scan_cursor,omitempty"`
ScanRoundMatches int64 `json:"scan_round_matches"`
ScanComplete bool `json:"scan_complete"`
Ready bool `json:"ready"`
ReplacementPending int `json:"replacement_pending"`
BlockerCode string `json:"blocker_code,omitempty"`
ActivatedAt time.Time `json:"activated_at"`
RetiringAt time.Time `json:"retiring_at,omitempty"`
DeletedAt time.Time `json:"deleted_at,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
SourceLifecycle is the bounded durable state of one exact source owner.
type SourceLifecycleAuthority ¶ added in v0.7.0
type SourceLifecycleAuthority struct {
Scope ScopeRef `json:"scope"`
Generation string `json:"generation,omitempty"`
Epoch uint64 `json:"epoch"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
SourceLifecycleAuthority is the current scope-wide inventory fence.
type SourceLifecycleState ¶ added in v0.7.0
type SourceLifecycleState string
SourceLifecycleState is the durable publication-authority state of one owner.
const ( SourceLifecycleActive SourceLifecycleState = "active" SourceLifecycleRetiring SourceLifecycleState = "retiring" SourceLifecycleDeleted SourceLifecycleState = "deleted" )
type SourceMaintenanceStatus ¶ added in v0.3.0
type SourceMaintenanceStatus struct {
Counts MaintenanceCounts `json:"counts"`
Samples []MaintenanceSample `json:"samples"`
Truncated bool `json:"truncated"`
}
SourceMaintenanceStatus separates raw sync reservation success from the asynchronous maintenance operation outcomes visible at read time.
type SourceMutation ¶ added in v0.3.0
type SourceMutation struct {
Action SourceMutationAction `json:"action"`
Path string `json:"path"`
ExpectedDigest string `json:"expected_digest,omitempty"`
Content []byte `json:"content,omitempty"`
}
SourceMutation is one bounded write or delete in a source namespace.
type SourceMutationAction ¶ added in v0.3.0
type SourceMutationAction string
SourceMutationAction selects one canonical source-owned filesystem action.
const ( // SourceMutationWrite replaces or creates one source-owned file. SourceMutationWrite SourceMutationAction = "write" // SourceMutationDelete removes one source-owned file while retaining recovery state. SourceMutationDelete SourceMutationAction = "delete" )
type SourceMutationPlan ¶ added in v0.3.0
type SourceMutationPlan struct {
RunID SyncRunID `json:"run_id"`
Scope ScopeRef `json:"scope"`
SourceID SourceID `json:"source_id"`
Mutations []SourceMutation `json:"mutations"`
}
SourceMutationPlan is one deterministic canonical mutation request.
type SourceOwner ¶ added in v0.7.0
type SourceOwner struct {
Adapter SourceAdapterID `json:"adapter"`
SourceID SourceID `json:"source_id"`
}
SourceOwner identifies one configured source without implying equivalence between adapters that happen to use the same SourceID.
type SourceRetirementDiscovery ¶ added in v0.7.0
type SourceRetirementDiscovery struct {
Cursor string `json:"cursor,omitempty"`
EOF bool `json:"eof"`
RoundMatches int64 `json:"round_matches"`
RemainingReferences int64 `json:"remaining_references"`
}
SourceRetirementDiscovery is the durable bounded scan position for one exact retiring owner. Cursor is opaque and never contains a public path.
type SourceRetirementOperationCounts ¶ added in v0.7.0
type SourceRetirementOperationCounts struct {
Pending int64 `json:"pending"`
Planned int64 `json:"planned"`
Applying int64 `json:"applying"`
ProjectionPending int64 `json:"projection_pending"`
Committed int64 `json:"committed"`
Failed int64 `json:"failed"`
Total int64 `json:"total"`
}
SourceRetirementOperationCounts summarizes page-scoped durable work without exposing operation payloads or retaining a complete affected-page set.
type SourceRetirementReadinessStatus ¶ added in v0.7.0
type SourceRetirementReadinessStatus struct {
Ready bool `json:"ready"`
BlockerCode string `json:"blocker_code,omitempty"`
PendingCount int `json:"pending_count"`
Pending []SourceOwner `json:"pending,omitempty"`
Truncated bool `json:"truncated"`
}
SourceRetirementReadinessStatus is the detached replacement gate state.
type SourceRetirementStatus ¶ added in v0.7.0
type SourceRetirementStatus struct {
Owner SourceOwner `json:"owner"`
State SourceLifecycleState `json:"state"`
AuthorityGeneration string `json:"authority_generation"`
AuthorityEpoch uint64 `json:"authority_epoch"`
ActivatedGeneration string `json:"activated_generation"`
ActivatedEpoch uint64 `json:"activated_epoch"`
RetirementGeneration string `json:"retirement_generation,omitempty"`
RetirementEpoch uint64 `json:"retirement_epoch,omitempty"`
Readiness SourceRetirementReadinessStatus `json:"readiness"`
Discovery SourceRetirementDiscovery `json:"discovery"`
Operations SourceRetirementOperationCounts `json:"operations"`
BlockerCode string `json:"blocker_code,omitempty"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
DiagnosticsTruncated bool `json:"diagnostics_truncated"`
ActivatedAt time.Time `json:"activated_at"`
RetiringAt time.Time `json:"retiring_at,omitzero"`
DeletedAt time.Time `json:"deleted_at,omitzero"`
UpdatedAt time.Time `json:"updated_at"`
}
SourceRetirementStatus is the typed operator view of one exact owner.
type SourceStatus ¶ added in v0.3.0
type SourceStatus struct {
Scope ScopeRef `json:"scope"`
SourceID SourceID `json:"source_id"`
Type SourceType `json:"type"`
ConfigDigest string `json:"config_digest"`
Checkpoint string `json:"checkpoint,omitempty"`
AttemptCheckpoint string `json:"attempt_checkpoint,omitempty"`
LastAttemptRunID SyncRunID `json:"last_attempt_run_id,omitempty"`
LastSuccessfulRunID SyncRunID `json:"last_successful_run_id,omitempty"`
Status SyncStatus `json:"status,omitempty"`
Counts SyncCounts `json:"counts"`
Maintenance SourceMaintenanceStatus `json:"maintenance"`
CreatedAt time.Time `json:"created_at"`
LastAttemptAt time.Time `json:"last_attempt_at,omitempty"`
LastSuccessfulAt time.Time `json:"last_successful_at,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
// RepositoryIdentity is an internal credential-free lineage binding. It is
// intentionally excluded from operator-facing status serialization.
RepositoryIdentity string `json:"-"`
}
SourceStatus is a bounded, redacted status for one configured source.
type SourceSummary ¶
type SourceSummary struct {
Source SourceRef `json:"source"`
Version SourceVersion `json:"version"`
Title string `json:"title"`
Tags []string `json:"tags,omitempty"`
Headings []string `json:"headings,omitempty"`
Body string `json:"body,omitempty"`
}
SourceSummary carries detached source signals for context selection. Built-in indexes prioritize Title, Tags, Headings, then Body under shared bounds; source identity is a fallback only when no usable terms remain. Body is a bounded prose prefix, not the complete authoritative source text.
type SourceSyncPolicy ¶ added in v0.3.0
type SourceSyncPolicy struct {
OnStart bool `json:"on_start"`
Interval time.Duration `json:"interval,omitempty"`
RetryInitial time.Duration `json:"retry_initial,omitempty"`
RetryMaximum time.Duration `json:"retry_maximum,omitempty"`
}
SourceSyncPolicy controls on-start, periodic, and bounded retry scheduling.
type SourceType ¶ added in v0.3.0
type SourceType string
SourceType selects a source adapter family.
type SourceVersion ¶
SourceVersion identifies an immutable source revision.
type StagedChange ¶
type StagedChange struct {
OperationID string `json:"operation_id"`
Digest string `json:"digest"`
Files []string `json:"files"`
CreatedAt time.Time `json:"created_at"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
Retirement *RetirementPlanContext `json:"retirement,omitempty"`
}
StagedChange identifies a plan staged for review or apply.
type StagedSourceMutation ¶ added in v0.3.0
type StagedSourceMutation struct {
RunID SyncRunID `json:"run_id"`
Scope ScopeRef `json:"scope"`
SourceID SourceID `json:"source_id"`
Generation string `json:"generation"`
Files []string `json:"files"`
CreatedAt time.Time `json:"created_at"`
}
StagedSourceMutation identifies one verified source-owned staged artifact.
type SyncCounts ¶ added in v0.3.0
type SyncCounts struct {
Added int64 `json:"added"`
Updated int64 `json:"updated"`
Unchanged int64 `json:"unchanged"`
Deleted int64 `json:"deleted"`
Failed int64 `json:"failed"`
}
SyncCounts summarizes reconciliation outcomes for one run.
type SyncRun ¶ added in v0.3.0
type SyncRun struct {
ID SyncRunID `json:"id"`
Scope ScopeRef `json:"scope"`
SourceID SourceID `json:"source_id"`
ConfigDigest string `json:"config_digest"`
Status SyncStatus `json:"status"`
Cursor string `json:"cursor,omitempty"`
NextPageToken string `json:"next_page_token,omitempty"`
CompleteScan bool `json:"complete_scan"`
Counts SyncCounts `json:"counts"`
FailureClass string `json:"failure_class,omitempty"`
ContentGeneration string `json:"content_generation,omitempty"`
Checkpoint string `json:"checkpoint,omitempty"`
StartedAt time.Time `json:"started_at"`
UpdatedAt time.Time `json:"updated_at"`
CompletedAt time.Time `json:"completed_at,omitempty"`
}
SyncRun is the redacted durable read model for one synchronization attempt.
type SyncRunID ¶ added in v0.3.0
type SyncRunID string
SyncRunID identifies one durable source synchronization attempt.
type SyncStatus ¶ added in v0.3.0
type SyncStatus string
SyncStatus is the durable lifecycle status of one synchronization run.
const ( SyncStatusScanning SyncStatus = "scanning" SyncStatusPrepared SyncStatus = "prepared" SyncStatusContentCommitted SyncStatus = "content_committed" SyncStatusProjected SyncStatus = "projected" SyncStatusSucceeded SyncStatus = "succeeded" SyncStatusFailed SyncStatus = "failed" )
type ValidatedEditPlan ¶
type ValidatedEditPlan struct {
OperationID string `json:"operation_id"`
Scope ScopeRef `json:"scope"`
SchemaDigest string `json:"schema_digest"`
RequiredSourceRef string `json:"required_source_ref,omitempty"`
SourceRefs []string `json:"source_refs"`
Edits []FileEdit `json:"edits"`
Diagnostics []MaintenanceDiagnostic `json:"diagnostics,omitempty"`
Retirement *RetirementPlanContext `json:"retirement,omitempty"`
}
ValidatedEditPlan is an application-validated model plan ready to stage.
type ValidatedHierarchyPlan ¶ added in v0.4.0
type ValidatedHierarchyPlan struct {
Scope ScopeRef `json:"scope"`
SchemaDigest string `json:"schema_digest"`
SnapshotDigest string `json:"snapshot_digest"`
Catalogs []HierarchyCatalogSpec `json:"catalogs"`
Mutations []HierarchyMutation `json:"mutations"`
}
ValidatedHierarchyPlan is a normalized semantic graph plus deterministic catalog-only mutations ready for a hierarchy content adapter.
type VectorProjectionState ¶ added in v0.6.0
type VectorProjectionState string
VectorProjectionState describes a check during the original attempt.
const ( VectorNotChecked VectorProjectionState = "not_checked" VectorReady VectorProjectionState = "ready" VectorInvalid VectorProjectionState = "invalid" )
type VectorProjectionStatus ¶ added in v0.6.0
type VectorProjectionStatus struct {
State VectorProjectionState `json:"state"`
Reason RetrievalFailure `json:"reason,omitempty"`
}
VectorProjectionStatus never describes current readiness of an old operation.
type WorkClaim ¶
type WorkClaim struct {
Operation Operation `json:"operation"`
Descriptor ExecutionDescriptor `json:"descriptor"`
Lease WorkLease `json:"lease"`
}
WorkClaim combines an exclusively claimed operation with its durable inputs.
type WorkKind ¶ added in v0.4.0
type WorkKind string
WorkKind distinguishes durable operation execution paths.
type WorkLease ¶
WorkLease grants temporary ownership of application-level operation work. It is separate from Lease, which fences canonical content application.
type WorkspaceInspection ¶
type WorkspaceInspection struct {
Scope ScopeRef `json:"scope"`
Snapshot WorkspaceSnapshot `json:"snapshot"`
Index PageSnapshot `json:"index"`
Catalogs []PageSnapshot `json:"catalogs,omitempty"`
Log PageSnapshot `json:"log"`
RawSources []RawSourceRecord `json:"raw_sources"`
}
WorkspaceInspection combines canonical projections needed by deterministic lint.
type WorkspaceSnapshot ¶
type WorkspaceSnapshot struct {
Scope ScopeRef `json:"scope"`
SchemaDigest string `json:"schema_digest"`
PageDigests map[string]string `json:"page_digests"`
Pages []PageSnapshot `json:"pages"`
Links []LinkReference `json:"links"`
CapturedAt time.Time `json:"captured_at"`
}
WorkspaceSnapshot identifies canonical content used to build projections.