From 5b723d853574c6ac1c89894e720d7137bbe9de6c Mon Sep 17 00:00:00 2001 From: Antoine Toussaint <312536060+antoinetoussaint-byte@users.noreply.github.com> Date: Fri, 30 Oct 2026 22:57:09 -0400 Subject: [PATCH] chore(accounts): mark the five adapter files as hand-maintained until service-go-grpc#223 accounts' pkg/adapters/{connect,cors,grpc,rest,server}_gen.go said "This code is generated by the agent. Do not edit this file!", but the go-grpc agent never writes them for accounts. In 0.1.72, generatedScaffoldTargets renders the adapters only when the proto declares a single AccountsService. Accounts serves many proto services and declares no AccountsService, so the agent's Sync leaves the adapters alone. Moving the agent to 0.1.72 (#1287) therefore did not regenerate them, and connect_gen.go has none of the 0.1.63-0.1.67 Connect-face bounds. Each file now carries the STOPGAP (codefly-dev/service-go-grpc#223) header that main.go and plugins/registry.go already carry. connect_gen.go also states that it lacks those bounds. The comments in rest_extras.go and three adapter tests that called these files "regenerated" now say they will be adopted from the agent once #223 lands. Code is unchanged. Co-Authored-By: Claude Fable 5.1 --- .../accounts/code/pkg/adapters/connect_gen.go | 14 +++++++++++++- .../accounts/code/pkg/adapters/cors_gen.go | 10 +++++++++- .../accounts/code/pkg/adapters/grpc_gen.go | 10 +++++++++- .../code/pkg/adapters/grpc_reflection_test.go | 3 ++- .../accounts/code/pkg/adapters/rest_extras.go | 7 ++++--- .../accounts/code/pkg/adapters/rest_gen.go | 10 +++++++++- .../pkg/adapters/rest_identity_lockstep_test.go | 8 ++++---- .../rest_refresh_cookie_transcoding_test.go | 4 ++-- .../accounts/code/pkg/adapters/server_gen.go | 11 +++++++++-- 9 files changed, 61 insertions(+), 16 deletions(-) diff --git a/module/services/accounts/code/pkg/adapters/connect_gen.go b/module/services/accounts/code/pkg/adapters/connect_gen.go index b05d009c5..9c705d1c5 100644 --- a/module/services/accounts/code/pkg/adapters/connect_gen.go +++ b/module/services/accounts/code/pkg/adapters/connect_gen.go @@ -2,7 +2,19 @@ package adapters /* ----------------------------------------------------------------- -⚠️ This code is generated by the agent. Do not edit this file! +STOPGAP (codefly-dev/service-go-grpc#223): this file is hand-maintained. +It is not the go-grpc agent's output, although its name and layout follow the +agent's template. The agent renders these adapters only for a service whose +proto declares a single AccountsService. Accounts serves many proto services +and declares no AccountsService, so the agent's Sync never writes this file +(go-grpc 0.1.72, generatedScaffoldTargets). It stays hand-maintained until #223 +lets the agent render this service's shape; adopt the generated file then, +keeping the CUSTOM lines. main.go and plugins/registry.go carry the same +stopgap. + +It has not taken the agent's Connect-face bounds (go-grpc 0.1.63 to 0.1.67: +the message bound, the body-read bound and ReadHeaderTimeout). Run serves +Connect on a plain http.Server. #223 tracks adopting them. Registers every Connect (connectrpc.com/connect) service handler derived from the proto package. Actual per-service adapter types live in diff --git a/module/services/accounts/code/pkg/adapters/cors_gen.go b/module/services/accounts/code/pkg/adapters/cors_gen.go index c1372ca14..f23b14f27 100644 --- a/module/services/accounts/code/pkg/adapters/cors_gen.go +++ b/module/services/accounts/code/pkg/adapters/cors_gen.go @@ -10,7 +10,15 @@ import ( /* ----------------------------------------------------------------- -⚠️ This code is generated by the agent. Do not edit this file! +STOPGAP (codefly-dev/service-go-grpc#223): this file is hand-maintained. +It is not the go-grpc agent's output, although its name and layout follow the +agent's template. The agent renders these adapters only for a service whose +proto declares a single AccountsService. Accounts serves many proto services +and declares no AccountsService, so the agent's Sync never writes this file +(go-grpc 0.1.72, generatedScaffoldTargets). It stays hand-maintained until #223 +lets the agent render this service's shape; adopt the generated file then, +keeping the CUSTOM lines. main.go and plugins/registry.go carry the same +stopgap. ----------------------------------------------------------------- */ diff --git a/module/services/accounts/code/pkg/adapters/grpc_gen.go b/module/services/accounts/code/pkg/adapters/grpc_gen.go index 8410ad05d..2e3460b55 100644 --- a/module/services/accounts/code/pkg/adapters/grpc_gen.go +++ b/module/services/accounts/code/pkg/adapters/grpc_gen.go @@ -2,7 +2,15 @@ package adapters /* ----------------------------------------------------------------- -⚠️ This code is generated by the agent. Do not edit this file! +STOPGAP (codefly-dev/service-go-grpc#223): this file is hand-maintained. +It is not the go-grpc agent's output, although its name and layout follow the +agent's template. The agent renders these adapters only for a service whose +proto declares a single AccountsService. Accounts serves many proto services +and declares no AccountsService, so the agent's Sync never writes this file +(go-grpc 0.1.72, generatedScaffoldTargets). It stays hand-maintained until #223 +lets the agent render this service's shape; adopt the generated file then, +keeping the CUSTOM lines. main.go and plugins/registry.go carry the same +stopgap. Recommendation: create a `rpcs.go` file in the same directory as this file and implement your APIs there. diff --git a/module/services/accounts/code/pkg/adapters/grpc_reflection_test.go b/module/services/accounts/code/pkg/adapters/grpc_reflection_test.go index 4b899a9fc..77b921d4a 100644 --- a/module/services/accounts/code/pkg/adapters/grpc_reflection_test.go +++ b/module/services/accounts/code/pkg/adapters/grpc_reflection_test.go @@ -26,7 +26,8 @@ func reflectionRegistered(server *grpc.Server) bool { } // TestReflectionRegisteredOnlyLocally pins the environment gate on gRPC server -// reflection. grpc_gen.go is generated, so a regeneration that emits an +// reflection. grpc_gen.go is to be adopted from the agent (service-go-grpc#223), +// so a regeneration that emits an // unconditional reflection.Register would re-expose the full service surface to // any mesh-internal caller in production; this test fails if that gate is lost. func TestReflectionRegisteredOnlyLocally(t *testing.T) { diff --git a/module/services/accounts/code/pkg/adapters/rest_extras.go b/module/services/accounts/code/pkg/adapters/rest_extras.go index 3b525abf7..073d14f52 100644 --- a/module/services/accounts/code/pkg/adapters/rest_extras.go +++ b/module/services/accounts/code/pkg/adapters/rest_extras.go @@ -8,9 +8,10 @@ package adapters // an HMAC header. These are registered here and wrapped into the same // HTTP listener via combineHandlers(). // -// Why not edit rest_gen.go: that file is regenerated by the go-grpc -// agent. This file is hand-written and survives regeneration. The -// one edit to rest_gen.go is a single call to combineHandlers(). +// Why not edit rest_gen.go: it is hand-maintained only until the go-grpc +// agent can render it (service-go-grpc#223), and then it is adopted from the +// agent. This file is hand-written and survives that. The one edit to +// rest_gen.go is a single call to combineHandlers(). import ( "bytes" diff --git a/module/services/accounts/code/pkg/adapters/rest_gen.go b/module/services/accounts/code/pkg/adapters/rest_gen.go index 66defa71d..5a442a53d 100644 --- a/module/services/accounts/code/pkg/adapters/rest_gen.go +++ b/module/services/accounts/code/pkg/adapters/rest_gen.go @@ -2,7 +2,15 @@ package adapters /* ----------------------------------------------------------------- -⚠️ This code is generated by the agent. Do not edit this file! +STOPGAP (codefly-dev/service-go-grpc#223): this file is hand-maintained. +It is not the go-grpc agent's output, although its name and layout follow the +agent's template. The agent renders these adapters only for a service whose +proto declares a single AccountsService. Accounts serves many proto services +and declares no AccountsService, so the agent's Sync never writes this file +(go-grpc 0.1.72, generatedScaffoldTargets). It stays hand-maintained until #223 +lets the agent render this service's shape; adopt the generated file then, +keeping the CUSTOM lines. main.go and plugins/registry.go carry the same +stopgap. ----------------------------------------------------------------- */ diff --git a/module/services/accounts/code/pkg/adapters/rest_identity_lockstep_test.go b/module/services/accounts/code/pkg/adapters/rest_identity_lockstep_test.go index 7c8aca4e7..982659ec4 100644 --- a/module/services/accounts/code/pkg/adapters/rest_identity_lockstep_test.go +++ b/module/services/accounts/code/pkg/adapters/rest_identity_lockstep_test.go @@ -14,10 +14,10 @@ import ( // TestRESTServeMuxKeepsTheIdentityHeaderMatcher is the REST half of the // identity-projection gate. // -// rest_gen.go is generated ("Do not edit this file!"), and the single option -// that carries the caller's credential and the canonical identity headers -// across the transcoding hop lives inside that generated constructor. A -// regeneration that drops it does not break a build or a route: REST simply +// rest_gen.go is to be adopted from the go-grpc agent once it can render it +// (service-go-grpc#223), and the single option that carries the caller's +// credential and the canonical identity headers across the transcoding hop +// lives inside that constructor. A regeneration that drops it does not break a build or a route: REST simply // stops forwarding the acting-as subject, and an impersonated request silently // authorizes as the admin instead of the target — the exact defect the matcher // exists to close, reintroduced fail-open. diff --git a/module/services/accounts/code/pkg/adapters/rest_refresh_cookie_transcoding_test.go b/module/services/accounts/code/pkg/adapters/rest_refresh_cookie_transcoding_test.go index b8265c078..f8e9f5cb4 100644 --- a/module/services/accounts/code/pkg/adapters/rest_refresh_cookie_transcoding_test.go +++ b/module/services/accounts/code/pkg/adapters/rest_refresh_cookie_transcoding_test.go @@ -66,8 +66,8 @@ func forwardThroughTranscoder(t *testing.T, option runtime.ServeMuxOption, heade return recorder } -// rest_gen.go is generated; its CUSTOM lines survive regeneration only by -// being preserved. Parsed, not string-matched (as the incoming matcher's +// rest_gen.go is to be adopted from the agent (service-go-grpc#223); its +// CUSTOM lines survive that only by being preserved. Parsed, not string-matched (as the incoming matcher's // lockstep test does), so a commented-out or renamed option fails here and the // prefixed cookie cannot come back silently. func TestTheRESTMuxIsBuiltWithTheOutgoingHeaderMatcher(t *testing.T) { diff --git a/module/services/accounts/code/pkg/adapters/server_gen.go b/module/services/accounts/code/pkg/adapters/server_gen.go index 005b588c4..62c19991d 100644 --- a/module/services/accounts/code/pkg/adapters/server_gen.go +++ b/module/services/accounts/code/pkg/adapters/server_gen.go @@ -2,8 +2,15 @@ package adapters /* ----------------------------------------------------------------- -⚠️ This code is generated by the agent. Do not edit this file! - +STOPGAP (codefly-dev/service-go-grpc#223): this file is hand-maintained. +It is not the go-grpc agent's output, although its name and layout follow the +agent's template. The agent renders these adapters only for a service whose +proto declares a single AccountsService. Accounts serves many proto services +and declares no AccountsService, so the agent's Sync never writes this file +(go-grpc 0.1.72, generatedScaffoldTargets). It stays hand-maintained until #223 +lets the agent render this service's shape; adopt the generated file then, +keeping the CUSTOM lines. main.go and plugins/registry.go carry the same +stopgap. ----------------------------------------------------------------- */