Skip to content

Add Signal batch trust policy gate - #37

Merged
intel352 merged 1 commit into
mainfrom
signal-trust-policy-batch
Jul 5, 2026
Merged

intel352 merged 1 commit into
mainfrom
signal-trust-policy-batch

Conversation

@intel352

@intel352 intel352 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • adds strict protobuf contracts for SignalTrustPolicySubject, SignalTrustPolicyDecision, and step.signal_trust_policy_check_batch
  • reuses single trust-policy semantics for each subject through a store-level batch helper that validates duplicates, empty subjects, and a 100-subject cap before evaluating under one lock
  • exposes the batch step in provider contracts, plugin metadata, README, and the trust-reset pipeline fixture

TDD proof

With implementation reverted and tests retained:

$ go test ./internal -run 'TestSignalTrustPolicyCheckBatch|TestSignalTrustPolicyCheck|TestSignalProviderDeclaresStrictPhaseOneContracts' -count=1
FAIL — undefined ExecuteSignalTrustPolicyCheckBatch / SignalTrustPolicyCheckBatch* / SignalTrustPolicySubject

With implementation restored:

$ go test ./internal -run 'TestSignalTrustPolicyCheckBatch|TestSignalTrustPolicyCheck|TestSignalProviderDeclaresStrictPhaseOneContracts' -count=1
ok github.com/GoCodeAlone/workflow-plugin-signal/internal

Verification

  • go test ./internal -run 'TestSignalTrustPolicyCheckBatch|TestSignalTrustPolicyCheck|TestSignalProviderDeclaresStrictPhaseOneContracts' -count=1
  • go test ./... -count=1
  • go vet ./...
  • make build
  • make pipeline-test
  • wfctl plugin validate-contract --for-publish --tag v0.28.0 .

Copilot AI review requested due to automatic review settings July 5, 2026 07:44
@intel352
intel352 merged commit fe3f425 into main Jul 5, 2026
4 checks passed
@intel352
intel352 deleted the signal-trust-policy-batch branch July 5, 2026 07:45

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 a new strict-contract workflow step (step.signal_trust_policy_check_batch) that evaluates Signal trust policy across multiple trust refs in a single aggregated, fail-closed decision, and wires it through provider contracts, metadata, docs, and fixtures.

Changes:

  • Adds protobuf contract types for batch trust-policy subjects/decisions plus batch step input/output/config.
  • Implements store-level batch evaluation with validation (empty/duplicates/100-subject cap) and a deterministic batch policy ref.
  • Exposes the new step across provider registry/contracts, plugin metadata, README documentation, tests, and a pipeline fixture.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testdata/pipelines/signal-trust-reset.yaml Adds fixture usage of the new batch trust-policy step (gate + report-only).
README.md Documents the new batch trust policy gate semantics and outputs.
proto/signal.proto Adds public protobuf messages for batch trust policy config/subject/decision/input/output.
proto/signal.pb.go Regenerates Go protobuf bindings for the new batch trust policy messages.
plugin.json Registers step.signal_trust_policy_check_batch in plugin metadata.
plugin.contracts.json Adds strict contract entry for the new batch step.
internal/trust_store.go Implements batch policy evaluation under one lock + batch policy ref helper.
internal/trust_policy_test.go Adds tests covering mixed decisions, fail-closed behavior, and batch validation.
internal/steps.go Implements ExecuteSignalTrustPolicyCheckBatch and decision output mapping.
internal/provider.go Registers the new typed step factory and contract registry entry.
internal/provider_contracts_test.go Extends provider contract tests to include the batch step.
internal/contracts/signal.proto Adds internal contract protobuf definitions for the new batch step/messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/steps.go
Comment on lines +379 to +382
output.BatchPolicyRef = signalTrustPolicyBatchRef(storeRef, output.Decisions)
if firstDenial != nil && !reportOnly {
return nil, fmt.Errorf("signal trust policy check batch: %s: %s", firstDenial.GetTrustRef(), firstDenial.GetReason())
}
Comment thread internal/trust_store.go
Comment on lines +995 to +999
allowedStatuses, err := normalizeSignalTrustPolicyStatuses(check.allowedLastStatuses)
if err != nil {
return nil, err
}
normalizedStatuses[i] = allowedStatuses
Comment thread internal/trust_store.go
Comment on lines +991 to +993
if _, ok := seen[check.trustRef]; ok {
return nil, fmt.Errorf("signal trust policy check batch: duplicate trust_ref %q", check.trustRef)
}
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