Skip to main content

Module runtime

Module runtime 

Source
Expand description

Generic runtime smoke-probe scheme (PSP-8).

Build + unit tests passing does not prove the produced artifact runs: a CLI can panic on startup, a library can fail at import, an entrypoint can crash on a code path no unit test exercised. This module is the language-neutral scheme for exercising built artifacts at runtime and turning failures into typed ResidualClass::Runtime residuals, so they feed the same energy + directed correction loop as compiler/test residuals instead of slipping through.

The split mirrors the rest of perspt-coding: an adapter describes the smoke invocations and classifies their output, but the runtime is what actually executes them (it owns process spawning, timeouts, and sandboxing). Each crate::lang::LanguageAdapter gets default no-op implementations and overrides them for its language, so new language plugins extend the scheme by implementing two methods.

Structs§

SmokeInvocation
A single smoke invocation: a shell command run from the workspace root to exercise a built artifact’s runtime entrypoint.

Functions§

crash_marker
Detect a genuine runtime crash in combined stdout+stderr, independent of exit code. Returns the offending line when found. Covers the common cross-language crash signatures (Rust panics/aborts, Python tracebacks, native faults).
default_classify_runtime
Default classification shared by adapters: a smoke invocation fails when it exits non-zero (and failure_on_nonzero) or its output carries a crash marker. Returns at most one residual per invocation.
numeric_anomaly
Detect a numeric anomaly (NaN / infinity) in an artifact’s output — a strong signal of a scientific-computing/ML defect (divergence, divide-by-zero, unnormalized features). Token-based to avoid substring false positives like “banana” (contains “nan”) or “info” (contains “inf”). Returns the token found.
runtime_residual
Build a ResidualClass::Runtime residual for a failed smoke invocation.
runtime_sensor
The sensor that produced a runtime residual. A real process run is a deterministic-tool route (full-weight eligible), not a model critique.