Documentation
¶
Overview ¶
Package storetest is a backend-agnostic conformance suite for store.Store implementations. Postgres, sqlite, and mongo each hand-write the same scope predicate/upsert logic independently — Conformance exists so the contract that logic has to satisfy is defined exactly once and run against all three, instead of three parallel hand-maintained test files that can silently drift out of sync with each other.
Index ¶
- func A2AAskResolutionTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func A2AHeldReleaseTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func A2AReplyTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func A2ARoutingUpgrade(t *testing.T, s store.Store, legacy func())
- func A2ASQLRoutingUpgrade(t *testing.T, s store.Store, exec func(string) error)
- func AcceptedLessonFixture(t *testing.T, s store.Store) (context.Context, learning.AcceptRequest)
- func ArtifactBoard(t *testing.T, s store.Store)
- func ArtifactBoardTransactions(t *testing.T, s store.Store, driver assurance.Driver)
- func ArtifactPublication(t *testing.T, s store.Store)
- func AssignmentTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func BudgetTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func BudgetedClaimTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func CaptureIntentRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func CaptureIntentRollback(t *testing.T, s store.Store, driver assurance.Driver)
- func CheckpointSweep(t *testing.T, newStore func(t *testing.T) store.Store)
- func ClaimTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func Conformance(t *testing.T, newStore func(t *testing.T) store.Store)
- func ConversationIntegrity(t *testing.T, st store.Store, ...)
- func CoordinationEvents(t *testing.T, s store.Store)
- func CreateRunDuplicateID(t *testing.T, newStore func(t *testing.T) store.Store)
- func CurrentTaskAcceptanceRead(t *testing.T, s store.Store)
- func EffectContinuationExecution(t *testing.T, backend store.Store, driver assurance.Driver)
- func LeasedClaims(t *testing.T, newStore func(t *testing.T) store.Store)
- func OrchestrationContinuationUpgrade(t *testing.T, s store.Store, legacy func())
- func OrchestrationRevisionUpgrade(t *testing.T, s store.Store, legacy func())
- func OrchestrationSQLContinuationUpgrade(t *testing.T, s store.Store, exec func(string) error)
- func OrchestrationSQLRevisionUpgrade(t *testing.T, s store.Store, exec func(string) error)
- func PlanReplanExecution(t *testing.T, newStore func(*testing.T) store.Store)
- func PlanReplanRecovery(t *testing.T, backend store.Store, driver assurance.Driver)
- func PrivateCandidateRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func PrivateCandidateRollback(t *testing.T, s store.Store, driver assurance.Driver)
- func QualifiedLearning(t *testing.T, newStore func(*testing.T) store.Store)
- func QualifiedLearningGuard(t *testing.T, s store.Store)
- func QualifiedLearningRetentionRace(t *testing.T, s store.Store, driver assurance.Driver)
- func ReadyClaimTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func ReflectionExecution(t *testing.T, newStore func(*testing.T) store.Store)
- func ReportObservations(t *testing.T, newStore func(*testing.T) store.Store)
- func ResultSnapshotBoundaries(t *testing.T, s store.Store, driver assurance.Driver)
- func ResumeAdmissionTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func ResumeClosureTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func ResumeExpiryTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func ReviewTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func RunCallTransactions(t *testing.T, driver assurance.Driver)
- func RunCallTransactionsUnavailable(t *testing.T, s execution.RunCallSealStore)
- func RunCandidateLease(t *testing.T, s store.Store, driver assurance.RunDriver)
- func RunContinuation(t *testing.T, newStore func(t *testing.T) store.Store)
- func RunPrincipal(t *testing.T, newStore func(t *testing.T) store.Store)
- func RunProgress(t *testing.T, newStore func(t *testing.T) store.Store)
- func RunProgressCascade(t *testing.T, s store.Store, ...)
- func RunRecoveryTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func RunReplyRoute(t *testing.T, newStore func(t *testing.T) store.Store)
- func SubmissionTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func SuspensionVersionTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func TaskAcceptanceTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func TaskAdjudication(t *testing.T, newStore func(*testing.T) store.Store)
- func TaskAdoptionProcessCrash(t *testing.T, open func(*testing.T, string) (store.Store, assurance.Driver))
- func TaskCompletionAbandonment(t *testing.T, newStore func(*testing.T) store.Store)
- func TaskCompletionAdmission(t *testing.T, newStore func(*testing.T) store.Store)
- func TaskCompletionLifecycle(t *testing.T, newStore func(*testing.T) store.Store)
- func TaskDispatchTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func TaskRecoveryAdoption(t *testing.T, backend store.Store, driver assurance.Driver)
- func TaskRetirement(t *testing.T, backend store.Store, driver assurance.Driver)
- func TaskRunTransactions(t *testing.T, backend store.Store, driver assurance.Driver)
- func TerminalEventRollback(t *testing.T, s store.Store, driver assurance.Driver)
- func VerificationCallRecovery(t *testing.T, s store.Store, driver assurance.Driver)
- func VerificationCallRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func VerificationCaptureRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func VerificationCaptureRollback(t *testing.T, s store.Store, driver assurance.Driver)
- func VerificationExecutorRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func VerificationJobConcurrentClaims(t *testing.T, s store.Store)
- func VerificationJobLeases(t *testing.T, s store.Store, driver assurance.Driver)
- func VerificationJobRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func VerificationJobRollback(t *testing.T, s store.Store, driver assurance.Driver)
- func VerificationJobTermination(t *testing.T, s store.Store, driver assurance.Driver)
- func VerifiedResultRestart(t *testing.T, s store.Store, reopen func() store.Store)
- func VerifiedResultRevocation(t *testing.T, s store.Store, driver assurance.Driver)
- func VerifiedResultRollback(t *testing.T, s store.Store, driver assurance.Driver)
- type TaskCompletionFixture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func A2AAskResolutionTransactions ¶
A2AAskResolutionTransactions tests native rollback and ambiguous acknowledgments.
func A2AHeldReleaseTransactions ¶
A2AHeldReleaseTransactions checks rollback and lost commit acknowledgments.
func A2AReplyTransactions ¶
A2AReplyTransactions checks native rollback and ambiguous commit recovery.
func A2ARoutingUpgrade ¶
A2ARoutingUpgrade checks legacy records after removing their routing fields.
func A2ASQLRoutingUpgrade ¶
A2ASQLRoutingUpgrade recreates the schema before routing partitions, then replays an unrecorded migration after its columns and indexes already exist.
func AcceptedLessonFixture ¶
AcceptedLessonFixture provides a durable accepted result and lesson proposal.
func ArtifactBoard ¶
ArtifactBoard exercises accepted resource conflicts without rewriting results.
func ArtifactBoardTransactions ¶
ArtifactBoardTransactions covers atomic intent rollback and lost acknowledgments.
func ArtifactPublication ¶
ArtifactPublication verifies actual managed publication, restart and drainage.
func AssignmentTransactions ¶
AssignmentTransactions exercises rollback, ambiguous acknowledgements and serialization with a separate plan writer against each actual database.
func BudgetTransactions ¶
BudgetTransactions exercises shared accounting over real plan transactions.
func BudgetedClaimTransactions ¶
BudgetedClaimTransactions checks atomic ownership and accounting on real stores.
func CaptureIntentRestart ¶
CaptureIntentRestart recovers pre-generation policy from reopened storage.
func CaptureIntentRollback ¶
CaptureIntentRollback proves registration and later capture use real transactions.
func CheckpointSweep ¶ added in v1.10.0
CheckpointSweep proves the sweeper's listing of pending checkpoints: every scope, pending only, in id order, resumable after any id.
func ClaimTransactions ¶
ClaimTransactions exercises ownership recovery against the backend's real plan transaction. It never starts an agent or an external effect.
func Conformance ¶
Conformance runs the full scope-isolation contract against any backend. newStore must return a freshly migrated, empty store; Conformance calls it once per subtest so tests never see another subtest's rows.
func ConversationIntegrity ¶
func ConversationIntegrity(t *testing.T, st store.Store, corrupt func(context.Context, string, string) error)
ConversationIntegrity checks that malformed persisted messages cannot silently disappear from context. Corrupt changes this agent's conversation content only.
func CoordinationEvents ¶
CoordinationEvents verifies durable import, stable delivery identities and current authority using actual accepted artifacts and their source journals.
func CreateRunDuplicateID ¶ added in v1.10.0
CreateRunDuplicateID proves a second CreateRun with an id that already exists is refused with cortex.ErrAlreadyExists and leaves the first run as it was. The engine relies on it to make a host's pre-assigned run id idempotent: a retried start must not run the same work twice.
func CurrentTaskAcceptanceRead ¶
CurrentTaskAcceptanceRead checks operator projections against the same live evidence rules used by dependent task admission, including later withdrawal.
func EffectContinuationExecution ¶
EffectContinuationExecution verifies durable attempts against each backend. Provider fixtures do not qualify installed authority or idempotency guarantees.
func LeasedClaims ¶ added in v1.10.0
LeasedClaims proves the claims that take a run's lease, and write its first progress snapshot, in the transaction that moves it to running: a claimer that dies right after leaves a lease that lapses and a snapshot to continue from, never a running run nobody owns.
func OrchestrationContinuationUpgrade ¶
OrchestrationContinuationUpgrade preserves legacy teams without granting resume authority.
func OrchestrationRevisionUpgrade ¶
OrchestrationRevisionUpgrade preserves historical children through upgrade.
func OrchestrationSQLContinuationUpgrade ¶
OrchestrationSQLContinuationUpgrade also replays a schema change whose acknowledgment was lost.
func OrchestrationSQLRevisionUpgrade ¶
OrchestrationSQLRevisionUpgrade also replays an unrecorded schema change.
func PlanReplanExecution ¶
PlanReplanExecution exercises durable model admission, failure debt and guarded graph transitions in every backend, without claiming host proof qualification.
func PlanReplanRecovery ¶
PlanReplanRecovery verifies proof-bound commits against real retained claims, journals and accounting, including transaction rollback and uncertain admission.
func PrivateCandidateRestart ¶
PrivateCandidateRestart recovers capture and publishes only after fresh commit.
func PrivateCandidateRollback ¶
PrivateCandidateRollback verifies capture and publication using real transactions.
func QualifiedLearning ¶
QualifiedLearning verifies accepted evidence, durable outboxes and local withdrawal.
func QualifiedLearningGuard ¶
QualifiedLearningGuard checks withdrawal and grants around content hydration.
func QualifiedLearningRetentionRace ¶
QualifiedLearningRetentionRace checks a cross-run correction against a stale deletion observation, then inspects every historical payload in real storage.
func ReadyClaimTransactions ¶
ReadyClaimTransactions exercises prerequisite admission and atomic ownership, accounting and event retention against each real database driver.
func ReflectionExecution ¶
ReflectionExecution covers atomic decisions, stale authority inputs and recovery.
func ReportObservations ¶
ReportObservations checks dynamic supervisor evidence at save, commit and read.
func ResultSnapshotBoundaries ¶
ResultSnapshotBoundaries checks expiry and failures at transaction boundaries.
func ResumeAdmissionTransactions ¶
ResumeAdmissionTransactions verifies rollback and ambiguous acknowledgments at both durable boundaries using each backend's native transaction implementation.
func ResumeClosureTransactions ¶
ResumeClosureTransactions checks incomplete closure against native drivers.
func ResumeExpiryTransactions ¶
ResumeExpiryTransactions exercises expiry against each native transaction driver.
func ReviewTransactions ¶
ReviewTransactions checks commit uncertainty and evidence freshness using the same backend transaction faults exercised by assignment submission tests.
func RunCallTransactions ¶
RunCallTransactions verifies real rollback, ambiguous commits and legacy rows through each backend's transaction driver, without an external provider call.
func RunCallTransactionsUnavailable ¶
func RunCallTransactionsUnavailable(t *testing.T, s execution.RunCallSealStore)
RunCallTransactionsUnavailable verifies that a store without usable transactions cannot admit calls or acknowledge closure, including after creating its anchor.
func RunCandidateLease ¶ added in v1.10.0
RunCandidateLease proves that SetRunCandidate, the run write behind suspension claims, resume closure and private candidates, keeps a lease only on a running run. A run it moves out of running loses its lease, so the sweeper never lists it as lapsed; a run it leaves running keeps the lease its worker holds.
func RunContinuation ¶ added in v1.10.0
RunContinuation proves the store half of non-blocking resume. A decision or an answer moves a paused run to ready, any replica claims it once, and a worker's lease on a running run either holds, hands off, or lapses into reclaimable for the sweeper to give to someone else.
func RunPrincipal ¶ added in v1.10.0
RunPrincipal proves a run keeps the codec bytes it was created with. A resume decodes them to put the original caller back on the context, so a store that dropped them on any read, or on the update that pauses the run, would resume every run under nobody.
The bytes never reach JSON: a run is served to API clients as JSON, and what a host's codec wrote is the host's business.
func RunProgress ¶ added in v1.10.0
RunProgress proves the store half of continuing a run after its worker dies. A worker saves the run's progress at each durable boundary, only while it still holds the run's lease, and a replica that reclaims the run reads that snapshot back exactly as it was written.
func RunProgressCascade ¶ added in v1.10.0
func RunProgressCascade(t *testing.T, s store.Store, deleteRun func(context.Context, id.AgentRunID) error)
RunProgressCascade proves that a run's progress row goes when the run does. Stores have no method that deletes a run, so the backend passes deleteRun, which removes the run row the way an operator would. Mongo has no foreign keys and does not run it.
func RunRecoveryTransactions ¶
RunRecoveryTransactions checks evidence revalidation inside the real plan transaction. These storage fixtures do not authenticate proof or adopt tasks.
func RunReplyRoute ¶ added in v1.10.0
RunReplyRoute proves a run keeps the reply route it was created with, and never serializes it. The engine writes a directive run's route, the asker's reply token included, so that whichever replica finishes the run can answer; a run is served to API clients as JSON, and the token must not reach them.
func SubmissionTransactions ¶
SubmissionTransactions verifies that evidence and run fences survive until the assignment observation commits, and that uncertainty preserves history.
func SuspensionVersionTransactions ¶
SuspensionVersionTransactions verifies rollback and ambiguous claim commits.
func TaskAcceptanceTransactions ¶
TaskAcceptanceTransactions checks rollback and time fences on real backends.
func TaskAdjudication ¶
TaskAdjudication exercises required review, retained evidence and atomic acceptance.
func TaskAdoptionProcessCrash ¶
func TaskAdoptionProcessCrash(t *testing.T, open func(*testing.T, string) (store.Store, assurance.Driver))
TaskAdoptionProcessCrash kills a test-owned coordinator at the real backend's commit boundary, then reopens its database. The opener must use the supplied path so every child resource remains owned by the parent test directory. Fixture authority qualifies persistence and lifecycle, not remote quiescence.
func TaskCompletionAbandonment ¶
TaskCompletionAbandonment tests permanent closure, conservative accounting and current authority. These fixture attestations do not qualify a live host fence.
func TaskCompletionAdmission ¶
TaskCompletionAdmission checks that review identity and capacity are atomic.
func TaskCompletionLifecycle ¶
TaskCompletionLifecycle checks restart recovery and uncertain dispatch boundaries.
func TaskDispatchTransactions ¶
TaskDispatchTransactions verifies readiness, ownership and assignment changes commit together without invoking a worker or treating a retry as permission.
func TaskRecoveryAdoption ¶
TaskRecoveryAdoption exercises recovery against real durable verifier and ownership records. Fixture proof references do not qualify a host authenticator.
func TaskRetirement ¶
TaskRetirement verifies durable retirement, replacement and historical retries. Fixture attestations exercise storage contracts, not installed host authority.
func TaskRunTransactions ¶
TaskRunTransactions tests atomic reserved child creation and capture policy.
func TerminalEventRollback ¶
TerminalEventRollback proves terminal state, receipt and replay share rollback.
func VerificationCallRecovery ¶
VerificationCallRecovery preserves dispatch across takeover and transaction failure.
func VerificationCallRestart ¶
VerificationCallRestart proves a lost dispatch acknowledgement is not replayable.
func VerificationCaptureRestart ¶
VerificationCaptureRestart recovers the same capture after reopening storage.
func VerificationCaptureRollback ¶
VerificationCaptureRollback checks every capture write inside a real transaction.
func VerificationExecutorRestart ¶
VerificationExecutorRestart recovers a retained provider outcome after the database is closed and reopened, without a second evaluator invocation.
func VerificationJobConcurrentClaims ¶
VerificationJobConcurrentClaims permits one worker generation per live lease.
func VerificationJobLeases ¶
VerificationJobLeases exercises persisted ownership using deterministic host time.
func VerificationJobRestart ¶
VerificationJobRestart preserves partial reports and claim identity after closing and reopening the database. It never invokes generation or tools.
func VerificationJobRollback ¶
VerificationJobRollback injects failure after enqueue, report and final commit writes, then proves each operation can be retried without partial progress.
func VerificationJobTermination ¶
VerificationJobTermination checks deadlines, attempt limits, cancellation and failed checks without assigning a successful verification status to the run.
func VerifiedResultRestart ¶
VerifiedResultRestart checks that reopening storage preserves the original receipt and event ID and that a lost acknowledgement can be retried safely.
func VerifiedResultRevocation ¶
VerifiedResultRevocation checks a deletion after the initial transaction reads. Use this for row-locking or snapshot backends. SQLite holds a database write lock from the start, so a competing delete cannot reach this window there.
Types ¶
type TaskCompletionFixture ¶
type TaskCompletionFixture struct {
Context context.Context
Request coordination.TaskCompletionRequest
Acceptance coordination.TaskAcceptanceRequest
Review coordination.Review
Submission coordination.Submission
ProducerAssignment coordination.Assignment
Plan planning.Plan
Contract verification.Contract
}
TaskCompletionFixture supplies real retained producer evidence for runtime integration tests. Request identities may be replaced before admission.
func NewTaskCompletionFixture ¶
func NewTaskCompletionFixture(t *testing.T, backend store.Store, deferred bool) TaskCompletionFixture
NewTaskCompletionFixture commits a verified producer result. When deferred is true, the assignment remains working so the completion service must submit it.
Source Files
¶
- a2a_deferred_reply.go
- a2a_held_release.go
- a2a_recipient_discovery.go
- a2a_reply.go
- a2a_reservation.go
- a2a_resolution.go
- a2a_roster.go
- a2a_routing.go
- a2a_routing_upgrade.go
- agent_reply_discovery.go
- artifact_board.go
- artifact_board_service.go
- artifact_board_transactions.go
- assignment.go
- assignment_transaction.go
- bound_effects.go
- budget.go
- budget_partial_usage.go
- budget_transaction.go
- capture_intent.go
- checkpoint_sweep.go
- claim.go
- claim_budget_transaction.go
- claim_transaction.go
- conformance.go
- conversation_integrity.go
- coordination_events.go
- effect_continuation.go
- effect_continuation_faults.go
- effect_continuation_retirement.go
- effect_continuation_service.go
- effect_discovery.go
- effects.go
- evidence_fence.go
- execution_inputs.go
- learning.go
- learning_guard.go
- learning_retention_race.go
- leased_claim.go
- lifecycle_events.go
- orchestration_admission.go
- orchestration_budget.go
- orchestration_children.go
- orchestration_continuation.go
- orchestration_coordinator.go
- orchestration_execution.go
- orchestration_expiry.go
- orchestration_invocation.go
- plan_replan.go
- plan_replan_recovery.go
- planning.go
- planning_operator.go
- preparation.go
- prepared.go
- private_candidate.go
- provider_receipt.go
- provider_recovery_scan.go
- public_events.go
- ready_claim.go
- reflection.go
- reflection_history.go
- replan.go
- report_observations.go
- result_commit.go
- result_fence.go
- result_rollback.go
- result_snapshot.go
- resume_admission.go
- resume_closure.go
- resume_expiry.go
- review.go
- review_transaction.go
- run_call.go
- run_call_seal.go
- run_call_transactions.go
- run_candidate_lease.go
- run_continuation.go
- run_create.go
- run_principal.go
- run_progress.go
- run_recovery_concurrency.go
- run_recovery_snapshot.go
- run_recovery_transaction.go
- run_reply_route.go
- run_revision.go
- scheduler.go
- scope_boundary.go
- sealed_effect_recovery.go
- state_observation.go
- submission.go
- submission_transaction.go
- suspension_version.go
- task_acceptance.go
- task_adjudication.go
- task_adoption_crash.go
- task_adoption_lifecycle.go
- task_call_seal.go
- task_completion_abandonment.go
- task_completion_fixture.go
- task_completion_service.go
- task_contract.go
- task_dispatch.go
- task_recovery.go
- task_rejected_usage.go
- task_renewal.go
- task_retirement.go
- task_run.go
- task_settlement_history.go
- task_settlement_lifecycle.go
- task_terminal_settlement_lifecycle.go
- task_terminal_usage.go
- task_usage.go
- task_usage_closure.go
- task_usage_settlement.go
- terminal_events.go
- transcript.go
- verification.go
- verification_calls.go
- verification_capture.go
- verification_deadline.go
- verification_executor.go
- verification_jobs.go