Repository navigation
refactor(cli): fold gateway into call, drop the local-command machinery - #16
Conversation
`sealg` is a thin MCP client to the gateway, so `call` now hits the gateway `tools/call` (replacing the old local demo-command registry) and `gw-call` is gone. Command surface is now: init, mcp (stub), doctor, list, call. - `call <tool> [--args] [--gateway-url]` → gateway tools/call (pretty-prints the MCP result, exits 6 on isError, 1 on transport error). - `list [--gateway-url]` → gateway tools/list (keeps --json). - `--gateway-url` overrides the gateway origin over `GatewayConfig::from_env()` via new `from_env_with_url_override` (trims a trailing `/`, ignores blank). - Remove the local-command machinery entirely: `engine::commands` (Command/ Expose/CommandRegistry + all demo commands), `scenario`, `probes`, and the now-dead `context`/`traits`/`platform` (doctor needs none of them). `doctor` keeps working on env facts; the `gateway` module and its tests are untouched. - Drop the `new` scaffold command + template, and the `probe`/`run-scenario` subcommands and their diagnostics handlers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
Update the root/cli/engine READMEs, CLAUDE.md, and the Makefile to describe the thin MCP-client model (list/call/doctor/init) and drop references to the removed local `call`, `gw-call`, `probe`, `run-scenario`, and `new` subcommands. Removes the now-dead `make new` target. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
The mcp subcommand stub referenced the deleted local command registry, `sealg serve`, and `new`. Reword it as a placeholder for a future local stdio MCP transport that bridges an MCP client to the gateway. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
There was a problem hiding this comment.
All reported issues were addressed across 27 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
There was a problem hiding this comment.
1 issue found across 27 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="README.md">
<violation number="1" location="README.md:51">
P3: The rewritten architecture diagram is misaligned: the first box's content lines (e.g. `sealg list ...`) are one character narrower than the box's own border, and the vertical connectors (`engine::gateway`, `HTTPS`) sit one column right of the `┬`/`▼` glyphs they join, with the two boxes having different widths. Rendered in markdown the diagram looks broken. Pad each content line of the first box by one space so its right `│` lines up with the border's `┐`/`┘`, and shift the `│` connectors left by one column so they line up under the `┬` glyphs.</violation>
</file>
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
`sealg init` was Rust-CLI-template machinery for onboarding the template into a real project - no place in the shipped gateway client. Remove it so the command surface is exactly mcp | doctor | list | call. - Drop the `Init` variant, dispatch arm, and `mod init;` from main.rs; update the crate doc comment. - Delete the entire crates/cli/src/init/ module. - Remove now-unreferenced deps from crates/cli/Cargo.toml: dialoguer, walkdir, toml_edit, comfy-table, serde_yaml, anyhow, and the tempfile dev-dependency (all were used only by init). - Update README.md, crates/cli/README.md, and the Makefile to match the mcp | doctor | list | call surface (drop the `init` make target). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
Regenerate the ASCII diagram with uniform box widths and the vertical connectors aligned under the ┬/▼ glyphs (cubic review on #16). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/cli/src/main.rs">
<violation number="1" location="crates/cli/src/main.rs:33">
P1: The new command enum drops `Init`, so `sealg init` now fails as an unknown subcommand even though this PR promises to retain it. Restore the init module and variant, or update the CLI contract and documentation consistently.</violation>
</file>
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 36 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/engine/src/gateway/config.rs">
<violation number="1" location="crates/engine/src/gateway/config.rs:73">
P3: An override that trims down to an empty string silently produces an empty `base_url`. `u.trim()` on `/`, `///`, or `/?x` is non-empty, and `trim_end_matches('/')` then yields `""`, so `cfg.base_url` becomes empty and `mcp_url()` becomes `/mcp/` instead of falling back to the env/default. Guard the trimmed value with a non-empty check before assigning, so a degenerate override is ignored like a blank one.</violation>
</file>
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
An override like `/` or `///` passed the non-blank guard but
trim_end_matches('/') then yielded "", leaving base_url empty and mcp_url()
= /mcp/. Trim first, then check non-empty, so a degenerate override is
ignored like a blank one. Added a test.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
Drop the inherited-template `sealg mcp` stub (it did nothing but print a not-implemented notice). The command surface is now `doctor | list | call`. Removes crates/cli/src/mcp.rs, the Mcp variant + dispatch, and the doc references (READMEs, architecture diagram, HUMANS_SHOULD_TEST). MCP-protocol code in the gateway client is untouched. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
Remove two isolated template scaffolding crates that were unused: - crates/assetgen (asset-gen banner/logo generator) - crates/config (app-config crate) After deletion, workspace contains exactly two members: - crates/engine (gateway client + config, doctor env facts, stable result contract) - crates/cli (sealg binary with doctor/list/call surface) Updated: - Cargo.toml: removed both crates from [workspace] members - Makefile: removed banner/logo targets and updated bump-version - README.md: removed Config row from features table, removed config/assetgen architecture bullets, removed entire Configuration section - CLAUDE.md: removed crates/config reference from Architecture section, removed Configuration Pattern section Verified: - cargo build --workspace passes - cargo clippy --workspace --all-targets -- -D warnings passes - cargo test --workspace passes (12 tests) - cargo fmt --all passes - sealg release binary unchanged: still lists doctor, list, call commands
The crate-removal commit deleted CLAUDE.md's Configuration Pattern section (it documented the removed app-config crate), which the agents_validate CI check requires. Replace it with an accurate section describing sealg's real config: env-resolved GatewayConfig (SEALGATE_* vars, CENTAUR_THREAD_KEY, CA bundle, --gateway-url). Re-synced AGENTS.md via make sync-agent-config. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpwFmgQPfugKFF9zugay6Y
Summary
Collapses
sealgto its intended thin shape: a client to the SealGate gateway, nothing more.sealg call <tool>now is the gatewaytools/call(previously it ran a local demo-command registry, and the gateway call lived under a separategw-call). Connection overrides like pointing at a local instance are a flag, not a subcommand. All the Rust-CLI template's onboarding/scaffolding/stub machinery is deleted.Final command surface:
doctor | list | call.Changes
callis the gateway call:sealg call <tool> [--args '<json>'] [--gateway-url <url>]→ MCPtools/call. Pretty-prints the result; exits6on an MCPisError: trueresult,1on transport failure.gw-callremoved.--gateway-url: overrides the gateway base URL (default$SEALGATE_URL, else localhost) for local/other instances. Implemented asGatewayConfig::from_env_with_url_override(trims trailing/, ignores blank and degenerate all-slash values; unit-tested). No other flags — API key / secret stay env-only.listgains the same--gateway-url(keeps--json).callis the gateway): theengine::commandsmodule (Command/Expose/CommandRegistry+ all six demo commands),scenario.rs+ scenario types,probes.rs,context.rs/traits.rs/platform.rs, and thescaffold/newcommand. Theprobeandrun-scenariosubcommands go with them.init(the template "onboard this project" wizard) and its module, plus 7 dependencies only it used.mcpstub subcommand (inherited template scaffolding that only printed a not-implemented notice). The MCP protocol client inengine::gatewayis untouched — that's howlist/calltalk to the gateway.doctor(local env facts).CLAUDE.md, and theMakefileupdated to match; the architecture diagram regenerated with aligned boxes.Net across the branch: roughly −4800 lines — almost entirely deletion of template scaffolding.
Testing
cargo build --workspace— cleancargo clippy --workspace --all-targets -- -D warnings— 0 warningscargo test --workspace— 0 failed (gateway tests +url_overridetests included)cargo fmt --all --check— cleancargo build --release -p sealg;sealg --helplists exactlydoctor, list, call;sealg call --helpshows<tool> [--args] [--gateway-url]The gateway transport itself was verified end-to-end against a live local gateway in #15; this PR only changes how it's surfaced and deletes dead code.
Related Issues
Follow-up to #15. Tracked by the multi-interface design doc in
edison-watch/edison-watch.Notes / out of scope
Cargo.tomldeps (e.g.inventory,schemars) are now unused; not a build/clippy/deny failure, left for a separate dependency trim.HUMANS_SHOULD_TEST.mdand the.claude/skills/{update-backend,onboarding}docs still describe parts of the old template workflow (aserveHTTP API); rewriting those fully is separate, larger work.