Tests: internal/recall
internal/recall · 48 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.
controls_test.go
- Recall controls are independent across concurrent clients —
TestRecallControlsAreIndependentAcrossConcurrentClients - Recall character accounting counts unicode roles and paths —
TestRecallCharacterAccountingCountsUnicodeRolesAndPaths
limits_test.go
- Oversized questions are refused before accessing a store —
TestOversizedQuestionsAreRefusedBeforeAccessingAStore - An overproducing store cannot start unbounded traversal —
TestAnOverproducingStoreCannotStartUnboundedTraversal
recall_test.go
- A questions windows are the shape entity names are stored in —
TestAQuestionsWindowsAreTheShapeEntityNamesAreStoredIn - An apostrophe or hyphen inside a word survives —
TestAnApostropheOrHyphenInsideAWordSurvives - A question anchors to an entity and the facts come back cited —
TestAQuestionAnchorsToAnEntityAndTheFactsComeBackCited. ── #3's claim ──────────────────────────────────────────────────────────────────────────────── Observe, form, recall — and the fact comes back with its verbatim quote and byte span. - An entity is an anchor from either end of a fact —
TestAnEntityIsAnAnchorFromEitherEndOfAFact. A fact is reachable through EITHER end. - A recall sees only the projects it was authorised for —
TestARecallSeesOnlyTheProjectsItWasAuthorisedFor. ── The soft boundary ───────────────────────────────────────────────────────────────────────── A project is a permission, so the authorised set is an argument on every read. - An empty authorised set returns nothing —
TestAnEmptyAuthorisedSetReturnsNothing. An empty authorised set returns nothing. - A question that anchors to nothing is an empty bundle —
TestAQuestionThatAnchorsToNothingIsAnEmptyBundle. A question naming nothing we know about is an empty bundle, not an error. - A truncated bundle says so —
TestATruncatedBundleSaysSo. A truncated bundle says so. - A nonsense bundle cap falls back rather than returning nothing —
TestANonsenseBundleCapFallsBackRatherThanReturningNothing. A bundle cap of zero or less falls back rather than returning nothing. - Facts from one message about one subject are marked not independent —
TestFactsFromOneMessageAboutOneSubjectAreMarkedNotIndependent - Facts from different messages of one turn are independent —
TestFactsFromDifferentMessagesOfOneTurnAreIndependent. Two messages in one turn are two speakers. - Facts about different subjects are independent —
TestFactsAboutDifferentSubjectsAreIndependent. Different subjects in one sentence are different claims. - Co derivation compares subjects the way entities resolve —
TestCoDerivationComparesSubjectsTheWayEntitiesResolve. The subject is compared the way entities are resolved, so casing does not make one person two. - Co derivation names only what the caller can see —
TestCoDerivationNamesOnlyWhatTheCallerCanSee. Only what is in the bundle is named. - A fact with no subject is not co derived with everything —
TestAFactWithNoSubjectIsNotCoDerivedWithEverything. A fact whose subject or evidence is gone — an erased entity — is independent of nothing rather than co-derived with everything, which is what an empty key would make it. - A question naming nothing known says so rather than looking silent —
TestAQuestionNamingNothingKnownSaysSoRatherThanLookingSilent. A question that names nothing this memory holds says so, rather than returning an empty bundle that looks like having nothing to say. - A known subject with no facts is not the same as an unknown one —
TestAKnownSubjectWithNoFactsIsNotTheSameAsAnUnknownOne. A question that names something known and finds no facts is the OTHER empty answer, and must not claim the thing is unknown. - The bundle says where its facts came from —
TestTheBundleSaysWhereItsFactsCameFrom. Where the facts came from is visible, so a question that named several things and drew everything from one is recognisable without anybody choosing a threshold. - The counts describe what the caller got —
TestTheCountsDescribeWhatTheCallerGot. The counts describe what the caller received. - The bundle is cut by what the caller can afford —
TestTheBundleIsCutByWhatTheCallerCanAfford. The cut is by characters, not rows, because a row is not a size: one fact carries a two-word quote and another carries a paragraph, so a caller converting rows to anything has to assume the worst every time to avoid overrunning once. - A budget too small for one fact returns an explicitly truncated empty bundle —
TestABudgetTooSmallForOneFactReturnsAnExplicitlyTruncatedEmptyBundle. A too-small context allowance returns no facts and explicitly reports the budget cut. - A generous budget returns everything and says so —
TestAGenerousBudgetReturnsEverythingAndSaysSo. A generous budget returns everything and does not claim truncation. - The row bound guards the query —
TestTheRowBoundGuardsTheQuery. The row bound guards the query rather than the answer: an enormous budget must not become an unbounded read. - The words around a quote are charged to the budget —
TestTheWordsAroundAQuoteAreChargedToTheBudget. The context is on the wire, so the caller pays for it. - A bundle says when a citation lost its context —
TestABundleSaysWhenACitationLostItsContext. A bare citation is announced once for the bundle. - An ordinary recall names no instant —
TestAnOrdinaryRecallNamesNoInstant. The ordinary recall asks about now, and "now" is the zero value rather than a timestamp this process computed — the store turns that into the open interval, which is the only version that does not depend on two clocks agreeing. - A historical recall passes both instants through —
TestAHistoricalRecallPassesBothInstantsThrough. And a historical recall is the same read with two instants on it: same anchoring, same scopes, same sources, same budget. - An ordinary recall asks for one hop —
TestAnOrdinaryRecallAsksForOneHop. The ordinary recall asks for one hop. - A depth beyond the bound is clamped rather than refused —
TestADepthBeyondTheBoundIsClampedRatherThanRefused. A depth beyond what the traversal does is clamped rather than refused: a caller asking for more memory gets the deepest answer the system gives, which is the useful outcome.
surfaces_test.go
- An unanchored question names the surfaces that did not run —
TestAnUnanchoredQuestionNamesTheSurfacesThatDidNotRun. With no exact anchor and no semantic surfaces, a caller who selected surfaces by name is told which did not run, rather than getting an empty answer that looks like ignorance. - A semantic anchor starts a walk when no name matched —
TestASemanticAnchorStartsAWalkWhenNoNameMatched. A question that names nothing stored by name is anchored by meaning, and the anchor says so. - A thematic question with no anchor is answered from reports with sources —
TestAThematicQuestionWithNoAnchorIsAnsweredFromReportsWithSources. A thematic question with no anchor is answered from reports, each carrying its sources, and the reach still says nothing was anchored because that is still true. - Passages fill the remaining budget and are never facts —
TestPassagesFillTheRemainingBudgetAndAreNeverFacts. Passages fill what the budget has left and are never facts: a tool message's words come back as a passage with its role, and the facts list is untouched by them. - A refusing surface is degraded not fatal —
TestARefusingSurfaceIsDegradedNotFatal. A surface that refuses is named as degraded and the rest of the bundle still answers. - The composed surfaces share one budget —
TestTheComposedSurfacesShareOneBudget. The budget is one budget: reports and passages are cut by the characters the facts left. - Surface controls are refused when not in the set —
TestSurfaceControlsAreRefusedWhenNotInTheSet. Surface names are a closed set: an unknown or repeated name is refused, and the exact path is not touched when only facts are selected and a name matched. - Semantic anchors are capped and stop at the cap —
TestSemanticAnchorsAreCappedAndStopAtTheCap. A meaning match proposes at most a fixed number of places to start, however many scopes are asked: the first scope that fills the cap ends the search, so a caller with many projects does not pay one embedding query per project for anchors it will not walk. - A report larger than the remaining budget is cut whole and reported —
TestAReportLargerThanTheRemainingBudgetIsCutWholeAndReported. A report that does not fit what the budget has left is cut whole and the cut is reported: half a report is not a smaller report, it is a different one. - A refusing passage surface is degraded and reports still answer —
TestARefusingPassageSurfaceIsDegradedAndReportsStillAnswer. The passage surface refusing is named as degraded like any other, and the reports still answer. - No scopes answer nothing and a repeated word is one term —
TestNoScopesAnswerNothingAndARepeatedWordIsOneTerm. Nothing to search is an empty answer, not an error, and a repeated word is one term: a term is a thing to look up, and looking the same thing up twice is the same lookup. - A subject filter reaches every surface —
TestASubjectFilterReachesEverySurface. Passages are searched for that person only; reports, which span people and name nobody as their source, are withheld and the bundle says so; and a name the semantic surface proposed that this person has no fact about is not returned, because it is somebody else's memory. - Deselecting facts returns no facts even when a name matched —
TestDeselectingFactsReturnsNoFactsEvenWhenANameMatched. Deselecting facts deselects them even when the question named something: no walk, no anchors, no facts — and the name it matched is still counted, so the reach does not claim it named nothing. - A semantic anchor that answers is counted as anchored —
TestASemanticAnchorThatAnswersIsCountedAsAnchored. A bundle answered through a semantic anchor counts that anchor, so it does not also report that the question named nothing this memory holds; under a subject filter the anchor stays, because that person has a fact about it. - A fact is never co derived with itself —
TestAFactIsNeverCoDerivedWithItself. The same fact twice is one fact, never co-derived with itself.