Skip to content

feat: add strict gRPC contracts - #19

Merged
intel352 merged 2 commits into
mainfrom
feat/strict-grpc-contracts
Apr 27, 2026
Merged

intel352 merged 2 commits into
mainfrom
feat/strict-grpc-contracts

Conversation

@intel352

Copy link
Copy Markdown
Contributor

Summary

  • add protobuf-backed strict contracts for authz module/steps
  • expose typed providers and runtime contract registry
  • update manifest, packaging, and strict-contract tests

Plan

  • References Workflow strict gRPC plugin contracts plan: workflow docs/plans/2026-04-26-strict-grpc-plugin-contracts.md

Verification

  • GOWORK=off go test ./... -race -count=1
  • GOWORK=off go vet ./...
  • GOWORK=off go mod tidy -diff
  • git diff --check
  • jq empty plugin.json plugin.contracts.json
  • wfctl plugin validate -file plugin.json -strict-contracts

Copilot AI review requested due to automatic review settings April 27, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json manifest 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 thread internal/plugin.go Outdated
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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 90b150d by adding an isPermitStepType helper that checks the permit constructor registry directly, avoiding throwaway step construction during typed type detection.

@intel352
intel352 merged commit 812905e into main Apr 27, 2026
9 checks passed
@intel352
intel352 deleted the feat/strict-grpc-contracts branch April 27, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants