Skip to content

[P0][Runtime Bridge] Resolve the canonical simplicio binary and verify MCP capabilities before effects #692

Description

@wesleysimplicio

Objective

Make the Loop RuntimeBridge start the actual published Runtime binary reliably on clean installations and fail with actionable diagnostics before any effect is attempted.

The Runtime package publishes the executable named simplicio, while RuntimeBridge currently defaults to simplicio-runtime. This works only with an undocumented wrapper or SIMPLICIO_RUNTIME_BIN override.

Implementation steps

  1. Define canonical binary resolution order: explicit constructor value, SIMPLICIO_RUNTIME_BIN, installed simplicio, then documented legacy aliases.
  2. Never resolve the Loop's own executable or an arbitrary PATH collision as Runtime.
  3. Probe version and compiled identity before starting MCP.
  4. Start simplicio serve --mcp --stdio --json and complete initialize/initialized.
  5. Call capabilities/tools-list and require the exact tools needed by the requested execution route.
  6. Validate MCP protocol version, Runtime version range, effect transaction schema and HBI/HBP compatibility.
  7. Cache the verified binary identity per executable hash, invalidating on file replacement.
  8. Add doctor output with resolved path, version, SHA, capabilities and exact repair command.
  9. Preserve Runtime-optional Loop operation; only Runtime-backed routes require the binary.
  10. Remove silent fallback when the user explicitly selected Runtime execution.

Tests

  • PyPI-installed Runtime exposing only simplicio.
  • Explicit valid/invalid SIMPLICIO_RUNTIME_BIN.
  • Legacy alias available.
  • PATH collision and wrong product identity.
  • Old/incompatible Runtime version.
  • Missing required MCP tool.
  • MCP protocol mismatch and malformed tools/list.
  • Paths with spaces and Windows executable suffix.
  • Binary replaced while a session is alive.
  • Clean Linux/macOS/Windows fixtures.

Acceptance criteria

  • Default clean installation resolves simplicio without an environment override.
  • The exact executable identity and SHA are recorded in the run receipt.
  • Missing/incompatible Runtime fails before mutation with one exact repair instruction.
  • Runtime-optional Loop paths remain usable without Runtime.
  • Explicit Runtime selection never silently falls back to direct subprocess execution.
  • Capability negotiation is versioned and tested.
  • No orphan process remains after probe failure.
  • Local/container tests require no paid GitHub Actions.

Relations

  • Runtime machine-readable manifest: wesleysimplicio/simplicio-runtime#3043
  • Runtime warm path: wesleysimplicio/simplicio-runtime#2983

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions