Skip to content

feat(apps/cli): ctm grid-smoke v1 — coverage battery for grid-shipped substrate commands - #1564

Merged
joelteply merged 1 commit into
canaryfrom
feat/ctm-grid-smoke
Jun 9, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/ctm-grid-smoke

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What this PR adds

ctm grid-smoke — a coverage battery that systematically dispatches grid-shipped substrate commands at a target peer and reports pass/fail + wall-clock latency per row.

export CONTINUUM_PEER_ID=<5090-peer-uuid>
ctm grid-smoke

🔌 Grid smoke — target peer a9b...

  ✅  runtime/metrics/all                12 ms   18 modules reporting
  ✅  ai/providers/list                  19 ms   3 provider(s) registered
  ✅  ai/generate (one-word reply)      847 ms   model=qwen3.5-4b text="Hello." (truncated)

3/3 passed  (0 failed, 0 skipped)

Nonzero exit on any spec failure so CI / scripts can gate on the report directly.

Why this exists

PR #1563 closed the wire proof for ai/generate end-to-end through the real substrate stack. The Tron-grid frame says ANY substrate command should compose across the grid — and what's still missing is a systematic battery that says: for each grid-eligible command, does it work against the target peer right now?

This PR is the v1 of that battery. Single-hop only (caller → target peer → caller). v2 adds multi-hop composition (M → A → B → C), fan-out, and mixed-modality chains via probe-trace ingestion.

Design (forward-compatible to v2)

pub struct GridSmokeSpec {
    pub name: &'static str,
    pub path: &'static str,
    pub params: fn() -> Value,
    pub validate: fn(&Value) -> Result<String, String>,
    pub expectation: ChainShape,
}

pub enum ChainShape {
    SingleHop { peer_label, path },     // v1
    Composition { hops: Vec<...> },     // v2: M -> A -> B -> C
    FanOut { path, min_peers },         // v2: A dispatches to N peers
    NotYetWired { reason },             // pin commands that can't cross wire today
}

The v2 variants are declared now so v2 is an additive enum extension, not a rewrite. The unused fields carry #[allow(dead_code)] with a doc-comment naming why.

The v1 battery (3 rows, each proves a different stack layer)

  1. runtime/metrics/all — substrate alive. If this fails, the rest is meaningless.
  2. ai/providers/list — AI subsystem alive + introspectable. Distinguishes "no adapter registered" from "unreachable peer".
  3. ai/generate (one-word reply) — real inference dispatch. The validator just confirms wire-shape; the operator reads the summary line to see WHO answered (qwen3.5? heuristic? Claude?).

Adding rows = appending to default_battery(). No new test crate per command.

What v2 adds (NOT in this PR)

  • Probe-sink trace ingestion across all involved peers — read ~/.continuum/probes/*.jsonl from local AND a debug/probes/list dispatch at remote — reconstruct the dispatch chain, validate against ChainShape::Composition
  • Catches: silent grid-bypass, hop latency attribution, cycle detection, cross-modality chains

Verified

  • cargo build -p continuum-cli clean (2.04s)
  • ctm --help + ctm grid-smoke --help render correctly
  • Live test against a real running substrate peer is a follow-up integration step (CI runs without a peer)

Doctrinal alignment

  • [[host-the-seemingly-impossible]] — the Tron-grid frame at the CLI seam
  • [[commands-are-kernel-level-and-compose]] — harness doesn't care WHICH command; same Commands.execute() primitive
  • [[no-fallbacks-ever]] — failure rows surface the dispatch error verbatim; nonzero exit means failure is loud

Note: canary drift

While building this I noticed PR #1561 (ctm generate) ended up squash-merged to main not canary despite the retarget. Canary's apps/cli/src/main.rs only has Metrics. This PR builds on canary's actual state and doesn't reintroduce Generate; a follow-up PR will need to bring ctm generate back to canary (cherry-pick from main or re-PR). The grid-smoke battery uses ai/generate via the underlying Connection seam regardless — independent of whether the ctm generate CLI subcommand exists.

🤖 Generated with Claude Code

…rid-smoke` v1 + wire-contract test

Earlier today PR #1561 (`ctm generate` + the wire-contract regression
test) was retargeted from `main` to `canary` via `gh pr edit`, but
the retarget didn't take effect on merge — the squash ended up on
`main`. Canary's `apps/cli/src/main.rs` only had `Metrics`.

A direct cherry-pick of the squash commit was infeasible (the
feat/ctm-ai-generate branch was based on an old main, so the squash
diff carried 2386 files / 182k+ insertions of main↔canary
divergence). Reconciliation by re-applying the relevant files
directly from `origin/main`:

  - apps/cli/src/main.rs:                    full version from main
    (includes `Generate` subcommand, current_thread runtime, AircIpcTransport
    direct import) PLUS the grid-smoke wiring from this PR.
  - apps/cli/README.md:                      main's two-row table
    extended with the grid-smoke row.
  - core/continuum-core/tests/cli_wire_contract.rs:  3-test wire-contract
    regression file (the negative test pinning PR #1561 R1's "object
    content shape would fail to decode as MessageContent" bug).
  - apps/cli/src/grid_smoke.rs:              the grid-smoke module
    landing on this PR (the original v1 from the previous commit on
    this branch; unchanged).

Net effect on canary, vs PRE-reconciliation canary HEAD:
  - `ctm generate` works (PR #1561's CLI work back where it should be)
  - `ctm grid-smoke` v1 lands (this PR's new feature)
  - `cli_wire_contract.rs` regression test pins the wire shape (R1 follow-up
    from PR #1561)

Verified:
  cargo build  -p continuum-cli                                       -> clean (2.33s)
  cargo test   -p continuum-core --features metal,accelerate
    --test cli_wire_contract                                          -> 3/3 passed (0.00s)
  ctm --help shows all three subcommands.

## Process note

Joel called this out: I'd been moving too fast and let `main` drift
ahead of `canary`. Going forward I'll verify the merge-target after
every squash merge — `gh pr view <num> --json mergeCommit,baseRefName`
catches retarget-didn't-stick before the next PR is built on a stale
canary.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@joelteply
joelteply force-pushed the feat/ctm-grid-smoke branch from 957cfc8 to c031151 Compare June 9, 2026 02:59
@joelteply
joelteply merged commit 67b4f75 into canary Jun 9, 2026
2 checks passed
@joelteply
joelteply deleted the feat/ctm-grid-smoke branch June 9, 2026 03:00
@github-actions github-actions Bot added size: XL and removed size: L labels Jun 9, 2026
joelteply added a commit that referenced this pull request Jun 9, 2026
…ode + docs

Joel called this out: is 5090 coded into the repo? Yes — GPU-specific
narrative and operator-personal labels leaked into substrate source,
test fixtures, and doc-strings across today's PRs (#1560, #1561,
#1563, #1564). None were load-bearing, but the repo should be
hardware-agnostic.

Replacements (one PR, surgical edits):

  core/continuum-core/src/inference/airc_remote/adapter.rs
    - doc: "route to Joel's 5090" -> generic remote-inference-peer description
    - test fixture: "joels-5090" -> "test-remote-peer"

  core/continuum-core/src/inference/airc_remote/transport.rs
    - test fixture: "joels-5090" (2 sites) -> "test-remote-peer"

  core/continuum-core/tests/airc_remote_inference_roundtrip.rs
    - doc: "airc://<rtx5090>/ai/generate" -> "airc://<remote-peer>/ai/generate"
    - peer labels generic: "remote inference host" / "local caller"
    - canned response: "pong from the remote peer" / "test-model" /
      "test-remote-llamacpp"

  apps/cli/src/main.rs
    - Generate doc: "(e.g., the operator's 5090)" -> generic GPU-rich grid host

  apps/cli/src/grid_smoke.rs
    - module doc + ai/generate row comment: "constrained-locally host
      dispatches at a GPU-rich peer" / "If the target is a GPU host
      running a real LLM"

Out of scope:
  - Older codebase doctrine attributions ("Joel's never-swallow-errors")
    stay — those name doctrine origin, fine.
  - Task #85 mentioning 5090 stays — it's a real airc bug ticket about
    that hardware.

Verified:
  grep -rn "5090|joels-" on touched files -> zero hits
  cargo check -p continuum-cli            -> clean (1.94s)

The pattern lesson: any hardware-specific identity is narrative
scaffolding, not substrate truth. The substrate is hardware-agnostic;
tests use neutral labels; docs describe categories, not specific units.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
joelteply added a commit that referenced this pull request Jun 9, 2026
…ode + docs (#1565)

Joel called this out: is 5090 coded into the repo? Yes — GPU-specific
narrative and operator-personal labels leaked into substrate source,
test fixtures, and doc-strings across today's PRs (#1560, #1561,
#1563, #1564). None were load-bearing, but the repo should be
hardware-agnostic.

Replacements (one PR, surgical edits):

  core/continuum-core/src/inference/airc_remote/adapter.rs
    - doc: "route to Joel's 5090" -> generic remote-inference-peer description
    - test fixture: "joels-5090" -> "test-remote-peer"

  core/continuum-core/src/inference/airc_remote/transport.rs
    - test fixture: "joels-5090" (2 sites) -> "test-remote-peer"

  core/continuum-core/tests/airc_remote_inference_roundtrip.rs
    - doc: "airc://<rtx5090>/ai/generate" -> "airc://<remote-peer>/ai/generate"
    - peer labels generic: "remote inference host" / "local caller"
    - canned response: "pong from the remote peer" / "test-model" /
      "test-remote-llamacpp"

  apps/cli/src/main.rs
    - Generate doc: "(e.g., the operator's 5090)" -> generic GPU-rich grid host

  apps/cli/src/grid_smoke.rs
    - module doc + ai/generate row comment: "constrained-locally host
      dispatches at a GPU-rich peer" / "If the target is a GPU host
      running a real LLM"

Out of scope:
  - Older codebase doctrine attributions ("Joel's never-swallow-errors")
    stay — those name doctrine origin, fine.
  - Task #85 mentioning 5090 stays — it's a real airc bug ticket about
    that hardware.

Verified:
  grep -rn "5090|joels-" on touched files -> zero hits
  cargo check -p continuum-cli            -> clean (1.94s)

The pattern lesson: any hardware-specific identity is narrative
scaffolding, not substrate truth. The substrate is hardware-agnostic;
tests use neutral labels; docs describe categories, not specific units.

Co-authored-by: Claude Opus 4.7 <[email protected]>
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