Class MemoryStoreReachabilityValidator

java.lang.Object
com.tnsai.agents.validation.validators.MemoryStoreReachabilityValidator
All Implemented Interfaces:
ReachabilityValidator, Validator

public final class MemoryStoreReachabilityValidator extends Object implements ReachabilityValidator
AGENT-V010 — opt-in reachability probe for the configured MemoryStore.

Runs only when AgentBuilder.withReachabilityChecks(true) is set. Catches the case where the agent builds fine, runs the first turn, and dies mid-conversation because the backing memory store (file system path missing, database unreachable, S3 bucket permission missing) was never actually probed.

Behaviour matrix

Probe outcomes
StateOutcome
No memory store explicitly set on the builder Silent — build() will install the in-memory default after validation completes; nothing to probe
Store does not implement Healthcheckable Silent — the implementation has not opted into probeability and we will not synthesise a probe with side effects on conversation memory
Probe returns reachable=true Silent
Probe returns reachable=false WARNING with store-supplied error + observed latency
Probe throws (contract violation — implementations must convert failures to unreachable) WARNING; never propagates the exception

Severity is WARNING, not ERROR, on the same reasoning as LLMHealthcheckValidator: networks are transient, the user has explicitly opted in, and a transient blip should not block the build. Suppress with .relaxValidation("AGENT-V010") for environments where the probe-time store and runtime store legitimately diverge.

Since:
0.8.4 (issue #85 phase 2b)
  • Constructor Details

    • MemoryStoreReachabilityValidator

      public MemoryStoreReachabilityValidator()
  • Method Details

    • id

      public String id()
      Description copied from interface: Validator
      Short, stable id for logging and test assertions (e.g. "llm-presence").
      Specified by:
      id in interface Validator
    • validate

      public List<ValidationIssue> validate(ValidationContext ctx)
      Description copied from interface: Validator
      Inspect the agent configuration and return any issues detected. Returning an empty list means "no problems found by this validator".
      Specified by:
      validate in interface Validator
      Parameters:
      ctx - frozen view of the agent under construction
      Returns:
      zero-or-more issues; never null