Skip to content

feat(apps/cli): first rust binary on new layout — ctm metrics end-to-end (task #143 slice 1) - #1559

Merged
joelteply merged 1 commit into
canaryfrom
feat/apps-cli-skeleton
Jun 9, 2026
Merged

feat(apps/cli): first rust binary on new layout — ctm metrics end-to-end (task #143 slice 1)#1559
joelteply merged 1 commit into
canaryfrom
feat/apps-cli-skeleton

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

First slice of task #143 (Rust-first clients — rewrite jtag CLI in Rust). The apps/cli slot was a placeholder README per the Stage 1-2.5 layout sweep; this PR lands the first real rust binary on it.

What lands

apps/cli/
├── Cargo.toml            new crate, binary name `ctm`
├── README.md             status / install / usage / architecture
└── src/main.rs           clap CLI + Connection::connect + metrics subcmd

Workspace member added at root Cargo.toml under a new apps/ tier section (sibling to client/).

One subcommand wired end-to-end

$ ctm metrics --peer <substrate-uuid>
{
  "modules": [...],
  "count": N
}

The wire path:

  1. Cli::parse() extracts --peer / --home / CONTINUUM_PEER_ID / CONTINUUM_AIRC_HOME.
  2. Airc::open($HOME/.airc) opens the human's airc citizen.
  3. Connection::connect(Arc::new(airc), peer_uuid) builds the substrate session.
  4. .commands().execute("runtime/metrics/all", {}) round-trips through AircIpcTransport.
  5. continuum-core-server's CommandRequestHandler::parse_envelope decodes, RuntimeModule dispatches, send_reply ships the response.

Every byte of that path is the SAME path core/continuum-core/tests/airc_ipc_roundtrip.rs verifies — no new wire, just a new caller.

Why this matters

  • First rust binary in the apps/ tier — proves the substrate-first architecture works end-to-end from a real binary.
  • Same continuum-client seam every future apps/{web, mcp, mobile, ar, vr, desktop} will consume.
  • Migration path for ./jtag is now incremental: each future PR adds one ctm <subcommand>, the Node ./jtag shrinks.

Verified

cargo build -p continuum-cli           → clean (31s cold, 2s incremental)
ctm --help                             → prints usage cleanly
ctm metrics                            → typed error: "--peer is required"

Runtime tests against a live substrate are a follow-up — the wire path is already proven by the integration test that just merged.

Pending follow-ups (in README.md)

  • Auto peer discovery (read ~/.continuum/peer.json or airc ipc-endpoint).
  • More subcommands (chat/send, gpu/stats, data/list, persona/list).
  • Shell shim install (tools/scripts/install-cli.sh, jtag alias).

Test plan

  • cargo build -p continuum-cli
  • ctm --help
  • ctm metrics (without --peer; typed error)
  • ctm metrics against a running continuum-core-server (manual)
  • CI green

…nd-to-end (task #143 slice 1)

The apps/cli slot was a placeholder README per PR #1557. This commit
lands the first real rust binary on it: `ctm`, the substrate-first CLI.

apps/cli/
├── Cargo.toml            continuum-cli crate, binary name `ctm`
├── README.md             status / install / usage / architecture
└── src/main.rs           clap CLI + Connection::connect + metrics subcmd

Workspace member added at root Cargo.toml under the new `apps/` tier
section (sibling to `client/continuum-client`).

One subcommand wired end-to-end:
  ctm metrics    →  Connection::connect(airc, peer)
                       .commands()
                       .execute("runtime/metrics/all", {})
                    →  pretty-print JSON

Every byte of the wire path is the SAME path the cross-airc integration
test verifies (core/continuum-core/tests/airc_ipc_roundtrip.rs): client
serializes via continuum-airc-protocol, airc-lib frames + LANs it,
substrate's CommandRequestHandler::parse_envelope decodes it, dispatches
through the local executor (RuntimeModule's runtime/metrics/all), and
substrate's send_reply ships the response back. No new wire — just a
new caller.

CLI identity model per [[personas-are-citizens-airc-is-identity-provider]]:
the human invoking `ctm` is the airc citizen. CLI opens their existing
airc home (default `$HOME/.airc`, overridable via `--home` /
`CONTINUUM_AIRC_HOME`) and targets the substrate's peer UUID via
`--peer` / `CONTINUUM_PEER_ID`. Auto-discovery is pending — first slice
takes the UUID explicitly.

Verified:
  cargo build -p continuum-cli           → clean (31s cold, 2s incremental)
  ctm --help                             → prints usage cleanly
  ctm metrics                            → typed error: "--peer is required"
  ctm metrics --peer <bad UUID>          → typed error from airc layer
                                           (untested with running substrate; that's
                                            a runtime concern not a build slice)

Pending follow-ups documented in apps/cli/README.md "Pending follow-ups":
  - peer auto-discovery (read ~/.continuum/peer.json or airc ipc-endpoint)
  - more subcommands (chat/send, gpu/stats, data/list, persona/list, etc)
  - shell shim install + `jtag` → `ctm` alias

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@joelteply
joelteply merged commit fd3902e into canary Jun 9, 2026
2 checks passed
@joelteply
joelteply deleted the feat/apps-cli-skeleton branch June 9, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant