Documentation
¶
Overview ¶
Package probe provides shared capability-probe scaffolding: execution bounded to the probe's owned process group, the deterministic MCP fixture, and probe directory helpers.
Index ¶
- Constants
- func CreateDir(tmpRoot string, provider string, probedAt time.Time) (string, error)
- func ExitCode(err error) int
- func FixtureInvoked(markerPath string) bool
- func Run(ctx context.Context, cmd *exec.Cmd) error
- func RunMCPFixture(ctx context.Context) error
- func WriteOutputs(probeDir string, provider string, stdout []byte, stderr []byte) error
Constants ¶
const ( // FixtureSubcommand is the hidden al subcommand that serves the fixture. FixtureSubcommand = "__probe-mcp-fixture" // FixtureToolName is the single harmless tool the probe fixture exposes. FixtureToolName = "probe_ping" // FixtureToolReply is returned by the fixture tool. It is unique so probe // output cannot be confused with any other text. FixtureToolReply = "PROBEMCPTOOL33" // FixtureMarkerEnvVar names the file the fixture touches when its tool runs. // A marker file is stronger evidence than transcript text: it proves the // client actually executed the tool rather than describing it. FixtureMarkerEnvVar = "AL_PROBE_MCP_MARKER" // FixtureInvokedEvidence is the evidence recorded when FixtureInvoked // confirms the client executed the fixture tool. FixtureInvokedEvidence = "mcp fixture: " + FixtureToolName + " was invoked by the client" )
Variables ¶
This section is empty.
Functions ¶
func CreateDir ¶ added in v1.1.0
CreateDir creates a unique provider probe directory under tmpRoot, creating tmpRoot first when needed. The returned path is absolute.
func ExitCode ¶ added in v1.1.0
ExitCode maps a Run error to the exit code a probe result reports: 124 for cancellation or deadline, the process exit code, or -1 when the process never produced one.
func FixtureInvoked ¶ added in v1.1.0
FixtureInvoked reports whether the marker at markerPath holds exactly the fixture reply, so an absent or unrelated file never counts as an invocation.
func Run ¶
Run owns a new process group until all signaling is finished, then reaps its leader once. Callers supply a plain command, output writers and probe context.
func RunMCPFixture ¶ added in v1.1.0
RunMCPFixture serves a minimal, deterministic MCP server over stdio for capability probes. It completes protocol initialization and exposes exactly one harmless tool, so a failed discovery or tool call is evidence about the client rather than about the fixture.
Types ¶
This section is empty.