Skip to content

[SIM] - Unified calypso-sim binary with JSON-RPC streaming control plane #305

@bracyw

Description

@bracyw

Current Features

Two separate simulator binaries:

They duplicate the MQTT setup and publish path, they can't run at the same time, and there's no way for an agent to control either one.

Desired Additional Features

Replace both with a single calypso-sim binary (folder layout under src/bin/calypso-sim/) with four modes that can run together:

Flag Mode
--auto Autonomous heartbeat (default when no other mode is chosen)
--key-map FILE Interactive raw-mode keypress
--script FILE Replay keymap keys from a text file
--stream JSON-RPC 2.0 over stdio, for an agent

A per-topic owner field (auto / stream / silenced) lets stream and keymap modes claim / release / silence topics, and the autonomous loop skips topics it doesn't own. Stream methods: publish, claim, release, silence, status, list_topics, ping.

Acceptance Criteria

  • manual-sim and simulate are deleted; replaced by src/bin/calypso-sim/ modules.
  • All four modes work and can run together (--auto runs in the background while --key-map or --stream is active).
  • TopicRegistry tracks ownership; the autonomous tick checks it before publishing.
  • Stream mode implements the seven methods with JSON-RPC 2.0 errors.
  • Tracing goes to stderr; stdout is reserved for JSON-RPC and keymap logs.
  • Startup prints a list of topics with no sim_freq.
  • README documents the modes, keymap formats, and the stream protocol.
  • cargo clippy --bin calypso-sim is clean.

Out of Scope

Stream subscribe for observing other programs, VCU-style request/response, Unix-socket transport, compile-time unsim list.

Builds on #292.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions