Documentation
¶
Overview ¶
Package semanticsegment owns immutable, content-addressed ANN cache artifacts.
Index ¶
Constants ¶
const ( SchemaVersion = 1 PayloadFileName = "payload.bin" ManifestFileName = "manifest.json" RootFileName = "root.json" )
Variables ¶
This section is empty.
Functions ¶
func RootDescriptorSHA256 ¶
RootDescriptorSHA256 returns the canonical root descriptor hash shared by filesystem publication and authoritative SQLite admission.
Types ¶
type Manifest ¶
type Manifest struct {
SchemaVersion int `json:"schema_version"`
DatabaseID string `json:"database_id"`
ProfileID string `json:"profile_id"`
Backend string `json:"backend"`
BackendVersion string `json:"backend_version"`
DistanceMetric string `json:"distance_metric"`
Dimensions int `json:"dimensions"`
Members []Member `json:"members"`
PayloadSHA256 string `json:"payload_sha256"`
MembersSHA256 string `json:"members_sha256"`
DescriptorSHA256 string `json:"descriptor_sha256"`
}
type Member ¶
type Member struct {
Ordinal uint64 `json:"ordinal"`
ChunkID string `json:"chunk_id"`
Revision int64 `json:"revision"`
VectorHash string `json:"vector_hash"`
}
Member maps a dense, segment-local ordinal to the exact SQLite embedding revision from which the opaque payload was built.
type Root ¶
type Root struct {
RelativePath string
Manifest RootManifest
}
type RootInput ¶
type RootInput struct {
DatabaseID, ProfileID, GenerationID string
SnapshotRevision, PurgeEpoch int64
Segments []RootSegment
}
type RootManifest ¶
type RootManifest struct {
SchemaVersion int `json:"schema_version"`
DatabaseID string `json:"database_id"`
ProfileID string `json:"profile_id"`
GenerationID string `json:"generation_id"`
SnapshotRevision int64 `json:"snapshot_revision"`
PurgeEpoch int64 `json:"purge_epoch"`
Segments []RootSegment `json:"segments"`
DescriptorSHA256 string `json:"descriptor_sha256"`
}
type RootSegment ¶
type Segment ¶
func OpenSegment ¶
func OpenSegmentManifest ¶
func OpenSegmentManifest(ctx context.Context, cacheDir, databaseID, profileID, hash string) (Segment, error)
OpenSegmentManifest validates one immutable segment descriptor without reading its opaque payload. Payload consumers remain responsible for verifying PayloadSHA256 while reading the payload exactly once.
func PublishSegment ¶
func PublishSegment(cacheDir string, input SegmentInput) (Segment, error)