knowl

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package knowl contains the public, transport-neutral Knowl domain contracts.

Index

Constants

This section is empty.

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"`
	ManifestRef string        `json:"manifest_ref"`
}

AcceptedSource describes an immutable source version stored in the workspace.

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"`
}

ContentCommit describes a canonical workspace commit.

type ExecutionDescriptor

type ExecutionDescriptor struct {
	OperationID OperationID    `json:"operation_id"`
	Source      AcceptedSource `json:"source"`
	Schema      SchemaDocument `json:"schema"`
}

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"`
	OperationID string `json:"operation_id"`
}

Failure is a stable, redacted operation failure.

type FileEdit

type FileEdit struct {
	Path           string `json:"path"`
	ExpectedDigest string `json:"expected_digest,omitempty"`
	Content        []byte `json:"content"`
}

FileEdit is one validated canonical workspace file replacement.

type Lease

type Lease struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

Lease prevents duplicate worker completion.

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 MaintenanceInput

type MaintenanceInput struct {
	Scope      ScopeRef       `json:"scope"`
	Schema     SchemaDocument `json:"schema"`
	Source     AcceptedSource `json:"source"`
	SourceText string         `json:"source_text"`
	Pages      []PageSnapshot `json:"pages"`
	Limits     ReadLimits     `json:"limits"`
}

MaintenanceInput is the bounded data supplied to a maintainer provider.

type ModelEditPlan

type ModelEditPlan struct {
	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.

type Operation

type Operation struct {
	ID        OperationID     `json:"id"`
	Key       OperationKey    `json:"key"`
	Status    OperationStatus `json:"status"`
	Attempt   int             `json:"attempt"`
	Failure   *Failure        `json:"failure,omitempty"`
	UpdatedAt time.Time       `json:"updated_at"`
}

Operation is a redacted operation read model.

type OperationID

type OperationID string

OperationID identifies an ingest or filing operation.

type OperationKey

type OperationKey struct {
	Scope   ScopeRef      `json:"scope"`
	Source  SourceRef     `json:"source"`
	Version SourceVersion `json:"version"`
}

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"`
	CreatedAt      time.Time      `json:"created_at"`
}

OperationMeta contains the bounded internal inputs persisted at reservation.

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 PageID

type PageID string

PageID is a stable wiki page identifier.

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"`
	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"`
	SourceRefs []string  `json:"source_refs,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"`
}

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 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 SourceEnvelope

type SourceEnvelope struct {
	Scope      ScopeRef       `json:"scope"`
	Source     SourceRef      `json:"source"`
	Version    SourceVersion  `json:"version"`
	MediaType  string         `json:"media_type"`
	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 SourceRef

type SourceRef struct {
	Adapter string `json:"adapter"`
	ID      string `json:"id"`
}

SourceRef identifies a source adapter and a stable source identity.

type SourceSummary

type SourceSummary struct {
	Source  SourceRef     `json:"source"`
	Version SourceVersion `json:"version"`
	Title   string        `json:"title"`
}

SourceSummary is bounded source context for a maintainer or index.

type SourceVersion

type SourceVersion struct {
	Version string `json:"version"`
	Digest  string `json:"digest"`
}

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"`
}

StagedChange identifies a plan staged for review or apply.

type ValidatedEditPlan

type ValidatedEditPlan struct {
	OperationID  string     `json:"operation_id"`
	Scope        ScopeRef   `json:"scope"`
	SchemaDigest string     `json:"schema_digest"`
	SourceRefs   []string   `json:"source_refs"`
	Edits        []FileEdit `json:"edits"`
}

ValidatedEditPlan is an application-validated model plan ready to stage.

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 WorkLease

type WorkLease struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

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"`
	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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL