Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
โ๏ธ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d01a1e99-76a1-400d-9ca7-952f40889689
๐ฅ Commits
Reviewing files that changed from the base of the PR and between 79e38cca9edb32c819e8473f2e0db743f00c9243 and c76e239be336ea1b72ebc7347dc9646e7ffcc145.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- ๐ Trigger review
No actionable comments were generated in the recent review. ๐
โน๏ธ Recent review info
โ๏ธ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
dfa0d603-ae28-40f1-b4b3-25fbb432ac7d
๐ฅ Commits
Reviewing files that changed from the base of the PR and between f354faa3ead6162a342bee881eec8e5bd3c5ce26 and eaadd86d5622470535b44b7e238b84b4732268dd.
๐ Files selected for processing (2)
core/crates/ployz/src/handlers/mcp.rscore/crates/ployz/src/handlers/mcp/tests.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
๐ Summary
Summary by CodeRabbit
New Features
- Signed-in users can access commands supplied by Ployz Cloud alongside built-in commands. Available commands appear in CLI help and JSON schema, and cached commands remain available in help offline.
- MCP now offers eligible Cloud commands and updates its tool list when commands change.
- Cloud commands support typed inputs, approval prompts, and structured table or record results.
- Added CLI guidance for managing server upgrade policies and organization approval requests.
Bug Fixes
- Cloud command lists refresh when their revision changes, and commands no longer available are removed from the cache.
Walkthrough
Ployz now loads and caches Cloud-published command manifests, and exposes published commands through the CLI, command catalog, and MCP. It executes published commands through Cloud, tracks manifest revisions, and renders returned messages, records, and tables. The change also adds tests and user documentation.
Changes
Cloud-Published Commands
Layer / File(s) Summary Manifest contract and Cloud cache
core/crates/ployz/Cargo.toml,core/crates/ployz/src/published/wire.rs,core/crates/ployz/src/published/mod.rs,core/crates/ployz/src/cloud_account.rs,core/crates/ployz/src/failure.rs,core/crates/ployz/src/lib.rsDefines manifest and run-response types, validates and caches manifests by Cloud, selects Cloud credentials, and tracks request keys and manifest revisions. CLI command discovery and dispatch
core/crates/ployz/src/cli/mod.rs,core/crates/ployz/src/published/graft.rs,core/crates/ployz/src/handlers/mod.rs,docs/user/servers/manage-servers.mdAttaches cached published commands to the CLI tree, refreshes after qualifying parse misses, and dispatches matching commands. Adds CLI examples for server upgrade-policy commands. Published-command execution and output
core/crates/ployz/src/published/run.rs,core/crates/ployz/src/ui/table.rs,core/crates/ployz/tests/fixtures/nested-record-output.*,core/crates/ployz/tests/published_cli.rs,docs/user/account/organizations.mdBuilds Cloud run inputs, handles access and refusal results, and renders messages, records, and tables. Adds CLI tests, output fixtures, and documentation for terminal approval commands. Command catalog and MCP tools
core/crates/ployz/src/handlers/catalog.rs,core/crates/ployz/src/handlers/mcp.rs,core/crates/ployz/src/handlers/mcp/tests.rs,core/crates/ployz/tests/published_parity.rs,docs/user/cli/overview.mdAdds Cloud origins to catalog entries and exposes agent-enabled published commands through MCP. MCP refreshes tool listings when manifest revisions change and removes commands reported as unknown. Adds parity tests and CLI documentation. Priority: โ Normal
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 actor User 3 participant CLI as CLI 4 participant Setup as published::Setup 5 participant Run as handlers::run 6 participant Cloud as Ployz Cloud 7 User->>CLI: Invoke a published command 8 CLI->>Setup: Load cached manifest 9 Setup-->>CLI: Return cached published commands 10 CLI->>Run: Parse and dispatch command 11 Run->>Setup: Refresh after a qualifying parse miss 12 Setup->>Cloud: Fetch manifest 13 Cloud-->>Setup: Return manifest 14 Setup-->>Run: Return refreshed commands 15 Run->>Cloud: Run command with input and request key 16 Cloud-->>Run: Return output and manifest revision 17 Run-->>User: Display rendered result
Merge Risk: โช Minimal ยท up to eaadd
No confirmed issue remains that should block merging. MCP now avoids repeatedly fetching a manifest for a revision it could not obtain.
Security architecture risk: ๐ก Moderate ยท up to eaadd
Cloud can now change the commands available to terminals and coding agents without a client release. Cloud identity and approval checks remain enforced, but one temporary discovery failure can leave a running agent connection indefinitely using outdated command metadata.
Retained concerns
- Medium ยท reliability ยท observed: A failed or mismatched manifest reread permanently marks the requested revision as unread for the running MCP session. Subsequent replies naming that revision cannot recover the tool list even after discovery becomes healthy. Agent visibility, typed-confirmation metadata and approval transport continue to depend on the held definition, creating persistent control-metadata drift until another revision triggers a successful refresh or the process restarts. Current Cloud authorization and approval gates remain authoritative, so the evidence does not establish an approval bypass.
Security review details
Security Blast Radius
- observed โ The new agent-facing write surface includes Organization-wide server upgrade policy changes, affecting the release channel and automatic-upgrade setting under the caller's Organization. Approval decisions are published for terminal use but excluded from MCP through agents=false; approval acceptance additionally requires typed Organization confirmation in the CLI.
Trust Boundaries and Controls
- observed โ Each run resolves the current Caller. Sessions require membership in their active Organization; tokens require an unexpired token and continuing membership of its maker. Asking commands validate input before checking approvals within that Organization against the current operation digest. These existing server controls are exercised by the new client path and counter the suggested cross-Organization and approval-bypass concerns.
- observed โ Compiled tool names win collisions, invalid published names are rejected, and MCP checks agent visibility during both listing and lookup. Commands requiring typed confirmation are refused by published MCP invocation rather than delegated to the agent.
Resilience and Maintainability Implications
- inferred โ If an approval gate changes while discovery is stranded, MCP can continue packaging approval according to the old definition. The current server gate still checks approval before execution, containing that case as incompatible input or refusal rather than establishing authorization bypass. Recovery of the advertised schema remains the unresolved client lifecycle weakness.
Hardening Proposals
- proposed โ Treat failed or mismatched discovery as retryable with bounded backoff rather than permanently settled. Exercise recovery after transient failure and audience, typed-confirmation and approval-gate changes across revisions while preserving concurrent-refresh serialization.
Pre-merge checks ยท Passed 4 ยท Failed 1
Failed Failed checks (1 warning)
Check name Status Explanation Resolution Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 190 functions across 15 files. Write docstrings for the functions missing them to satisfy the coverage threshold. Passed Passed checks (4 passed)
Check name Status Explanation Title check Passed The title clearly summarizes the main change: running commands published by Ployz Cloud through ployz. Description check Passed The description directly explains Cloud-published command discovery, execution, caching, MCP integration, tests, and documentation covered by the changeset. Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
โจ Finishing Touches ๐ก 2
-
๐ Generate docstrings ๐ก
- Commit to this branch
- Create a new PR
๐งช Generate unit tests (beta)
- Commit to this branch
- Create a new PR
๐ ๏ธ Fix failing CI checks ๐ก
- Commit to this branch
- Create a new PR
- Autofix ยท Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.