Documentation
¶
Index ¶
- Constants
- Variables
- func NewEmbedHandler(memStore *memory.Store, model string, logger func(string, ...any)) queue.Handler
- type CanonicalReference
- type Config
- type ItemMetadata
- type ItemReadResult
- type ItemRecallResult
- type ItemTouchResult
- type Option
- type PagedItemRecall
- type PromotionApply
- type PromotionApplyReceipt
- type PromotionApproval
- type PromotionApprovalReceipt
- type PromotionRequest
- type PromotionRequestReceipt
- type PromotionTarget
- type PromotionTargetReference
- type ReferenceKind
- type ReferenceResolution
- type ReferenceResolutionStatus
- type ReferenceSelector
- type SearchOptions
- type Tesseract
- func (c *Tesseract) ApplyWorkspacePromotion(ctx context.Context, in WorkspacePromotionApply) (WorkspacePromotionApplyReceipt, error)
- func (c *Tesseract) ApplyWorkspaceRetention(ctx context.Context, in workspace.RetentionApplyInput) (workspace.RetentionApplyReport, error)
- func (c *Tesseract) ApproveWorkspacePromotion(ctx context.Context, in WorkspacePromotionApproval) (WorkspacePromotionApprovalReceipt, error)
- func (c *Tesseract) Close() error
- func (c *Tesseract) CreateWorkspaceItem(ctx context.Context, in workspace.CreateRequest) (workspace.MutationReceipt, error)
- func (c *Tesseract) DeleteWorkspaceItem(ctx context.Context, in workspace.DeleteInput) (workspace.DeleteReceipt, error)
- func (c *Tesseract) EditWorkspaceItem(ctx context.Context, in workspace.EditInput) (workspace.MutationReceipt, error)
- func (c *Tesseract) Embed(ctx context.Context, recordID string) error
- func (c *Tesseract) EmbedRevision(ctx context.Context, revisionID string) error
- func (c *Tesseract) GetCurrentItem(ctx context.Context, itemID string) (memory.Revision, error)
- func (c *Tesseract) GetCurrentRevision(ctx context.Context, namespace, key string) (memory.Revision, error)
- func (c *Tesseract) GetItemHistory(ctx context.Context, itemID string) ([]memory.Revision, error)
- func (c *Tesseract) GetRevisionHistory(ctx context.Context, namespace, key string) ([]memory.Revision, error)
- func (c *Tesseract) MemoryStore() *memory.Store
- func (c *Tesseract) ReadItem(ctx context.Context, itemID string) (ItemReadResult, error)
- func (c *Tesseract) ReadWorkspaceCurrent(ctx context.Context, namespace, key string) (WorkspaceItem, error)
- func (c *Tesseract) RecallItems(ctx context.Context, in memory.RecallInput, page memory.PageRequest) (PagedItemRecall, error)
- func (c *Tesseract) RecallMemory(ctx context.Context, in memory.RecallInput) ([]memory.RecallResult, error)
- func (c *Tesseract) ReportWorkspaceRetention(ctx context.Context, in workspace.RetentionReportInput) (workspace.RetentionReport, error)
- func (c *Tesseract) RequestWorkspacePromotion(ctx context.Context, in WorkspacePromotionRequest) (WorkspacePromotionRequestReceipt, error)
- func (c *Tesseract) ResolveReference(ctx context.Context, selector ReferenceSelector) (ReferenceResolution, error)
- func (c *Tesseract) Search(ctx context.Context, query string, opts SearchOptions) ([]embedding.SearchResult, error)
- func (c *Tesseract) Store() *contextstore.Store
- func (c *Tesseract) TouchItems(ctx context.Context, itemIDs []string) (ItemTouchResult, error)
- func (c *Tesseract) WorkspaceStore() *workspace.Store
- func (c *Tesseract) WriteMemory(ctx context.Context, in memory.WriteInput) (memory.Revision, error)
- type WorkspaceItem
- type WorkspacePromotionApply
- type WorkspacePromotionApplyReceipt
- type WorkspacePromotionApproval
- type WorkspacePromotionApprovalReceipt
- type WorkspacePromotionRequest
- type WorkspacePromotionRequestReceipt
- type WorkspacePromotionTarget
- type WorkspacePromotionTargetReference
Constants ¶
const ( ReferenceResolved = itemservice.ResolutionResolved ReferenceDeleted = itemservice.ResolutionDeleted ReferenceNotFound = itemservice.ResolutionNotFound ReferenceAmbiguous = itemservice.ResolutionAmbiguous ReferenceUnsupported = itemservice.ResolutionUnsupportedReference ReferenceKindItem = itemservice.ReferenceKindItem ReferenceKindRevision = itemservice.ReferenceKindRevision )
Variables ¶
var ( ErrWorkspacePromotionInvalidInput = promotion.ErrInvalidInput ErrWorkspacePromotionNotFound = promotion.ErrNotFound ErrWorkspacePromotionSourceNotFound = promotion.ErrSourceNotFound ErrWorkspacePromotionSourceDeleted = promotion.ErrSourceDeleted ErrWorkspacePromotionSourceStale = promotion.ErrSourceStale ErrWorkspacePromotionTargetStale = promotion.ErrTargetStale ErrWorkspacePromotionTargetKeyOccupied = promotion.ErrTargetKeyOccupied ErrWorkspacePromotionNotApproved = promotion.ErrNotApproved )
ErrEmbedderUnavailable is returned when an embedding operation is attempted but no embedder has been configured on the Tesseract instance. It is the same sentinel exposed by memory.ErrEmbedderUnavailable.
var ErrInvalidReference = itemservice.ErrInvalidReference
ErrItemHistoryUnavailable reports that a mutable item retains no revisions.
Functions ¶
func NewEmbedHandler ¶
func NewEmbedHandler(memStore *memory.Store, model string, logger func(string, ...any)) queue.Handler
NewEmbedHandler returns a queue.Handler that processes embed jobs. The handler decodes the revision ID from the job payload and calls EmbedRevision on the memory store to generate and persist the embedding.
Types ¶
type CanonicalReference ¶ added in v0.11.0
type CanonicalReference = itemservice.CanonicalReference
type Config ¶
type Config struct {
// RootDir is the base directory of the tesseract data layout. When DBPath
// and RecordsDir are empty, the main database and JSON record tree are
// derived under RootDir/data/ — the layout embedded consumers (nanite,
// tesseract lib v0.7.0) rely on. RootDir is always required.
RootDir string
// DBPath, when set, is the explicit path to the main context database,
// overriding the RootDir/data/index/context.db derivation.
//
// RecordsDir, when set, is the explicit JSON record tree, overriding
// RootDir/data/records.
//
// These let a go-apppaths-resolved caller (cmd/tesseract, cmd/smoke) point
// the library at the XDG layout without changing default behavior for
// RootDir-only consumers. Added for the go-apppaths migration
// (CW-20260517-0066).
DBPath string
RecordsDir string
}
Config holds the top-level configuration for a Tesseract instance.
type ItemMetadata ¶ added in v0.11.0
type ItemMetadata = itemservice.Metadata
ItemMetadata identifies an item's domain and authorization namespace without content.
type ItemReadResult ¶ added in v0.11.0
type ItemReadResult = itemservice.ReadResult
ItemReadResult contains exactly one current revision or workspace item.
type ItemRecallResult ¶ added in v0.11.0
type ItemRecallResult = itemservice.RecallResult
ItemRecallResult contains exactly one typed revision or workspace result.
type ItemTouchResult ¶ added in v0.11.0
type ItemTouchResult = itemservice.TouchResult
ItemTouchResult reports item identities that moved or could not be reinforced.
type Option ¶
type Option func(*options)
Option is a functional option for Open.
func WithDedupThreshold ¶
WithDedupThreshold sets the similarity threshold for semantic dedup.
func WithEmbedder ¶
func WithEmbedder(e embedcontracts.Embedder) Option
WithEmbedder sets the embedding provider used for vector indexing.
func WithEmbeddingModel ¶
WithEmbeddingModel sets the model name passed to the embedder.
func WithLogger ¶
WithLogger sets a custom log function (defaults to log.Printf).
type PagedItemRecall ¶ added in v0.11.0
type PagedItemRecall = itemservice.PagedRecall
PagedItemRecall is a projected typed recall page and its manifest.
type PromotionApply ¶ added in v0.11.0
type PromotionApply = promotion.ApplyInput
type PromotionApplyReceipt ¶ added in v0.11.0
type PromotionApplyReceipt = promotion.ApplyReceipt
type PromotionApproval ¶ added in v0.11.0
type PromotionApproval = promotion.ApproveInput
type PromotionApprovalReceipt ¶ added in v0.11.0
type PromotionApprovalReceipt = promotion.ApprovalReceipt
type PromotionRequest ¶ added in v0.11.0
type PromotionRequest = promotion.RequestInput
type PromotionRequestReceipt ¶ added in v0.11.0
type PromotionRequestReceipt = promotion.RequestReceipt
type PromotionTarget ¶ added in v0.11.0
PromotionTarget aliases promotion.Target for cross-domain promotions.
type PromotionTargetReference ¶ added in v0.11.0
type PromotionTargetReference = promotion.TargetReference
type ReferenceKind ¶ added in v0.11.0
type ReferenceKind = itemservice.ReferenceKind
type ReferenceResolution ¶ added in v0.11.0
type ReferenceResolution = itemservice.ReferenceResolution
ReferenceResolution is the identity-only normalization result.
type ReferenceResolutionStatus ¶ added in v0.11.0
type ReferenceResolutionStatus = itemservice.ResolutionStatus
type ReferenceSelector ¶ added in v0.11.0
type ReferenceSelector = itemservice.ReferenceSelector
ReferenceSelector accepts one typed object ID, one complete legacy key, or one canonical Tesseract URI.
type SearchOptions ¶
SearchOptions controls the behavior of a Search call.
type Tesseract ¶ added in v0.8.0
type Tesseract struct {
// contains filtered or unexported fields
}
Tesseract is the top-level library handle. Create one via Open().
func Open ¶
Open creates a Tesseract instance rooted at cfg.RootDir, initializing the SQLite store, memory subsystem, and decay goroutine.
func (*Tesseract) ApplyWorkspacePromotion ¶ added in v0.11.0
func (c *Tesseract) ApplyWorkspacePromotion(ctx context.Context, in WorkspacePromotionApply) (WorkspacePromotionApplyReceipt, error)
func (*Tesseract) ApplyWorkspaceRetention ¶ added in v0.11.0
func (c *Tesseract) ApplyWorkspaceRetention(ctx context.Context, in workspace.RetentionApplyInput) (workspace.RetentionApplyReport, error)
ApplyWorkspaceRetention transactionally rechecks and purges named items.
func (*Tesseract) ApproveWorkspacePromotion ¶ added in v0.11.0
func (c *Tesseract) ApproveWorkspacePromotion(ctx context.Context, in WorkspacePromotionApproval) (WorkspacePromotionApprovalReceipt, error)
func (*Tesseract) Close ¶ added in v0.8.0
Close stops the decay goroutine and closes the underlying store.
func (*Tesseract) CreateWorkspaceItem ¶ added in v0.11.0
func (c *Tesseract) CreateWorkspaceItem(ctx context.Context, in workspace.CreateRequest) (workspace.MutationReceipt, error)
func (*Tesseract) DeleteWorkspaceItem ¶ added in v0.11.0
func (c *Tesseract) DeleteWorkspaceItem(ctx context.Context, in workspace.DeleteInput) (workspace.DeleteReceipt, error)
func (*Tesseract) EditWorkspaceItem ¶ added in v0.11.0
func (*Tesseract) Embed ¶ added in v0.8.0
Embed generates and stores a vector embedding for the record identified by recordID. It fetches the record from the store, extracts embeddable text, calls the configured embedder, and upserts the resulting vector.
func (*Tesseract) EmbedRevision ¶ added in v0.8.0
EmbedRevision generates and stores an embedding for a memory revision.
func (*Tesseract) GetCurrentItem ¶ added in v0.11.0
GetCurrentItem returns an item's current revision by stable item_id.
func (*Tesseract) GetCurrentRevision ¶ added in v0.8.0
func (c *Tesseract) GetCurrentRevision(ctx context.Context, namespace, key string) (memory.Revision, error)
GetCurrentRevision returns the current revision for a namespace/key pair.
func (*Tesseract) GetItemHistory ¶ added in v0.11.0
GetItemHistory returns an item's immutable revisions by stable item_id, newest first.
func (*Tesseract) GetRevisionHistory ¶ added in v0.8.0
func (c *Tesseract) GetRevisionHistory(ctx context.Context, namespace, key string) ([]memory.Revision, error)
GetRevisionHistory returns all revisions for a namespace/key pair, newest first.
func (*Tesseract) MemoryStore ¶ added in v0.8.0
MemoryStore returns the underlying memory.Store.
func (*Tesseract) ReadWorkspaceCurrent ¶ added in v0.11.0
func (*Tesseract) RecallItems ¶ added in v0.11.0
func (c *Tesseract) RecallItems(ctx context.Context, in memory.RecallInput, page memory.PageRequest) (PagedItemRecall, error)
func (*Tesseract) RecallMemory ¶ added in v0.8.0
func (c *Tesseract) RecallMemory(ctx context.Context, in memory.RecallInput) ([]memory.RecallResult, error)
RecallMemory retrieves memories by namespace, ranking, and filters.
func (*Tesseract) ReportWorkspaceRetention ¶ added in v0.11.0
func (c *Tesseract) ReportWorkspaceRetention(ctx context.Context, in workspace.RetentionReportInput) (workspace.RetentionReport, error)
ReportWorkspaceRetention evaluates a stable page without reading payloads or recording use.
func (*Tesseract) RequestWorkspacePromotion ¶ added in v0.11.0
func (c *Tesseract) RequestWorkspacePromotion(ctx context.Context, in WorkspacePromotionRequest) (WorkspacePromotionRequestReceipt, error)
func (*Tesseract) ResolveReference ¶ added in v0.11.0
func (c *Tesseract) ResolveReference(ctx context.Context, selector ReferenceSelector) (ReferenceResolution, error)
ResolveReference normalizes a supported reference without reading content, reinforcing access, or changing stored state.
func (*Tesseract) Search ¶ added in v0.8.0
func (c *Tesseract) Search(ctx context.Context, query string, opts SearchOptions) ([]embedding.SearchResult, error)
Search embeds the query string and returns the top matching records ranked by cosine similarity against all stored embeddings for the configured model.
func (*Tesseract) Store ¶ added in v0.8.0
func (c *Tesseract) Store() *contextstore.Store
Store returns the underlying contextstore.Store.
func (*Tesseract) TouchItems ¶ added in v0.11.0
func (*Tesseract) WorkspaceStore ¶ added in v0.11.0
WorkspaceStore returns the mutable workspace store.
func (*Tesseract) WriteMemory ¶ added in v0.8.0
WriteMemory writes a new memory revision.
type WorkspaceItem ¶ added in v0.11.0
type WorkspaceItem = itemservice.WorkspaceItem
WorkspaceItem is the public current workspace response shape.
type WorkspacePromotionApply ¶ added in v0.11.0
type WorkspacePromotionApply = promotion.ApplyInput
type WorkspacePromotionApplyReceipt ¶ added in v0.11.0
type WorkspacePromotionApplyReceipt = promotion.ApplyReceipt
type WorkspacePromotionApproval ¶ added in v0.11.0
type WorkspacePromotionApproval = promotion.ApproveInput
type WorkspacePromotionApprovalReceipt ¶ added in v0.11.0
type WorkspacePromotionApprovalReceipt = promotion.ApprovalReceipt
type WorkspacePromotionRequest ¶ added in v0.11.0
type WorkspacePromotionRequest = promotion.RequestInput
type WorkspacePromotionRequestReceipt ¶ added in v0.11.0
type WorkspacePromotionRequestReceipt = promotion.RequestReceipt
type WorkspacePromotionTarget ¶ added in v0.11.0
type WorkspacePromotionTargetReference ¶ added in v0.11.0
type WorkspacePromotionTargetReference = promotion.TargetReference
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
smoke
command
|
|
|
tesseract
command
|
|
|
Package domains defines the in-tree domain discriminator for Tesseract revisions.
|
Package domains defines the in-tree domain discriminator for Tesseract revisions. |
|
examples
|
|
|
adoption-go
command
Command adoption-go is the compile-checked external-consumer example used by docs/guides/tesseract-adoption-and-v0.9-migration.md.
|
Command adoption-go is the compile-checked external-consumer example used by docs/guides/tesseract-adoption-and-v0.9-migration.md. |
|
internal
|
|
|
authn
Package authn wires the shared go-auth guard into Tesseract: it resolves the mode, builds the verifiers (the managed token store, the legacy static token, and the Tether JWT/JWKS verifier), translates a verified principal into the claims Tesseract's handlers check, and keeps the would-deny summary that finds callers still sending no bearer.
|
Package authn wires the shared go-auth guard into Tesseract: it resolves the mode, builds the verifiers (the managed token store, the legacy static token, and the Tether JWT/JWKS verifier), translates a verified principal into the claims Tesseract's handlers check, and keeps the would-deny summary that finds callers still sending no bearer. |
|
authscope
Package authscope is the vocabulary that joins Tesseract's per-token capability scopes to the shared go-auth scope names (tesseract.<verb>).
|
Package authscope is the vocabulary that joins Tesseract's per-token capability scopes to the shared go-auth scope names (tesseract.<verb>). |
|
contextapi
Package contextapi — synthesis handler.
|
Package contextapi — synthesis handler. |
|
contextstore
Package contextstore — audit event type identifiers.
|
Package contextstore — audit event type identifiers. |
|
credentials
Package credentials is Tesseract's only seam to go-secrets.
|
Package credentials is Tesseract's only seam to go-secrets. |
|
credentials/credtest
Package credtest gives other packages' tests a real go-secrets resolver backed by a throwaway file store, so they never import go-secrets themselves (internal/credentials stays Tesseract's only seam to it).
|
Package credtest gives other packages' tests a real go-secrets resolver backed by a throwaway file store, so they never import go-secrets themselves (internal/credentials stays Tesseract's only seam to it). |
|
event
Package event implements the Event domain on top of the shared memory revision store.
|
Package event implements the Event domain on top of the shared memory revision store. |
|
fsperm
Package fsperm holds Tesseract's on-disk permission policy and the helpers that enforce it.
|
Package fsperm holds Tesseract's on-disk permission policy and the helpers that enforce it. |
|
itemservice
Package itemservice joins Tesseract's revisioned and mutable item stores at the public object boundary.
|
Package itemservice joins Tesseract's revisioned and mutable item stores at the public object boundary. |
|
knowledge
Package knowledge implements the Knowledge domain on top of the shared memory revision store.
|
Package knowledge implements the Knowledge domain on top of the shared memory revision store. |
|
llm/anthropic
Package anthropic is a thin SDK-backed wrapper that satisfies the Complete/Capabilities portion of llmcontracts.Provider for tesseract's synthesis path (POST /v1/synthesis/ask).
|
Package anthropic is a thin SDK-backed wrapper that satisfies the Complete/Capabilities portion of llmcontracts.Provider for tesseract's synthesis path (POST /v1/synthesis/ask). |
|
llm/openai
Package openai is a thin SDK-backed wrapper that satisfies embedcontracts.Embedder and the Complete/Capabilities portion of llmcontracts.Provider for tesseract's embedding + synthesis paths.
|
Package openai is a thin SDK-backed wrapper that satisfies embedcontracts.Embedder and the Complete/Capabilities portion of llmcontracts.Provider for tesseract's embedding + synthesis paths. |
|
mcpadapter/skills
Package skills embeds agent-facing markdown skills that document Tesseract primitives and features.
|
Package skills embeds agent-facing markdown skills that document Tesseract primitives and features. |
|
memory
Package memory — audit sink definition.
|
Package memory — audit sink definition. |
|
memorylinks
Package memorylinks owns the memory_links edge table: its schema, its relation vocabulary, and the resolution rule that turns a written `[[key]]` into the entry it points at.
|
Package memorylinks owns the memory_links edge table: its schema, its relation vocabulary, and the resolution rule that turns a written `[[key]]` into the entry it points at. |
|
memorytime
Package memorytime owns the sortable timestamp encoding used by the memory subsystem's SQLite tables.
|
Package memorytime owns the sortable timestamp encoding used by the memory subsystem's SQLite tables. |
|
nsglob
Package nsglob is the one place a token's namespace_globs are matched against namespaces.
|
Package nsglob is the one place a token's namespace_globs are matched against namespaces. |
|
runtimeimage
Package runtimeimage verifies executable identity without managing processes.
|
Package runtimeimage verifies executable identity without managing processes. |
|
sqlitedsn
Package sqlitedsn centralizes SQLite connection-string construction.
|
Package sqlitedsn centralizes SQLite connection-string construction. |
|
surfacefields
Package surfacefields declares how each fact a caller supplies is spelled and placed on every surface that accepts it.
|
Package surfacefields declares how each fact a caller supplies is spelled and placed on every surface that accepts it. |
|
typeregistry
Package typeregistry is the one place Tesseract declares its type vocabularies, for every domain.
|
Package typeregistry is the one place Tesseract declares its type vocabularies, for every domain. |
|
webui
Package webui serves the embedded Tesseract frontend as an SPA.
|
Package webui serves the embedded Tesseract frontend as an SPA. |
|
wikilink
Package wikilink extracts `[[target]]` and `[[target|label]]` references from the markdown bodies Tesseract already stores.
|
Package wikilink extracts `[[target]]` and `[[target|label]]` references from the markdown bodies Tesseract already stores. |
|
workspace
Package workspace stores Tesseract's mutable working artifacts.
|
Package workspace stores Tesseract's mutable working artifacts. |
|
Package memory re-exports the Tesseract memory subsystem types for use by external consumers.
|
Package memory re-exports the Tesseract memory subsystem types for use by external consumers. |
|
Package workspace exposes Tesseract's mutable workspace types to external Go consumers.
|
Package workspace exposes Tesseract's mutable workspace types to external Go consumers. |