Documentation
¶
Overview ¶
Package local provides filesystem and in-memory implementations of the application package's infrastructure ports for local SDD deployments.
Index ¶
- type FilesystemGraphStore
- func (s *FilesystemGraphStore) Apply(ctx context.Context, expectedRevision string, batch app.MutationBatch, ...) (app.ApplyResult, error)
- func (s *FilesystemGraphStore) Current(ctx context.Context) (*app.Snapshot, error)
- func (s *FilesystemGraphStore) ReadAttachmentPage(_ context.Context, entryID, filename string, offset int64, maxBytes int) (app.AttachmentPage, error)
- func (s *FilesystemGraphStore) Reconcile(_ context.Context, mutationID, batchDigest string) (app.ApplyResult, error)
- type FilesystemGraphStoreOptions
- type FilesystemLegacySessionMigrator
- type FilesystemSessionStore
- func (s *FilesystemSessionStore) Append(_ context.Context, id app.SessionID, expectedVersion uint64, ...) (uint64, error)
- func (s *FilesystemSessionStore) Create(_ context.Context, metadata app.SessionMetadata) (app.StoredSession, error)
- func (s *FilesystemSessionStore) List(_ context.Context, filter app.SessionFilter) ([]app.StoredSession, error)
- func (s *FilesystemSessionStore) Load(_ context.Context, id app.SessionID) (app.StoredSession, error)
- type FilesystemStagedBlobStore
- func (s *FilesystemStagedBlobStore) Open(_ context.Context, owner app.BlobOwner, id string) (io.ReadCloser, error)
- func (s *FilesystemStagedBlobStore) Release(_ context.Context, owner app.BlobOwner, retentionID string) error
- func (s *FilesystemStagedBlobStore) Retain(_ context.Context, owner app.BlobOwner, retentionID string, ids []string) error
- func (s *FilesystemStagedBlobStore) Stage(_ context.Context, owner app.BlobOwner, filename string, content io.Reader) (app.StagedBlob, error)
- func (s *FilesystemStagedBlobStore) Stat(_ context.Context, owner app.BlobOwner, id string) (app.StagedBlob, error)
- type MemorySearchIndexStore
- func (s *MemorySearchIndexStore) IndexedEntries(_ context.Context, namespace app.IndexNamespace) ([]app.StoredEntryRef, error)
- func (s *MemorySearchIndexStore) Manifest(_ context.Context, namespace app.IndexNamespace) ([]app.StoredChunkRef, error)
- func (s *MemorySearchIndexStore) Nearest(_ context.Context, namespaces []app.IndexNamespace, vector []float32, ...) ([]app.ScoredChunkHit, error)
- func (s *MemorySearchIndexStore) Reconcile(_ context.Context, namespace app.IndexNamespace, _ string, ...) error
- type PersistentSearchIndexStore
- func (s *PersistentSearchIndexStore) IndexedEntries(_ context.Context, namespace app.IndexNamespace) ([]app.StoredEntryRef, error)
- func (s *PersistentSearchIndexStore) Manifest(_ context.Context, namespace app.IndexNamespace) ([]app.StoredChunkRef, error)
- func (s *PersistentSearchIndexStore) Nearest(ctx context.Context, namespaces []app.IndexNamespace, vector []float32, ...) ([]app.ScoredChunkHit, error)
- func (s *PersistentSearchIndexStore) Reconcile(ctx context.Context, namespace app.IndexNamespace, _ string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemGraphStore ¶
type FilesystemGraphStore struct {
// contains filtered or unexported fields
}
FilesystemGraphStore is the local canonical graph authority. It owns its revision cache and never requires callers to invalidate snapshots.
func NewFilesystemGraphStore ¶
func NewFilesystemGraphStore(options FilesystemGraphStoreOptions) (*FilesystemGraphStore, error)
func (*FilesystemGraphStore) Apply ¶
func (s *FilesystemGraphStore) Apply(ctx context.Context, expectedRevision string, batch app.MutationBatch, blobs app.StagedBlobReader) (app.ApplyResult, error)
func (*FilesystemGraphStore) ReadAttachmentPage ¶
func (s *FilesystemGraphStore) ReadAttachmentPage(_ context.Context, entryID, filename string, offset int64, maxBytes int) (app.AttachmentPage, error)
func (*FilesystemGraphStore) Reconcile ¶
func (s *FilesystemGraphStore) Reconcile(_ context.Context, mutationID, batchDigest string) (app.ApplyResult, error)
type FilesystemLegacySessionMigrator ¶ added in v0.16.1
type FilesystemLegacySessionMigrator struct {
// contains filtered or unexported fields
}
FilesystemLegacySessionMigrator converts the event-only session logs used before v0.16 into the current filesystem session envelope. Migration is an explicit maintenance operation; FilesystemSessionStore never invokes it while serving runtime reads.
func NewFilesystemLegacySessionMigrator ¶ added in v0.16.1
func NewFilesystemLegacySessionMigrator(sessionsDir, blobsDir, subject string, project app.ProjectID) (*FilesystemLegacySessionMigrator, error)
func (*FilesystemLegacySessionMigrator) ListLegacySessions ¶ added in v0.16.1
func (m *FilesystemLegacySessionMigrator) ListLegacySessions(_ context.Context) ([]string, error)
ListLegacySessions returns absolute paths for every non-current JSONL record. Unreadable legacy records are included so an accepted migration reports the exact affected path instead of hiding them.
func (*FilesystemLegacySessionMigrator) MigrateLegacySession ¶ added in v0.16.1
func (m *FilesystemLegacySessionMigrator) MigrateLegacySession(ctx context.Context, path string) (err error)
MigrateLegacySession replaces one legacy log atomically. A current record is not rewritten, but any legacy staging directory left by an earlier migration is removed. Any staged blobs created before replacement are removed again if conversion fails, leaving the legacy log and staging directory untouched for inspection and retry.
type FilesystemSessionStore ¶
type FilesystemSessionStore struct {
// contains filtered or unexported fields
}
FilesystemSessionStore persists each session as append-only JSONL. Events stay opaque and every append is version-CAS protected.
func NewFilesystemSessionStore ¶
func NewFilesystemSessionStore(dir string) (*FilesystemSessionStore, error)
func (*FilesystemSessionStore) Append ¶
func (s *FilesystemSessionStore) Append(_ context.Context, id app.SessionID, expectedVersion uint64, appendData app.SessionAppend) (uint64, error)
func (*FilesystemSessionStore) Create ¶
func (s *FilesystemSessionStore) Create(_ context.Context, metadata app.SessionMetadata) (app.StoredSession, error)
func (*FilesystemSessionStore) List ¶
func (s *FilesystemSessionStore) List(_ context.Context, filter app.SessionFilter) ([]app.StoredSession, error)
func (*FilesystemSessionStore) Load ¶
func (s *FilesystemSessionStore) Load(_ context.Context, id app.SessionID) (app.StoredSession, error)
type FilesystemStagedBlobStore ¶
type FilesystemStagedBlobStore struct {
// contains filtered or unexported fields
}
func NewFilesystemStagedBlobStore ¶
func NewFilesystemStagedBlobStore(dir string) (*FilesystemStagedBlobStore, error)
func (*FilesystemStagedBlobStore) Open ¶
func (s *FilesystemStagedBlobStore) Open(_ context.Context, owner app.BlobOwner, id string) (io.ReadCloser, error)
type MemorySearchIndexStore ¶
type MemorySearchIndexStore struct {
// contains filtered or unexported fields
}
MemorySearchIndexStore is a process-local mechanical vector index. It is useful for embedded compositions that want root-owned lazy reconciliation without operating a separate persistent index service.
func NewMemorySearchIndexStore ¶
func NewMemorySearchIndexStore() *MemorySearchIndexStore
func (*MemorySearchIndexStore) IndexedEntries ¶ added in v0.16.2
func (s *MemorySearchIndexStore) IndexedEntries(_ context.Context, namespace app.IndexNamespace) ([]app.StoredEntryRef, error)
IndexedEntries reports which entries have chunks stored — the optional entry-manifest capability the application uses for monotonic, entry-presence reconciliation. Distinct entry IDs, sorted for deterministic output.
func (*MemorySearchIndexStore) Manifest ¶
func (s *MemorySearchIndexStore) Manifest(_ context.Context, namespace app.IndexNamespace) ([]app.StoredChunkRef, error)
func (*MemorySearchIndexStore) Nearest ¶
func (s *MemorySearchIndexStore) Nearest(_ context.Context, namespaces []app.IndexNamespace, vector []float32, limit int) ([]app.ScoredChunkHit, error)
func (*MemorySearchIndexStore) Reconcile ¶
func (s *MemorySearchIndexStore) Reconcile(_ context.Context, namespace app.IndexNamespace, _ string, upserts []app.IndexedChunk, deletes []string) error
type PersistentSearchIndexStore ¶ added in v0.16.2
type PersistentSearchIndexStore struct {
// contains filtered or unexported fields
}
PersistentSearchIndexStore is the machine-global chromem-backed vector store behind sdd serve — the same content-addressed store the CLI builds and reads (d-cpt-6cq). One store per (repo-key, embedding fingerprint) under the cache root: the request fingerprint selects the final directory at call time, so a lazy embedder that only reports its dimensionality on first use still routes correctly.
The adapter holds no long-lived chromem snapshot. Every operation reopens the store under the appropriate lock (index.ReadStore / index.WriteStore) so a long-running server always reflects writes committed by the CLI or another process. Reconciliation is monotonic: it accumulates chunks for immutable entries and never deletes based on request filters — the sanctioned delete paths are the CLI's explicit rebuild and (later) version GC, not the search path.
func NewPersistentSearchIndexStore ¶ added in v0.16.2
func NewPersistentSearchIndexStore(project app.ProjectID, cacheRoot, repoKey string) *PersistentSearchIndexStore
NewPersistentSearchIndexStore builds the adapter for one project. cacheRoot is the machine-global cache root; repoKey is index.RepoKey for the base repo or the connected repo's ID (the existing connected-repository storage contract).
func (*PersistentSearchIndexStore) IndexedEntries ¶ added in v0.16.2
func (s *PersistentSearchIndexStore) IndexedEntries(_ context.Context, namespace app.IndexNamespace) ([]app.StoredEntryRef, error)
IndexedEntries reads the existing v1 manifest and returns the indexed entry identities — no migration, no rebuild, no document embedding. This is the presence source the application reconciles against.
func (*PersistentSearchIndexStore) Manifest ¶ added in v0.16.2
func (s *PersistentSearchIndexStore) Manifest(_ context.Context, namespace app.IndexNamespace) ([]app.StoredChunkRef, error)
Manifest reports stored chunk identities. Kept for the SearchIndexStore contract; the application prefers IndexedEntries for reconciliation.
func (*PersistentSearchIndexStore) Nearest ¶ added in v0.16.2
func (s *PersistentSearchIndexStore) Nearest(ctx context.Context, namespaces []app.IndexNamespace, vector []float32, limit int) ([]app.ScoredChunkHit, error)
Nearest opens a fresh read snapshot per operation and maps index hits back to scored chunk hits with complete citation data.
func (*PersistentSearchIndexStore) Reconcile ¶ added in v0.16.2
func (s *PersistentSearchIndexStore) Reconcile(ctx context.Context, namespace app.IndexNamespace, _ string, upserts []app.IndexedChunk, deletes []string) error
Reconcile accumulates the given chunks under the exclusive lock. It groups upserts by entry, reopens the latest store inside the lock, adds each entry's rows, and writes the v1 manifest. Graph revision is ignored. Request-driven deletes are refused — deletion is not the search path's job.