Tests: internal/formation
internal/formation · 61 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.
attempts_test.go
- An attempt is counted when the turn is claimed —
TestAnAttemptIsCountedWhenTheTurnIsClaimed. An attempt is counted when the turn is claimed, so an attempt that takes the worker with it still costs one. - A name the store cannot keep is a refusal not a failed turn —
TestANameTheStoreCannotKeepIsARefusalNotAFailedTurn. A name the store cannot keep is a refusal, not a failed turn: the rest of the turn forms, the claim is recorded with its reason, and nothing is retried.
compaction_internal_test.go
- Material over the ceiling is cut from the oldest turn and the cut is counted —
TestMaterialOverTheCeilingIsCutFromTheOldestTurnAndTheCutIsCounted. Material over the ceiling loses its oldest turns until it fits, and the count of what went is reported; a single turn is never cut away, because a segment written from nothing is not a segment.
compaction_test.go
- The compaction pass rolls up a history one bounded call at a time —
TestTheCompactionPassRollsUpAHistoryOneBoundedCallAtATime. The pass writes at most its limit of segments per call, climbs one level when a run of segments is full, and stops when the history is rolled up; a summariser that fails is counted, not fatal; no summariser writes nothing. - The driver runs the compaction pass after draining —
TestTheDriverRunsTheCompactionPassAfterDraining. The driver runs the projection passes after draining a scope, so a deployment writes segments without an operator running anything; the pass counts appear in what the driver did.
formation_test.go
- A turn is formed and its facts cite their own messages —
TestATurnIsFormedAndItsFactsCiteTheirOwnMessages. ── A turn is formed and its facts cite their own messages ──────────────────────────────────── A turn is appended, formed, and its facts read back with evidence whose spans resolve against the messages they came from. - An assistant message in a users turn forms no fact for the principal —
TestAnAssistantMessageInAUsersTurnFormsNoFactForThePrincipal. ── The role is the message's, never the turn's ─────────────────────────────────────────────── The role is the MESSAGE's, never the turn's. - The formed watermark never runs past an unformed turn —
TestTheFormedWatermarkNeverRunsPastAnUnformedTurn. ── Stored is not formed, and the watermark cannot run past a gap ───────────────────────────── Stored is not formed, and the formed watermark cannot run past a gap. - A second worker on the same scope is turned away —
TestASecondWorkerOnTheSameScopeIsTurnedAway. ── One worker per scope ────────────────────────────────────────────────────────────────────── One worker per scope. - Formation records what the vocabulary refused —
TestFormationRecordsWhatTheVocabularyRefused. What the vocabulary refused is written down, so its rate is a query rather than an estimate. - A turn that will not form is parked with its reason kept —
TestATurnThatWillNotFormIsParkedWithItsReasonKept. A turn that fails every time is parked, and parking is legible without reading a log. - A parked turn does not freeze the scope behind it —
TestAParkedTurnDoesNotFreezeTheScopeBehindIt. A parked turn does not hold the scope. - Unparking returns the turn and corrects the watermark —
TestUnparkingReturnsTheTurnAndCorrectsTheWatermark. Parking is a decision, not a deletion. - A cancelled drain does not spend the turns attempts —
TestACancelledDrainDoesNotSpendTheTurnsAttempts. A shutdown is not a bad turn. - The driver finds scopes it was never told about —
TestTheDriverFindsScopesItWasNeverToldAbout. The driver finds scopes rather than being told them, which is the only way a project created after it started gets formed. - A scope that fails does not stop the others forming —
TestAScopeThatFailsDoesNotStopTheOthersForming. One project's bad turn does not hold up another project's memory. - The driver forms a scope without anybody asking it —
TestTheDriverFormsAScopeWithoutAnybodyAskingIt. The driver forms without anybody asking it to. - A second driver does not form the same turn twice —
TestASecondDriverDoesNotFormTheSameTurnTwice. Two drivers over one instance do not form the same turn twice. - Recording a failure against a formed or absent turn is a no op —
TestRecordingAFailureAgainstAFormedOrAbsentTurnIsANoOp. Recording a failure against a turn that formed in the meantime is not an error. - The driver sweeps retention —
TestTheDriverSweepsRetention. The driver sweeps retention as well as forming, on its own schedule. - Only projects with due stored deadlines are swept —
TestOnlyProjectsWithDueStoredDeadlinesAreSwept. Stored deadlines determine whether a project has due work, including after its current policy becomes indefinite. - A pass reports what it could not do —
TestAPassReportsWhatItCouldNotDo. A driver pass keeps going when one scope fails, and reports that it did. - A cancelled pass stops —
TestACancelledPassStops. A cancelled pass stops rather than working through the remaining scopes. - A turn with two current values forms with one fact and one refusal —
TestATurnWithTwoCurrentValuesFormsWithOneFactAndOneRefusal. A message that gives one single-cardinality relation two current values forms rather than parks: the first value is the fact, the second is a refusal with its own reason, and the watermark moves. - A claim refused by role is recorded with its reason —
TestAClaimRefusedByRoleIsRecordedWithItsReason. A refusal by role is a row, not only a number: an operator reading what a document was refused sees the assistant's first-person claims beside the other reasons. - A worker that dies strands neither the scope nor the turn —
TestAWorkerThatDiesStrandsNeitherTheScopeNorTheTurn. ── A worker that dies strands nothing ──────────────────────────────────────────────────────── A worker that dies strands nothing.
health_test.go
- Formation health tracks actual attempts and recovery —
TestFormationHealthTracksActualAttemptsAndRecovery
ingestionbudget_test.go
- Provider outage cannot grow the backlog by parking and recovery restores admission —
TestProviderOutageCannotGrowTheBacklogByParkingAndRecoveryRestoresAdmission
notifications_test.go
- The pass does nothing without a destination and stops when the store fails —
TestThePassDoesNothingWithoutADestinationAndStopsWhenTheStoreFails. ── The notification pass ───────────────────────────────────────────────────────────────────── A deployment with no permitted destination does nothing at all, and a store that fails stops the pass rather than being swallowed — a delivery whose failure nobody hears about is the shape of promise this whole mechanism exists to avoid making.
pipeline_test.go
- Configured extraction identity survives recovery and refuses mixed source retries —
TestConfiguredExtractionIdentitySurvivesRecoveryAndRefusesMixedSourceRetries. A real HTTP proposer and PostgreSQL carry the configuration through formation, exact citations, retry refusal, recovery and governance.
pipelinefailure_test.go
- Failed and empty extraction attempts keep their pinned configuration —
TestFailedAndEmptyExtractionAttemptsKeepTheirPinnedConfiguration
projectrebuild_test.go
- Project rebuild resumes pages within its captured log boundary —
TestProjectRebuildResumesPagesWithinItsCapturedLogBoundary - Project rebuild retries publication after progress failure without inference —
TestProjectRebuildRetriesPublicationAfterProgressFailureWithoutInference - Project rebuild cancellation lets admitted source finish and stops the next —
TestProjectRebuildCancellationLetsAdmittedSourceFinishAndStopsTheNext - Project rebuild cancelled pending source does not start inference on resume —
TestProjectRebuildCancelledPendingSourceDoesNotStartInferenceOnResume - Project rebuild skips sources erased during model work —
TestProjectRebuildSkipsSourcesErasedDuringModelWork - Project rebuild rejects other runners and changed configuration —
TestProjectRebuildRejectsOtherRunnersAndChangedConfiguration - Project rebuild completes an empty project without inference —
TestProjectRebuildCompletesAnEmptyProjectWithoutInference - Project rebuild erased pending source skips without model —
TestProjectRebuildErasedPendingSourceSkipsWithoutModel - Project rebuild never sends authoritative sources to inference —
TestProjectRebuildNeverSendsAuthoritativeSourcesToInference - Project rebuild requires durable admission before inference —
TestProjectRebuildRequiresDurableAdmissionBeforeInference - Project rebuild leaves failed inference pending for retry —
TestProjectRebuildLeavesFailedInferencePendingForRetry
quietproject_test.go
- The driver writes the reports a quiet project owes —
TestTheDriverWritesTheReportsAQuietProjectOwes. A project with nothing left to form still owes the reports an erasure or a correction deleted.
rebuild_test.go
- Rebuilder publishes and replays one source without another model call —
TestRebuilderPublishesAndReplaysOneSourceWithoutAnotherModelCall - Rebuilder does not publish when inference fails —
TestRebuilderDoesNotPublishWhenInferenceFails - Rebuilder bounds model output before cutover —
TestRebuilderBoundsModelOutputBeforeCutover
rebuildintegrity_test.go
- Formation rebuild and erasure preserve project relationships —
TestFormationRebuildAndErasurePreserveProjectRelationships
rebuildretry_test.go
- Rebuilder retries bookkeeping without repeating inference —
TestRebuilderRetriesBookkeepingWithoutRepeatingInference - Rebuilder cannot recreate source erased during inference —
TestRebuilderCannotRecreateSourceErasedDuringInference
retentionscheduling_test.go
- Retention driver finds artifact deadlines without a project retention policy —
TestRetentionDriverFindsArtifactDeadlinesWithoutAProjectRetentionPolicy
subjectretention_test.go
- Retention driver removes unused subject mappings without any observations —
TestRetentionDriverRemovesUnusedSubjectMappingsWithoutAnyObservations
subjects_test.go
- A subject is formed and described from what was said —
TestASubjectIsFormedAndDescribedFromWhatWasSaid - A second pass over an unchanged scope writes nothing —
TestASecondPassOverAnUnchangedScopeWritesNothing. A second run over an unchanged scope writes nothing new. - A model that is down loses a tick rather than a scope —
TestAModelThatIsDownLosesATickRatherThanAScope. A provider that is down costs a tick, not a scope. - A subject forms without a model —
TestASubjectFormsWithoutAModel. A deployment with no model still forms subjects. - A scope with no relations forms nothing and says so —
TestAScopeWithNoRelationsFormsNothingAndSaysSo. An empty scope is every scope's first hour, not an error. - Erasing one contributor removes the prose they are in —
TestErasingOneContributorRemovesTheProseTheyAreIn. A report holds what somebody said. - A subject that did not change keeps its identity —
TestASubjectThatDidNotChangeKeepsItsIdentity. A subject that did not change keeps its name, and a rebuild reproduces it. - A subject that changed loses the prose about the old one —
TestASubjectThatChangedLosesTheProseAboutTheOldOne. A subject that gained a member is a different subject, and what was written about the old one goes with it — because a report describes a set of members, and that set no longer exists. - A parent is described from its children when its own material does not fit —
TestAParentIsDescribedFromItsChildrenWhenItsOwnMaterialDoesNotFit. A parent too large to describe from its own facts is described from its children's reports. - A changed writer is offered the report it did not write and an unchanged one is not —
TestAChangedWriterIsOfferedTheReportItDidNotWriteAndAnUnchangedOneIsNot. ── A report carries what wrote it, at the pass ─────────────────────────────────────────────── A prompt edit is a change to behaviour (rule 14), and until a report recorded what wrote it the edit could not reach a single paragraph already stored.