载入中...
搜索中...
未找到
PlayTrace.cpp
浏览该文件的文档.
18 return Result<void>::failure(Diagnostic::error(DiagnosticCode::ParseError, "unknown play-trace field",
47Result<std::string> stringField(const Value::Object& object, std::string_view name, std::string_view path) {
50 return Result<std::string>::failure(Diagnostic::error(DiagnosticCode::ParseError, "missing play-trace string",
74 if (version == root.value()->end() || !version->second.isInt64() || version->second.asInt() != kTraceVersion)
76 Diagnostic::error(DiagnosticCode::Unsupported, "unsupported play-trace schema", "recording.schemaVersion"));
79 Diagnostic::error(DiagnosticCode::Unsupported, "unsupported play-trace schema", "recording.schemaId"));
90 knownFields(*item.value(), {"capture", "hostFrame", "observationDigest", "request", "seq"}, itemPath);
95 Diagnostic::error(DiagnosticCode::ParseError, "trace step requires request", itemPath + ".request"));
119 return Result<Value>::failure(Diagnostic::error(DiagnosticCode::ParseError, "trace step must be an object",
177void PlayTraceBuffer::append(const Value& request, const Value& response, std::uint64_t hostFrame) {
Versioned Play Trace recording, digest and replay.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
const T * getIf() const noexcept
Return a typed pointer, or nullptr when the kind differs.
Definition Value.h:180
Injected runtime used by Play Host. Tests supply a fake; MCP uses the engine adapter....
Definition PlayHost.h:25
RAII flag so nested Play requests during replay are not recorded.
Definition PlayTrace.h:42
void begin(std::string contractId, std::string contractHash, std::int64_t seed, std::string startCheckpoint)
Begins .
Definition PlayTrace.cpp:167
void append(const Value &request, const Value &response, std::uint64_t hostFrame)
Append.
Definition PlayTrace.cpp:177
Definition AgentDevelopmentMcp.cpp:12
Result< Value > parsePlayTrace(const Value &recording)
Parse and reject unknown fields on a Play Trace recording.
Definition PlayTrace.cpp:63
Result< Value > replayPlayTrace(const Value &recording, IPlayHostRuntime &runtime)
Replay a parsed recording against a host runtime.
Definition PlayTrace.cpp:103
Result< std::string > playObservationDigest(const Value &state)
Canonical digest of a Play observation state object.
Definition PlayTrace.cpp:57
Result< Value > executePlayRequest(const Value &request, IPlayHostRuntime &runtime)
Execute one versioned Play request against an injected runtime.
Definition PlayHost.cpp:858
@ HashMismatch
@ Unsupported
@ Failed
@ ParseError