Skip to content

[CLI-001] Create runtime cli_bridge.py #3

@AdeGneus

Description

@AdeGneus

Context

The CLI must delegate runtime-owned config, skill, and state operations to a Python bridge in the runtime repo instead of parsing runtime internals in Go.

Scope

  • Create ori.cli_bridge in ori-runtime.
  • Define bridge commands for config-validate, config-show, skills-list, skills-validate, and health/state primitives.
  • Return structured JSON with stable error codes.

Non-Goals

  • Does not implement CLI command UX.
  • Does not duplicate runtime config parsing outside runtime.

Technical Specification

Bridge is invoked as python3 -m ori.cli_bridge <command> [args...] and writes one JSON object to stdout. Non-zero exit codes include JSON error payloads.

Acceptance Criteria

  • Bridge commands exist and return deterministic JSON.
  • Runtime tests cover success and failure.
  • CLI repo issue CLI-002 can call the bridge.

Tests Required

Test Verifies
test_cli_bridge_config_validate Config validation command.
test_cli_bridge_error_payload Structured errors.

Additional Test Coverage / Edge Cases

  • Bridge returns structured JSON for both success and failure paths.
  • Unknown bridge command returns non-zero exit with typed error payload.
  • Invalid runtime config path produces deterministic validation error.
  • Bridge stdout contains JSON only; logs/errors go to stderr.
  • Bridge commands do not mutate runtime state unless the command explicitly owns mutation.

Invariants — Do Not Violate

  • Runtime remains authority for config and skill validation.

Dependencies

Blocked by:

  • Nothing

Unblocks:

Contract References

  • Runtime ori.cli_bridge contract

Priority

poc-critical

Suggested Labels

ready, poc-critical, runtime-impact

Metadata

Metadata

Assignees

No one assigned

    Labels

    poc-criticalMust be complete before PoC deployment.readyAll dependencies met. Can be picked up now.runtime-impactRequires follow-up PR in ori-runtime.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions