PtcRunner.Kernel.InspectionQuery (PtcRunner v0.14.0)

Copy Markdown View Source

Pure, source-bound queries over validated private inspection records.

The compiler performs the joins once, before a snapshot publishes any capability. Capability inputs and outputs are paired by capability_id, and a validated input without an output is retained as an explicitly incomplete interrupted attempt. MCP request and response bodies remain paired by {capability_id, request_id}. Optional stdio mcp-stderr records join that same identity and project onto the exchange when present. Captured stdio exchanges are serialized per session so that join is one request's capture window, not a mix of concurrent calls. Callers therefore never join private records by timestamp or depend on file order beyond the artifact's validated sequence.

Every collection uses the same bounded page shape as canonical trace queries. Cursors are opaque, bind the immutable source identity, operation, filters, ordering, and offset, and cannot be reused against another query or capture. The requested item limit is an upper bound: a page returns the largest prefix whose final encoded and retained sizes both fit the result ceiling. Run-scoped private collections accept "order": "asc" | "desc"; ascending sequence order is the default.

Inspection artifacts retain their versioned bare-hex source hashes. Query results expose those hashes with the sha256: algorithm prefix required by trusted component-override descriptors, so an effective-prelude result can be copied into base_source_hash without reinterpretation.

Execution-phase diagnostics (execution-prints, execution-error, explicit-failure-value) are exposed as run-scoped collections alongside their counts in each list_runs row. Their items retain the correlated evaluation_id, sequence, timestamp, environment, and exact bounded diagnostic payload. Projections include mission_name on every mission-owned result so repeated component and capability names remain unambiguous. V8 adds the dedicated explicit-failure-value collection. V7 added correlated private callback exception diagnostics to capability attempts. V6 added one singular, non-paginated terminal result projection per run and joins static prelude-call analysis to generated source by evaluation_id. Generated source and reconstructed turns copy the canonical parent_evaluation_id edge rather than inferring one from snapshot-local sequence numbers. Execution errors and generated sources add typed, state-bearing navigation relationships only from validated identities, direct boundary-value provenance, and exact source/prelude associations.

Summary

Types

operation()

@type operation() ::
  :list_runs
  | :get_run
  | :turns
  | :model_exchanges
  | :capability_calls
  | :generated_sources
  | :effective_preludes
  | :provider_exchanges
  | :execution_prints
  | :execution_errors
  | :explicit_failure_values
  | :result