๐ Environment ployz-pr-1677 in Ployz Dashboard has no services deployed.
Cloud publishes commands: registry, manifest and run routes, sidebar tools#1677
Part 3a of the Cloud settings split (layer 3 of the stack). Part 3b, the ployz side, stacks on this branch.
What changes for the user
Nothing visible yet in this PR alone. Cloud starts publishing a command manifest at GET /api/cli/manifest and runs those commands at POST /api/cli/run/{name}: the Organization's upgrade policy (server upgrade-policy show|set) and its approvals (org approval ls|show|approve|deny). The agent sidebar offers the ones marked for agents. Every /api/cli reply names the manifest revision in x-ployz-manifest, so ployz (part 3b) knows when to refresh.
What changes for the next maintainer
One registry (dashboard/src/modules/commands/) defines a published command once: name, path, input and output schemas, whether agents may call it, and how it renders. runCommand is the one runner behind the route, the sidebar and the dashboard server fns for these settings, so the UI cannot drift from the CLI. The parity test regenerates core/crates/ployz/tests/fixtures/published-manifest.json; CI fails when it is stale.
Design: the boundary rule is written into core/DESIGN.md under bet 7. The Approval and Agent sidebar glossary entries in dashboard/CONTEXT.md no longer describe a disable setting.
Checks
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:
d0f96207-4293-4ca6-aa5f-13a083a1d083
๐ฅ Commits
Reviewing files that changed from the base of the PR and between 5fff7acd6a0e6785a82ed487cc328aa8bc1c8fcd and 11aa3f3980602f2098733a17e1700e5f64766e52.
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:
b17a7508-6a87-4569-a19e-fb7c971454f5
๐ฅ Commits
Reviewing files that changed from the base of the PR and between 341f0d3f3ff5018251f963542b56f0ecf1337fab and bf5608e364f790af73ce79a4dd359b0e93714b4a.
๐ Files selected for processing (33)
core/DESIGN.mdcore/crates/ployz/tests/fixtures/published-manifest.jsondashboard/CONTEXT.mddashboard/DESIGN.mddashboard/package.jsondashboard/src/components/agent-sidebar/approval-card.tsxdashboard/src/components/agent-sidebar/approval-review.tsdashboard/src/modules/agent/agent-chat.server.tsdashboard/src/modules/agent/agent-tools.test.tsdashboard/src/modules/agent/agent-tools.tsdashboard/src/modules/approvals/approvals.commands.server.tsdashboard/src/modules/approvals/approvals.tsdashboard/src/modules/commands/command.server.tsdashboard/src/modules/commands/commands.server.tsdashboard/src/modules/commands/manifest.test.tsdashboard/src/modules/commands/parity.postgres.test.tsdashboard/src/modules/commands/registry.server.tsdashboard/src/modules/config-store/config-store.server.tsdashboard/src/modules/server-upgrade/server-upgrade.commands.server.tsdashboard/src/modules/server-upgrade/server-upgrade.functions.tsdashboard/src/modules/server-upgrade/server-upgrade.inngest.postgres.test.tsdashboard/src/modules/server-upgrade/server-upgrade.server.tsdashboard/src/modules/server-upgrade/server-upgrade.tsdashboard/src/routeTree.gen.tsdashboard/src/routes/api/cli/$.tsdashboard/src/routes/api/cli/-handlers.tsdashboard/src/routes/api/cli/agent/act.tsdashboard/src/routes/api/cli/agent/ask.tsdashboard/src/routes/api/cli/cloud/reset.tsdashboard/src/routes/api/cli/manifest.tsdashboard/src/routes/api/cli/run/$name.tsdashboard/src/routes/api/cli/servers/enroll.tsdashboard/src/routes/api/cli/servers/enrollment.ts
๐ค Files with no reviewable changes (1)
- dashboard/src/components/agent-sidebar/approval-review.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
๐ Summary
Summary by CodeRabbit
- New Features
- Added CLI commands to list, view, approve, and deny pending organization approvals, with optional denial reasons.
- Destructive Publish, Deploy, Server removal, Drain, and Namespace clean actions now require approval, including actions initiated through the Agent sidebar.
- Added commands to view and update server upgrade channels and automatic-upgrade settings.
- Cloud-published commands can now appear in the CLI and Agent sidebar when enabled for agents.
Walkthrough
The change adds a registry of Cloud-published commands for server upgrade policies and organization approvals. It serves a command manifest and named command execution through CLI routes, and exposes agent-enabled commands through the Agent sidebar.
Changes
Published command operations
Layer / File(s) Summary Command definitions and domain operations
dashboard/src/modules/commands/command.server.ts,dashboard/src/modules/commands/registry.server.ts,dashboard/src/modules/server-upgrade/*,dashboard/src/modules/approvals/*,dashboard/src/components/agent-sidebar/approval-*,dashboard/CONTEXT.mdAdds command input validation, write gating, and refusal handling. Adds commands to read and update server-upgrade settings and to list, show, approve, or deny organization approvals. The settings update accepts either or both optional fields. Approval descriptions are formatted in the approvals module. CLI publication and execution
Layer / File(s) Summary Manifest generation and CLI routes
dashboard/src/modules/commands/commands.server.ts,core/crates/ployz/tests/fixtures/published-manifest.json,dashboard/src/routes/api/cli/-handlers.ts,dashboard/src/routes/api/cli/manifest.ts,dashboard/src/routes/api/cli/run/$name.ts,dashboard/src/routeTree.gen.ts,dashboard/src/modules/config-store/config-store.server.ts,dashboard/src/routes/api/cli/*Generates a revisioned command manifest and adds routes to serve it and run named commands. The run handler passes the caller, input, approval ID, and request key to command execution. CLI routes use the shared response handler, which adds the manifest revision header. unknown_commandmaps to HTTP 422.Agent command access and validation
Layer / File(s) Summary Agent integration and parity checks
dashboard/src/modules/agent/*,dashboard/src/modules/commands/manifest.test.ts,dashboard/src/modules/commands/parity.postgres.test.ts,dashboard/src/modules/agent/agent-tools.test.ts,dashboard/DESIGN.md,core/DESIGN.md,dashboard/package.jsonAdds agent-enabled published commands to the Agent sidebar and includes gated commands in the gate set. Tests compare the manifest with the fixture, check route/sidebar results and state changes, and verify gated approval commands are unavailable to agents. Priority: โ Normal
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant ployz 3 participant ManifestRoute as Manifest route 4 participant CommandRegistry 5 participant RunRoute as Run route 6 participant runCommand 7 participant PublishedCommand 8 ployz->>ManifestRoute: Request command manifest 9 ManifestRoute->>CommandRegistry: Read registered commands 10 CommandRegistry-->>ManifestRoute: Command metadata and schemas 11 ManifestRoute-->>ployz: Manifest and revision header 12 ployz->>RunRoute: Submit command name and input 13 RunRoute->>runCommand: Pass caller, input, approval ID, and key 14 runCommand->>PublishedCommand: Invoke matching command 15 PublishedCommand-->>runCommand: Return command result 16 runCommand-->>RunRoute: Return output or refusal 17 RunRoute-->>ployz: Return command response - New Features
Merge Risk: โช Minimal ยท up to bf560
No actionable merge-blocking issue is established for the published commands or their CLI and Agent paths; normal checks can proceed.
Security architecture risk: ๐ต Low ยท up to bf560
The new execution paths retain authentication and organization scoping. Approval decisions remain protected against stale plans and concurrent decisions, and approval-management commands are excluded from sidebar tools. No authorization bypass was established in the inspected paths, but client confirmation and broader runtime coverage remain incomplete.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
- inferred โ A compromised valid organization credential or influenced sidebar tool execution can affect the bound organization's upgrade policy, including its release channel and automatic rollout behavior across eligible servers. Approval decisions can release destructive operations in that organization. The inspected commands expose no caller-controlled organization selector or demonstrated cross-organization escalation.
Security Findings and Attack Paths
- observed โ The new approval command accepts an approval ID and obtains its digest server-side; typed organization confirmation is manifest metadata rather than server-enforced input. Freshening rejects superseded plans. The base already exposed credential-authorized approval decisions, and the documented boundary explicitly does not resist hostile credential holders. Client confirmation behavior remains unverified rather than a demonstrated new authorization bypass.
Trust Boundaries and Controls
- observed โ CLI callers require an unexpired organization token whose maker remains a member, or a session with verified active-organization membership. Sidebar requests use dashboard operate authorization and member/organization thread scoping. Approval reads are organization-scoped; decisions freshen pending plans and conditionally update pending rows, with repeated matching decisions returning the settled result.
Resilience and Maintainability Implications
- observed โ Published request keys do not provide recorded replay admission. Retrying automatic-policy writes can emit additional events, and persistence precedes event delivery; this separation existed at base. Rollouts serialize per organization, select servers still behind, skip halted releases and stop on unsuccessful outcomes. Failure, cancellation and stale-attempt cleanup record unknown outcomes, while the periodic sweep re-requests enabled automatic rollouts. These controls bound the retry concern without proving exactly-once delivery.
Hardening Proposals
- proposed โ Keep caller-owned authorization and retry convergence explicit requirements for future registry additions. Operations that do not independently converge should use durable replay admission, and agent eligibility should be reviewed separately from ordinary member permission.
Pre-merge checks ยท Passed 4 ยท Failed 1
Failed Failed checks (1 warning)
Check name Status Explanation Resolution Docstring Coverage Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 27 files. (5 skipped:โฆ 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 changes: Cloud command publication, the registry, manifest and run routes, and sidebar tools. Description check Passed The description is directly related to the changeset and explains the published command manifest, run routes, shared registry, agent sidebar integration, and parity testing. 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.
Full details: Docstring Coverage
Explanation
Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 27 files. (5 skipped: 5 unsupported.)
โจ Finishing Touches ๐ก 1
-
๐ Generate docstrings ๐ก
- Commit to this branch
- Create a new PR
๐งช Generate unit tests (beta)
- 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.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
|---|---|---|---|
| ๐ Code Review | โ Completed 2026-10-13T01:41:20.806616Z | a970a0d | New commits |
โน๏ธ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with ๐ while any review is running, comments if it has suggestions, and reacts with ๐ once all reviews finish with no findings.
๐ก Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf5608e364
โน๏ธ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with ๐.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| โฆ | โฆ | @@ -248,13 +260,25 @@ const approvalGate = (caller: Caller, run: Run, here: Here) => { | |
| 277 | + | if (GATED.has(tool.name)) throw new Error(`${tool.name} ran outside the approval gate.`); | |
| 278 | + | return run(runTool(caller, tool.name, projectJsonValue(args) ?? null, here.place, `${turn}:${context?.toolCallId ?? randomUUID()}`)); | |
| 279 | + | })), | |
| 280 | + | ...COMMANDS.filter((command) => command.agents).map(publishedTool(caller, run, turn)), | |
P2 Badge Document the new sidebar commands
Once this line ships, the sidebar agent gains the published upgrade-policy and approval read commands, but docs/user/account/agent-sidebar.md still omits these capabilities, including that the agent can change the release channel or automatic-upgrade setting. Update the user-facing capability list alongside exposing these tools so shipped behavior is discoverable and accurately documented.
AGENTS.md reference: AGENTS.md:L6-L6
Useful? React with ๐ย / ๐.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
Added 5 commits
- Offer Cloud-published commands to the sidebar agent30dbc20
- Publish Cloud commands from one registry8d4fb7b
- Serve the command manifest and run published commands over /api/cli98c0ded
- Prove ployz and the sidebar run published commands alikea970a0d
- Name Cloud-published commands in the design and fix the Approval glossarye7eb285