carlos / platform Public

console: declare apienv.go routes in routeDecls

The three owned-environment doors become declarations, with the comment
that stood above the registerEnvironmentRoutes call; the function is
deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ede3a2e0bd7ec655ad8ffd66ca7d800b509978b4 parent a9c7d7a
3 files changed, +6 −12
  • internal/console/apienv.go +0 −9
  • internal/console/authcli.go +0 −3
  • internal/console/routedecls.go +6 −0

Intent

Human

<task-notification> <task-id>b8irxa405</task-id> <summary>Monitor event: "Task 2 commits landing on design-parity-guard"</summary> <event>a9c7d7a5 console: declare apidemooperator.go routes in routeDecls</event> </task-notification>

Attributed to this commit: 1.38 g CO₂e (183,453 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-parity-guard, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/internal/console/apienv.go b/internal/console/apienv.go
index 0b839ebbb..78941b821 100644
--- a/internal/console/apienv.go
+++ b/internal/console/apienv.go
@@ -20,17 +20,8 @@ import (
"time"
"github.com/carlosframework/platform/internal/appconfig"
- "github.com/carlosframework/platform/internal/svcrole"
)
-// registerEnvironmentRoutes wires the three doors. Called from
-// registerCLIRoutes.
-func (s *Server) registerEnvironmentRoutes() {
- s.cliRoute("POST /api/cli/apps/{account}/{app}/environments/{name}/adopt", svcrole.Set{}, s.handleAPIEnvironmentAdopt)
- s.cliRoute("POST /api/cli/apps/{account}/{app}/environments/{name}/release", svcrole.Set{}, s.handleAPIEnvironmentRelease)
- s.cliRoute("POST /api/cli/apps/{account}/{app}/environments/fork", svcrole.Set{}, s.handleAPIEnvironmentFork)
-}
-
// environmentOwnerGate is the three doors' shared front: the account for
// this principal (the membership-hiding 404), the owner check (403), the
// app (404), the write budget, and a console with a bucket.
diff --git a/internal/console/authcli.go b/internal/console/authcli.go
index 65100668b..0ca82ea7c 100644
--- a/internal/console/authcli.go
+++ b/internal/console/authcli.go
@@ -543,9 +543,6 @@ func (s *Server) registerCLIRoutes() {
if s.cfg.MovesEnabled {
s.registerMovesPhase1Routes()
}
- // The owner's doors onto owned environments (apienv.go): adopt, release
- // and fork. Closed to every service role, owner-gated inside.
- s.registerEnvironmentRoutes()
}
// clientIP is who the rate limiter counts against.
diff --git a/internal/console/routedecls.go b/internal/console/routedecls.go
index a5234c5ca..1f10e57c2 100644
--- a/internal/console/routedecls.go
+++ b/internal/console/routedecls.go
@@ -1074,6 +1074,12 @@ var routeDecls = []routeDecl{
{Pattern: "PUT /api/cli/system/demos/serving", Kind: kindCLI, Gate: gateNoHostClaim, Allow: svcrole.Set{}, Handler: (*Server).handleAPIDemosServing},
{Pattern: "POST /api/cli/system/demos/takedown", Kind: kindCLI, Gate: gateNoHostClaim, Allow: svcrole.Set{}, Handler: (*Server).handleAPIDemosTakedown},
{Pattern: "GET /api/cli/system/demos/takedown", Kind: kindCLI, Gate: gateNoHostClaim, Allow: svcrole.Set{}, Handler: (*Server).handleAPIDemosTakedownStatus},
+
+ // The owner's doors onto owned environments (apienv.go): adopt, release
+ // and fork. Closed to every service role, owner-gated inside.
+ {Pattern: "POST /api/cli/apps/{account}/{app}/environments/{name}/adopt", Kind: kindCLI, Allow: svcrole.Set{}, Handler: (*Server).handleAPIEnvironmentAdopt},
+ {Pattern: "POST /api/cli/apps/{account}/{app}/environments/{name}/release", Kind: kindCLI, Allow: svcrole.Set{}, Handler: (*Server).handleAPIEnvironmentRelease},
+ {Pattern: "POST /api/cli/apps/{account}/{app}/environments/fork", Kind: kindCLI, Allow: svcrole.Set{}, Handler: (*Server).handleAPIEnvironmentFork},
}
// registerDecls is THE loop: every declaration match accepts and whose gate