CounterSubject

org.llm4s.agent.testkit.LongTermStoreContract.CounterSubject
final class CounterSubject(val name: String, store: LongTermStore, applied: () => Int) extends Subject

A ReplayContract.Subject over a store's transactional modify: slot n is the item slot-<n> of the namespace counters, and the effect increments the number it holds inside the store's transaction, so a second application shows and a replay the store answers from its applied key does not. applied counts the store's applied keys, as LongTermStoreContract.appliedKeys does.

Attributes

Source
LongTermStoreContract.scala
Graph
Supertypes
trait Subject
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def appliedKeys: Int

How many applied keys a Transactional target still holds; 0 for other targets.

How many applied keys a Transactional target still holds; 0 for other targets.

Attributes

Definition Classes
Source
LongTermStoreContract.scala
def initial(slot: Int): String

What observe shows before the effect.

What observe shows before the effect.

Attributes

Source
LongTermStoreContract.scala
def interfere(slot: Int): Unit

Another writer's change, straight to the store, leaving no applied key.

Another writer's change, straight to the store, leaving no applied key.

Attributes

Source
LongTermStoreContract.scala
def observe(slot: Int): Result[String]

The observable state of slot slot's part of the target.

The observable state of slot slot's part of the target.

Attributes

Source
LongTermStoreContract.scala
def once(slot: Int): String

What observe shows once the effect has been applied exactly once.

What observe shows once the effect has been applied exactly once.

Attributes

Source
LongTermStoreContract.scala
def perform(context: RunContext, slot: Int): Result[Value]

Performs effect slot under context through the target's guarded code path - building its key with context.effectKey - and returns its outcome as JSON, or the guard's Left.

Performs effect slot under context through the target's guarded code path - building its key with context.effectKey - and returns its outcome as JSON, or the guard's Left.

Attributes

Source
LongTermStoreContract.scala

The support class this subject exercises.

The support class this subject exercises.

Attributes

Source
LongTermStoreContract.scala

Inherited methods

Whether the effect may run again (the tool's ToolHints.idempotent); only Unverifiable reads it.

Whether the effect may run again (the tool's ToolHints.idempotent); only Unverifiable reads it.

Attributes

Inherited from:
Subject
Source
ReplayContract.scala

Concrete fields

val name: String

Names the target in the suite's output.

Names the target in the suite's output.

Attributes

Source
LongTermStoreContract.scala