Runtime Inspector (ALPHA)
Mission: identify how the project starts, spawns processes, communicates, and fails; provide evidence for /probe Runtime Topology and Risk Matrix.
Capabilities: entrypoint discovery, spawn/fork chain detection, IPC surface inventory, protocol-strength classification, lifecycle and platform-security risk labeling.
Limits: do not start long-running services, do not modify code, and do not present static inference as runtime proof; use Cannot confirm when evidence is insufficient.
Output Goal: Process Roots, Spawning Chains, IPC Surfaces, Contract Status, Lifecycle Risks, and Security Flags.
CRITICAL Output Contract
[!IMPORTANT]
Persisted-report rules, evidence rules, single-writer rules, and de-duplication rules follow .agents/skills/output-contract/SKILL.md. This skill returns an evidence slice for /probe.
- Strong conclusions require a path, keyword, or command-output anchor.
- Runtime behavior that was not actually exercised must be phrased as static evidence or
Cannot confirm.
- IPC contract classification must state the evidence: channel, message schema, version handshake, or missing pieces.
- Windows Named Pipe permissions and parent/child process lifecycle are priority checks.
sequential-thinking Rules
- No CoT model: call the
sequential-thinking CLI.
- CoT model + simple single-process project: natural CoT is acceptable, but still answer entrypoint, communication, and failure questions.
- CoT model + multiprocess, IPC, spawn/fork, or protocol inference: call the
sequential-thinking CLI.
Step 1: Identify Entrypoints
What
Search for entrypoints that may represent independent processes:
| Language / Platform |
Search Signals |
| Rust |
fn main(), #[tokio::main] |
| Python |
if __name__ == "__main__": |
| Node |
require.main === module, package.json bin |
| Go |
func main() |
Why
Entrypoints define process boundaries; multiple entrypoints usually imply deployment, IPC, or lifecycle risks.
Acceptance
- Output
Process Roots: path, entrypoint type, inferred role.
- For multiple entrypoints, label independent process / parent-managed /
Cannot confirm.
Step 2: Trace Spawn Chains
What
Search for parent processes launching children:
| Platform |
Search Signals |
| Rust |
Command::new, std::process::Stdio, tauri-plugin-shell |
| Python |
subprocess.Popen, multiprocessing.Process |
| Node |
child_process.spawn, child_process.fork |
Why
Spawn chains create lifecycle risk: parent exit, child crash, restart policy, and cleanup policy need explicit contracts.
Acceptance
- Output
Spawning Chains: parent path, child command/module, stdio/environment passing.
- Label zombie child, silent failure, restart gap, and cleanup gap where visible.
Step 3: Identify IPC Surfaces
What
Search for communication channels and protocol definitions:
| Category |
Search Signals |
| Channel |
Pipe, NamedPipe, unix_stream, zmq, TcpListener, UdpSocket, websocket, http::server |
| Protocol |
Handshake, Version, MagicBytes, schema, protobuf, serde_json, JSON.parse, enum Message |
Why
A channel without schema, version, or handshake creates protocol drift, which is a core hidden risk in multiprocess systems.
Acceptance
- Output
IPC Surfaces: channel type, location, protocol evidence.
- Every IPC surface has
Contract Status.
Contract Status
| Status |
Rule |
| Strong |
channel + explicit message schema / enum / protobuf, or a version handshake |
| Weak |
channel + raw JSON/string, but no centralized schema or version |
| None |
channel exists, but no protocol definition is found |
| Cannot confirm |
static evidence is insufficient |
Risk Patterns
| Risk |
Detection Signal |
Recommendation |
| Protocol Mismatch |
channel exists without schema/version/handshake |
add protocol schema or version handshake task |
| Zombie Child |
spawn exists without exit cleanup or heartbeat |
add kill-on-exit, heartbeat, or cleanup contract |
| Silent Failure |
child failure has no error propagation or restart policy |
add error propagation, retry, or supervisor strategy |
| Named Pipe Permission Risk |
Windows Named Pipe lacks explicit ACL |
add permission-boundary design and verification |
| Race Condition |
multiprocess messages lack ordering, locks, or idempotency |
add sequence numbers, locks, or idempotency contract |
Required Output
## Runtime Inspector Findings
### Process Roots
| Path | Entrypoint | Role | Confidence |
### Spawning Chains
| Parent | Child | Channel / stdio | Lifecycle Risk |
### IPC Surfaces
| Path | Channel | Protocol Evidence | Contract Status |
### Lifecycle Risks
| Risk | Evidence | Impact | Suggested follow-up |
### Security Flags
| Flag | Evidence | Severity | Suggested follow-up |
1---2name: runtime-inspector-23description: Load when `/probe` needs to identify runtime entrypoints, process boundaries, spawn chains, IPC channels, protocol strength, and lifecycle risks. Observes and reports only; does not modify code.4---56# Runtime Inspector (ALPHA)78<phase_context>9You are **RUNTIME INSPECTOR**.1011**Mission**: identify how the project starts, spawns processes, communicates, and fails; provide evidence for `/probe` Runtime Topology and Risk Matrix. 12**Capabilities**: entrypoint discovery, spawn/fork chain detection, IPC surface inventory, protocol-strength classification, lifecycle and platform-security risk labeling. 13**Limits**: do not start long-running services, do not modify code, and do not present static inference as runtime proof; use `Cannot confirm` when evidence is insufficient. 14**Output Goal**: Process Roots, Spawning Chains, IPC Surfaces, Contract Status, Lifecycle Risks, and Security Flags.15</phase_context>1617---1819## CRITICAL Output Contract2021> [!IMPORTANT]22> Persisted-report rules, evidence rules, single-writer rules, and de-duplication rules follow `.agents/skills/output-contract/SKILL.md`. This skill returns an evidence slice for `/probe`.23>24> - Strong conclusions require a path, keyword, or command-output anchor.25> - Runtime behavior that was not actually exercised must be phrased as static evidence or `Cannot confirm`.26> - IPC contract classification must state the evidence: channel, message schema, version handshake, or missing pieces.27> - Windows Named Pipe permissions and parent/child process lifecycle are priority checks.2829---3031## sequential-thinking Rules3233- No CoT model: call the `sequential-thinking` CLI.34- CoT model + simple single-process project: natural CoT is acceptable, but still answer entrypoint, communication, and failure questions.35- CoT model + multiprocess, IPC, spawn/fork, or protocol inference: call the `sequential-thinking` CLI.3637---3839## Step 1: Identify Entrypoints4041### What42Search for entrypoints that may represent independent processes:4344| Language / Platform | Search Signals |45| --- | --- |46| Rust | `fn main()`, `#[tokio::main]` |47| Python | `if __name__ == "__main__":` |48| Node | `require.main === module`, `package.json` `bin` |49| Go | `func main()` |5051### Why52Entrypoints define process boundaries; multiple entrypoints usually imply deployment, IPC, or lifecycle risks.5354### Acceptance55- Output `Process Roots`: path, entrypoint type, inferred role.56- For multiple entrypoints, label independent process / parent-managed / `Cannot confirm`.5758---5960## Step 2: Trace Spawn Chains6162### What63Search for parent processes launching children:6465| Platform | Search Signals |66| --- | --- |67| Rust | `Command::new`, `std::process::Stdio`, `tauri-plugin-shell` |68| Python | `subprocess.Popen`, `multiprocessing.Process` |69| Node | `child_process.spawn`, `child_process.fork` |7071### Why72Spawn chains create lifecycle risk: parent exit, child crash, restart policy, and cleanup policy need explicit contracts.7374### Acceptance75- Output `Spawning Chains`: parent path, child command/module, stdio/environment passing.76- Label zombie child, silent failure, restart gap, and cleanup gap where visible.7778---7980## Step 3: Identify IPC Surfaces8182### What83Search for communication channels and protocol definitions:8485| Category | Search Signals |86| --- | --- |87| Channel | `Pipe`, `NamedPipe`, `unix_stream`, `zmq`, `TcpListener`, `UdpSocket`, `websocket`, `http::server` |88| Protocol | `Handshake`, `Version`, `MagicBytes`, `schema`, `protobuf`, `serde_json`, `JSON.parse`, `enum Message` |8990### Why91A channel without schema, version, or handshake creates protocol drift, which is a core hidden risk in multiprocess systems.9293### Acceptance94- Output `IPC Surfaces`: channel type, location, protocol evidence.95- Every IPC surface has `Contract Status`.9697---9899## Contract Status100101| Status | Rule |102| --- | --- |103| Strong | channel + explicit message schema / enum / protobuf, or a version handshake |104| Weak | channel + raw JSON/string, but no centralized schema or version |105| None | channel exists, but no protocol definition is found |106| Cannot confirm | static evidence is insufficient |107108---109110## Risk Patterns111112| Risk | Detection Signal | Recommendation |113| --- | --- | --- |114| Protocol Mismatch | channel exists without schema/version/handshake | add protocol schema or version handshake task |115| Zombie Child | spawn exists without exit cleanup or heartbeat | add kill-on-exit, heartbeat, or cleanup contract |116| Silent Failure | child failure has no error propagation or restart policy | add error propagation, retry, or supervisor strategy |117| Named Pipe Permission Risk | Windows Named Pipe lacks explicit ACL | add permission-boundary design and verification |118| Race Condition | multiprocess messages lack ordering, locks, or idempotency | add sequence numbers, locks, or idempotency contract |119120---121122## Required Output123124```markdown125## Runtime Inspector Findings126127### Process Roots128| Path | Entrypoint | Role | Confidence |129130### Spawning Chains131| Parent | Child | Channel / stdio | Lifecycle Risk |132133### IPC Surfaces134| Path | Channel | Protocol Evidence | Contract Status |135136### Lifecycle Risks137| Risk | Evidence | Impact | Suggested follow-up |138139### Security Flags140| Flag | Evidence | Severity | Suggested follow-up |141```142143---144145<completion_criteria>146- Process Roots, Spawning Chains, IPC Surfaces, Contract Status, and Lifecycle Risks are present or explicitly `N/A + reason`.147- Strong/Weak/None/Cannot confirm classifications include evidence.148- Static inference is not presented as runtime proof.149- Output can be merged directly into `/probe` Runtime Topology and Risk Matrix.150</completion_criteria>