conformance

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package conformance contains executable contracts for the ports defined in internal/app. Every adapter must pass the suite for each port it implements; behavior questions are settled by adding cases here, never by adapter-specific convention.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAnswerCacheSuite

func RunAnswerCacheSuite(t *testing.T, factory func(t *testing.T) app.AnswerCache)

RunAnswerCacheSuite verifies the app.AnswerCache contract. The factory must return a fresh, empty cache per call. Times are passed explicitly (the store holds no clock), so these cases are deterministic.

func RunCollectionRepositorySuite

func RunCollectionRepositorySuite(t *testing.T, factory func(t *testing.T) app.CollectionRepository)

RunCollectionRepositorySuite verifies the app.CollectionRepository contract. The factory must return a fresh, empty repository per call.

This suite covers only what the port can observe: Collection CRUD. The cross-aggregate cascade of Delete (removing the collection's documents and vectors) is orchestrated by the use case, which holds the DocumentRepository and VectorIndex; it is verified at that layer.

func RunDocumentRepositorySuite

func RunDocumentRepositorySuite(t *testing.T, factory func(t *testing.T) app.DocumentRepository)

RunDocumentRepositorySuite verifies the app.DocumentRepository contract. The factory must return a fresh, empty repository per call.

The within-port cascade (deleting a Document deletes its Chunks) is covered here. The Chunks' vectors live in the VectorIndex; removing those is the use case's job and is verified at that layer.

func RunLexicalIndexSuite added in v1.0.0

func RunLexicalIndexSuite(t *testing.T, factory func(t *testing.T) app.LexicalIndex)

RunLexicalIndexSuite verifies the app.LexicalIndex contract. The factory must return a fresh, empty index per call.

Assertions are on ranking *order* and membership, never exact scores: an in-memory BM25 and SQLite FTS5 compute different absolute scores (and corpus statistics), but any reasonable BM25 agrees that a chunk with more occurrences of a rare query term outranks one with fewer, and that a chunk containing none of the query terms is not a match.

func RunVectorIndexSuite

func RunVectorIndexSuite(t *testing.T, factory func(t *testing.T) app.VectorIndex)

RunVectorIndexSuite verifies the app.VectorIndex contract. The factory must return a fresh, empty index per call.

Types

This section is empty.

Jump to

Keyboard shortcuts

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