semanticreadiness

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxDirtyParents       = 500
	MaxNotReadyChunks     = 2_500
	MaxDirtyAge           = 30 * time.Minute
	ReadyL0Target         = 5_000
	CatchUpL0Limit        = 10_000
	DefaultExactMaxChunks = 25_000
)

Variables

This section is empty.

Functions

func EffectiveExactMaxChunks

func EffectiveExactMaxChunks(configured int) int

EffectiveExactMaxChunks applies the measured foundation safety ceiling. The configured value may reduce exact-search admission, but it cannot expand the maximum corpus that the runtime will scan without a validated ANN root.

func EstimateDirtyParentStream

func EstimateDirtyParentStream(ctx context.Context, limit int, next func() (DirtyParent, bool, error)) (int, error)

EstimateDirtyParentStream loads and plans one parent at a time. It stops calling next as soon as the over-budget sentinel is known, so a fresh corpus does not materialize every dirty parent merely to decide admission.

func EstimateDirtyParents

func EstimateDirtyParents(ctx context.Context, parents []DirtyParent, limit int) (int, error)

EstimateDirtyParents performs exact v3 occurrence planning but stops at the first value beyond limit. Returning limit+1 is a stable over-budget sentinel.

Types

type Decision

type Decision struct {
	State      State  `json:"state"`
	Reason     string `json:"reason"`
	Searchable bool   `json:"searchable"`
}

func Evaluate

func Evaluate(s Snapshot) Decision

type DirtyParent

type DirtyParent struct {
	Parent                retrievalchunk.Parent `json:"-"`
	LastCurrentChunkCount int                   `json:"last_current_chunk_count"`
}

type Snapshot

type Snapshot struct {
	Configured    bool   `json:"configured"`
	Enabled       bool   `json:"enabled"`
	Available     bool   `json:"available"`
	PlanningError string `json:"planning_error,omitempty"`
	// AggregateCountersCorrupt is set when an authoritative maintenance scan
	// disproves the transactionally maintained runtime counters, or when the
	// runtime path observes a structurally impossible counter combination.
	AggregateCountersCorrupt bool   `json:"aggregate_counters_corrupt,omitempty"`
	ProfileID                string `json:"profile_id"`

	ProfileExists           bool      `json:"profile_exists"`
	ProfileProvenanceValid  bool      `json:"profile_provenance_valid"`
	ExpectedParents         int       `json:"expected_parents"`
	CurrentParents          int       `json:"current_parents"`
	EmptyParents            int       `json:"empty_parents"`
	PendingParents          int       `json:"pending_parents"`
	BlockedParents          int       `json:"blocked_parents"`
	ErrorParents            int       `json:"error_parents"`
	DirtyParents            int       `json:"dirty_parents"`
	EstimatedNotReadyChunks int       `json:"estimated_not_ready_chunks"`
	OldestDirtyAt           time.Time `json:"oldest_dirty_at,omitempty"`

	ChunkableParents       int `json:"chunkable_parents"`
	ParentsWithReadyChunk  int `json:"parents_with_ready_chunk"`
	ChunkCount             int `json:"chunk_count"`
	ReadyEmbeddings        int `json:"ready_embeddings"`
	PendingEmbeddings      int `json:"pending_embeddings"`
	BlockedEmbeddings      int `json:"blocked_embeddings"`
	ErrorEmbeddings        int `json:"error_embeddings"`
	DueRetries             int `json:"due_retries"`
	ScheduledRetries       int `json:"scheduled_retries"`
	UnclassifiedErrors     int `json:"unclassified_errors"`
	CorruptEmbeddings      int `json:"corrupt_embeddings"`
	RevisionZeroEmbeddings int `json:"revision_zero_embeddings"`

	GlobalPurgeEpoch                     int64     `json:"global_purge_epoch"`
	ProfilePurgeEpoch                    int64     `json:"profile_purge_epoch"`
	LatestRevision                       int64     `json:"latest_revision"`
	ObservedLatestRevision               int64     `json:"observed_latest_revision"`
	L0ReadyCount                         int       `json:"l0_ready_count"`
	ObservedL0ReadyCount                 int       `json:"observed_l0_ready_count"`
	ActiveIndexedCount                   int       `json:"active_indexed_count"`
	ActiveTombstones                     int       `json:"active_tombstones"`
	ActiveSegmentCount                   int       `json:"active_segment_count"`
	ActiveGenerationID                   string    `json:"active_generation_id"`
	ActiveGenerationValid                bool      `json:"active_generation_valid"`
	ActiveSnapshotRevision               int64     `json:"active_snapshot_revision"`
	ActiveGenerationBackend              string    `json:"active_generation_backend,omitempty"`
	ActiveGenerationBackendVersion       string    `json:"active_generation_backend_version,omitempty"`
	ActiveGenerationDistanceMetric       string    `json:"active_generation_distance_metric,omitempty"`
	ActiveGenerationDimensions           int       `json:"active_generation_dimensions,omitempty"`
	ActiveGenerationRootDescriptorSHA256 string    `json:"active_generation_root_descriptor_sha256,omitempty"`
	ActiveGenerationProblem              string    `json:"active_generation_problem,omitempty"`
	BuildingGenerations                  int       `json:"building_generations"`
	StaleGenerations                     int       `json:"stale_generations"`
	ErrorGenerations                     int       `json:"error_generations"`
	ExactMaxChunks                       int       `json:"exact_max_chunks"`
	Now                                  time.Time `json:"-"`
}

Snapshot is a complete, immutable view of readiness facts. Configuration flags are supplied by the caller; every storage fact is read by Store from one SQLite read transaction.

type State

type State string
const (
	StateNotConfigured   State = "not_configured"
	StateDisabled        State = "disabled"
	StateNeedsProjection State = "needs_projection"
	StateNeedsEmbeddings State = "needs_embeddings"
	StateRetryScheduled  State = "retry_scheduled"
	StateNeedsIndex      State = "needs_index"
	StateBuilding        State = "building"
	StateCatchingUp      State = "catching_up"
	StateDegradedBlocked State = "degraded_blocked"
	StateStale           State = "stale"
	StateCorrupt         State = "corrupt"
	StateReady           State = "ready"
	StateUnavailable     State = "unavailable"
)

Jump to

Keyboard shortcuts

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