From d18e7952709e55ccf3bfa9b1a7bec63e80f4ebff Mon Sep 17 00:00:00 2001 From: antoinetoussaint-byte <312536060+antoinetoussaint-byte@users.noreply.github.com> Date: Sun, 25 Oct 2026 20:01:04 -0400 Subject: [PATCH 1/2] fix(companions): take proto 0.0.18 and qualify Python streaming against the published image Core moves the proto companion to 0.0.18 (codefly-dev/core#838) so the streaming Python facade ships under a tag no machine has cached; 0.0.17 names two images. This pins that core. The companions workflow's standing verify job (daily and on release) now runs TestGenerateClientPythonStreaming against the companion pulled fresh on the runner, and names the image's digest when it fails. A tag republished with different content passes the registry presence check and fails here. Moving core past 200e819 (#836) needs two adaptations: ProtobufProcedures takes the endpoint, and the module-contract kit's new roles-grant- bindings fixture needs its documents and replica audiences supplied. Both resolve to documents: a role's spelled-out scope is held at the one audience that underwrites it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/companions.yaml | 14 ++++++++++++++ cmd/generate/contract_surface.go | 2 +- go.mod | 2 +- go.sum | 2 ++ pkg/gitops/wire_kits_test.go | 5 ++++- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/companions.yaml b/.github/workflows/companions.yaml index 5ef3bf484..069d0a16e 100644 --- a/.github/workflows/companions.yaml +++ b/.github/workflows/companions.yaml @@ -244,3 +244,17 @@ jobs: - name: Verify every embedded tag is in the registry run: ${{ github.workspace }}/bin/codefly companion verify --core-dir "${{ github.workspace }}/core" + + # The published proto companion, pulled fresh on this runner, must render + # a Python client that streams all four RPC shapes. A tag republished + # with different content passes the presence check above and fails here. + - name: Qualify Python client streaming through the published companion + working-directory: cli + env: + CODEFLY_GENERATE_QUALIFY: "1" + GOWORK: "off" + run: go test ./cmd/generate -count=1 -run '^TestGenerateClientPythonStreaming$' + + - name: Name the proto companion image the qualification ran + if: failure() + run: docker images --digests --format '{{.Repository}}:{{.Tag}} {{.Digest}} {{.ID}}' ghcr.io/codefly-dev/proto diff --git a/cmd/generate/contract_surface.go b/cmd/generate/contract_surface.go index 8ec795e24..3c888ff55 100644 --- a/cmd/generate/contract_surface.go +++ b/cmd/generate/contract_surface.go @@ -115,7 +115,7 @@ func loadContractSurfaces(service *resources.Service, endpoints []*basev0.Endpoi // descriptor. A descriptor supplies schemas and options, including transitive // imports; the catalog says which of those methods this listener serves. func endpointProcedures(set *descriptorpb.FileDescriptorSet, endpoint *composition.APIContractEndpoint) ([]string, error) { - methods, err := composition.ProtobufProcedures(set, endpoint.Services) + methods, err := composition.ProtobufProcedures(set, *endpoint) if err != nil { return nil, fmt.Errorf("endpoint %s/%s: %w", endpoint.Service, endpoint.Endpoint, err) } diff --git a/go.mod b/go.mod index 77892c892..4cfad098d 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/codefly-dev/authority/libraries/authority-client/go v0.0.0-20261025214748-c9cef7470d20 github.com/codefly-dev/authority/libraries/delivery/go v0.0.0-20261025214748-c9cef7470d20 github.com/codefly-dev/authority/libraries/hop/go v0.0.0-20261025214748-c9cef7470d20 - github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0 + github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521 github.com/codefly-dev/golor v0.1.3 github.com/codefly-dev/llm v0.1.7 github.com/codefly-dev/sdk-go/workcontext v0.1.1-0.20261018052022-70dc7a546458 diff --git a/go.sum b/go.sum index 56e7b3aab..41638a030 100644 --- a/go.sum +++ b/go.sum @@ -176,6 +176,8 @@ github.com/codefly-dev/core v0.19.7-0.20261025175252-88f4434c68c7 h1:sFkQTBSvAjz github.com/codefly-dev/core v0.19.7-0.20261025175252-88f4434c68c7/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0 h1:YEFvkyokBsUWbHoaoKOi6iJtMrqNNR7HsWdUQGN50TA= github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= +github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521 h1:UP7WCPYMa/K/BQYGdZ95wlCtyRFG+RccBadFVw+qYPs= +github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= github.com/codefly-dev/golor v0.1.3 h1:xmo+ceyJFRYZdvpWE2fNd0jeaadp/Ibm1BnganiGKOc= github.com/codefly-dev/golor v0.1.3/go.mod h1:sl/u/K1l7J0Pr3xyVZp8fOJYQItKKst1No9JqgzLLoY= github.com/codefly-dev/gortk v0.2.0 h1:7bOlS5valYz2zil+fZctQNcPCYBcPj86abcw9N8h1hQ= diff --git a/pkg/gitops/wire_kits_test.go b/pkg/gitops/wire_kits_test.go index 77ac525f4..8b942db0b 100644 --- a/pkg/gitops/wire_kits_test.go +++ b/pkg/gitops/wire_kits_test.go @@ -51,11 +51,14 @@ func TestTheModuleContractKitRunsThroughTheRender(t *testing.T) { // (binding-names-calls): each declares what its calls require in its own // published contract, a protobuf one and an OpenAPI one. writeCalleePackages(t, workspace.Dir()) + // roles-grant-bindings holds a role's spelled-out scope at the one + // audience that underwrites it: its documents and replica bindings both + // resolve to documents. for rel, content := range map[string]string{ filepath.Join("modules", "assistant", resources.ModuleConfigurationName): "kind: module\nname: assistant\nservices:\n - name: api\n", filepath.Join("modules", "assistant", "services", "api", resources.ServiceConfigurationName): hostedServiceYAML("api", "assistant") + "module-identity: true\n", filepath.Join("modules", "assistant", "module.package.codefly.yaml"): "schema: codefly/module-package/v1\nid: acme/assistant\nversion: 1.0.0\n", - filepath.Join("configurations", "staging", "assistant.env"): "MODEL_AUDIENCE=model-gateway\nMODEL_RESOURCE_KIND=modelservice.profiles\nMODEL_BINDING=model\nEVIDENCE_AUDIENCE=documents\nEVIDENCE_RESOURCE_KIND=documents.passages\nEVIDENCE_BINDING=evidence\nANNOTATIONS_PREFIX=annotations\n", + filepath.Join("configurations", "staging", "assistant.env"): "MODEL_AUDIENCE=model-gateway\nMODEL_RESOURCE_KIND=modelservice.profiles\nMODEL_BINDING=model\nEVIDENCE_AUDIENCE=documents\nEVIDENCE_RESOURCE_KIND=documents.passages\nEVIDENCE_BINDING=evidence\nANNOTATIONS_PREFIX=annotations\nDOCUMENTS_AUDIENCE=documents\nREPLICA_AUDIENCE=documents\n", } { full := filepath.Join(workspace.Dir(), rel) require.NoError(t, os.MkdirAll(filepath.Dir(full), 0o755)) From 9edc3f55fad6bae59d32fd397719fdee4451041b Mon Sep 17 00:00:00 2001 From: antoinetoussaint-byte <312536060+antoinetoussaint-byte@users.noreply.github.com> Date: Sun, 25 Oct 2026 21:51:27 -0400 Subject: [PATCH 2/2] fix(companions): pin core to #838's merge commit (50b50dd2) Co-Authored-By: Claude Opus 5.5 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4cfad098d..2ee4b8b86 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/codefly-dev/authority/libraries/authority-client/go v0.0.0-20261025214748-c9cef7470d20 github.com/codefly-dev/authority/libraries/delivery/go v0.0.0-20261025214748-c9cef7470d20 github.com/codefly-dev/authority/libraries/hop/go v0.0.0-20261025214748-c9cef7470d20 - github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521 + github.com/codefly-dev/core v0.19.7-0.20261026014924-50b50dd2a5da github.com/codefly-dev/golor v0.1.3 github.com/codefly-dev/llm v0.1.7 github.com/codefly-dev/sdk-go/workcontext v0.1.1-0.20261018052022-70dc7a546458 diff --git a/go.sum b/go.sum index 41638a030..d5120d36e 100644 --- a/go.sum +++ b/go.sum @@ -178,6 +178,8 @@ github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0 h1:YEFvkyokBsU github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521 h1:UP7WCPYMa/K/BQYGdZ95wlCtyRFG+RccBadFVw+qYPs= github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= +github.com/codefly-dev/core v0.19.7-0.20261026014924-50b50dd2a5da h1:g/I/o/KTL8L2xEDrgJsSO4qLR2oYWJI8PorbVMmKSbM= +github.com/codefly-dev/core v0.19.7-0.20261026014924-50b50dd2a5da/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= github.com/codefly-dev/golor v0.1.3 h1:xmo+ceyJFRYZdvpWE2fNd0jeaadp/Ibm1BnganiGKOc= github.com/codefly-dev/golor v0.1.3/go.mod h1:sl/u/K1l7J0Pr3xyVZp8fOJYQItKKst1No9JqgzLLoY= github.com/codefly-dev/gortk v0.2.0 h1:7bOlS5valYz2zil+fZctQNcPCYBcPj86abcw9N8h1hQ=