Package org.mockserver.llm.analysis
Class AgentRunDiff
java.lang.Object
org.mockserver.llm.analysis.AgentRunDiff
Deterministic, prompt-level diff of two recorded agent runs. Each run is
reconstructed into its canonical
ParsedConversation (via
AgentRunAnalyzer.canonicalConversation(java.util.List<org.mockserver.model.HttpRequest>, org.mockserver.model.Provider)), every message's text is
normalised through PromptNormalizer (so cosmetic churn — whitespace,
JSON key order, volatile ids/timestamps — is not reported as a change), then
the two message sequences are aligned with a longest-common-subsequence diff.
Surfaces what changed between the runs: message-level additions / removals / edits, the tool calls that were added or removed, and the token / cost delta (when both sides carry usage totals, e.g. supplied from the two sides' optimisation reports).
Pure (no network, no LLM). The caller is responsible for redacting the requests before passing them in when the diff will be surfaced to a user.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final classA single message-level difference between the two runs.static final classThe full diff of two runs.static final classOne side of the diff: the recorded requests, the provider, and optional usage totals.static final classToken / cost deltas (after − before). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondiff(AgentRunDiff.RunSide before, AgentRunDiff.RunSide after, NormalizationOptions options) Diff thebeforerun against theafterrun, normalising prompt text withoptions(null means theNormalizationOptionsdefaults).
-
Constructor Details
-
AgentRunDiff
public AgentRunDiff()
-
-
Method Details
-
diff
public AgentRunDiff.RunDiffResult diff(AgentRunDiff.RunSide before, AgentRunDiff.RunSide after, NormalizationOptions options) Diff thebeforerun against theafterrun, normalising prompt text withoptions(null means theNormalizationOptionsdefaults).
-