Skip to main content

Tests: internal/infra/inference

internal/infra/inference · 72 tests

Each test is named for the property it holds, and runs against a real deployment: there is no mock of the database and no arm that skips when it is absent. The sentence is the test's name read back; the name is what go test -run takes.

config_test.go

  • No message content leaves for an unlisted hostTestNoMessageContentLeavesForAnUnlistedHost. ── The egress guard ────────────────────────────────────────────────────────────────────────── Extraction sends a customer's message text to a model.
  • A trailing slash on the endpoint is trimmedTestATrailingSlashOnTheEndpointIsTrimmed. A trailing slash on the endpoint must not produce a doubled one in the path.
  • Plaintext is permitted only to this machineTestPlaintextIsPermittedOnlyToThisMachine. Plaintext is permitted to the machine the process is on, and to nothing else.
  • The allowlist is host and port rather than AURLTestTheAllowlistIsHostAndPortRatherThanAURL. The allowlist is matched on host and port, so an entry carrying a scheme matches nothing.
  • Embedding can go somewhere else and still has to be listedTestEmbeddingCanGoSomewhereElseAndStillHasToBeListed
  • One provider needs one endpointTestOneProviderNeedsOneEndpoint. One provider is the ordinary case and needs one set of variables.
  • A second endpoint obeys every rule the first one doesTestASecondEndpointObeysEveryRuleTheFirstOneDoes. A second endpoint on a host nobody listed is refused for the same reason the first one is: it is an egress of exactly the data this product exists to hold, and the list is what makes permitting it a deliberate act.

corpus_test.go

embedder_test.go

embeddingbounds_test.go

embeddingconfig_test.go

  • Embedding only configuration binds its own allowed endpointTestEmbeddingOnlyConfigurationBindsItsOwnAllowedEndpoint. A read-only service validates only the endpoint it uses, without borrowing a different provider's credential or weakening the generation process's independent validation.

golden_capture_test.go

  • Capture goldenTestCaptureGolden. Regenerates the golden after a DELIBERATE wording change, run with CAPTURE=1.

identity_test.go

live_test.go

  • A real models claims are all citableTestARealModelsClaimsAreAllCitable. ── What extraction refused is kept, against a model free to paraphrase ─────────────────────── The unit tests prove the span rule holds for proposals a stub was told to produce.

livedescription_test.go

liveneighbourhood_test.go

livereport_test.go

liveresolution_test.go

livespeaker_test.go

livesurfacecontract_test.go

livethemes_test.go

parse_test.go

prompt_test.go

  • The message is fenced with a value it could not containTestTheMessageIsFencedWithAValueItCouldNotContain. ── Directive framing, the part that needs no ruling ────────────────────────────────────────── A message arrives as data inside a fence the message could not have contained.
  • The fence is not reused between callsTestTheFenceIsNotReusedBetweenCalls. The fence is different every time, so it cannot be learned from one call and used in the next.
  • A fence that occurs in the content is regeneratedTestAFenceThatOccursInTheContentIsRegenerated. A fence that somehow occurs in the content is regenerated rather than used.
  • Every instruction precedes the contentTestEveryInstructionPrecedesTheContent. The instructions end before the content begins.

promptfile_test.go

redirect_test.go

  • A model endpoint cannot redirect content to a host nobody listedTestAModelEndpointCannotRedirectContentToAHostNobodyListed. ── The allowlist names where content goes, not where it goes first ─────────────────────────── A listed endpoint that answers with a redirect is asking for the request body — message content, a report's facts, a history to summarise — to be sent again to a host nobody listed.

reporter_test.go

reportprompt_test.go

reportrevision_test.go

summariser_test.go

  • The compaction prompt loads and ends on the boundaryTestTheCompactionPromptLoadsAndEndsOnTheBoundary. The compaction prompt loads with the report prompt's loader, and its system prompt ends on the data boundary: whatever the material says, the last instruction the model reads is that the material is data.
  • Material is rendered fenced and in orderTestMaterialIsRenderedFencedAndInOrder. The material is rendered fenced, oldest first, with who said what; the fence is chosen against every byte of the material so the material cannot close it.
  • The summary is located in the reply and an empty one is refusedTestTheSummaryIsLocatedInTheReplyAndAnEmptyOneIsRefused. The reply is located inside whatever the model wrapped it in, and an empty summary is refused: a segment that says nothing would stand in for turns and lose them.
  • The summariser asks the model under the files contractTestTheSummariserAsksTheModelUnderTheFilesContract. The request carries the file's model contract and the fenced material, and the provider's answer becomes the summary; a provider that fails is an error, not an empty segment.

timeout_test.go

  • The model client timeout follows the configured budgetTestTheModelClientTimeoutFollowsTheConfiguredBudget. The client's own timeout must follow the configured budget: if it stayed at a lower constant, the deadline that fired would not be the one the operator set, and the failure would misreport it.