Repository navigation
feat: add strict gRPC contracts - #19
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces strict protobuf-backed (gRPC-style) contracts for the authz plugin’s modules and steps, and wires up typed providers plus a runtime contract registry so the workflow engine can validate and execute the plugin in “strict contracts” mode.
Changes:
- Adds
plugin.contracts.jsonmanifest describing strict module/step contracts. - Implements typed module/step providers and a
ContractRegistry()in the plugin runtime. - Updates packaging/manifest details (engine version, downloads, install artifacts) and adds strict-contract-focused tests.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugin.json | Raises minimum engine version, adds download metadata, updates declared module types. |
| plugin.contracts.json | New strict contract manifest for modules/steps. |
| internal/typed.go | New typed adapters: map↔proto conversions and typed step handlers. |
| internal/step_permit_registry.go | Makes permit step type listing deterministic via sorting. |
| internal/plugin_contracts_test.go | Adds tests for typed providers and strict contract registry/manifest parity. |
| internal/plugin.go | Adds typed module/step creation and runtime contract registry. |
| internal/contracts/authz.proto | New protobuf schema defining strict contract messages. |
| internal/contracts/authz.pb.go | Generated protobuf Go bindings. |
| go.mod | Upgrades workflow/modular deps and adds protobuf requirement. |
| go.sum | Dependency checksum updates consistent with go.mod changes. |
| Makefile | Fixes ldflags version injection, sets consistent Go env, installs contracts manifest. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+204
to
+207
| if _, err := createPermitStep(typeName, name, map[string]any{}); err == nil { | ||
| return sdk.NewTypedStepFactory(typeName, &contracts.PermitStepConfig{}, &contracts.PermitStepInput{}, typedPermitStep(typeName)).CreateTypedStep(typeName, name, config) | ||
| } | ||
| return nil, fmt.Errorf("authz plugin: unknown step type %q", typeName) |
Contributor
Author
There was a problem hiding this comment.
Addressed in 90b150d by adding an isPermitStepType helper that checks the permit constructor registry directly, avoiding throwaway step construction during typed type detection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plan
Verification