Skip to content

Feat: add policy composition primitives and examples#83

Merged
rian-be merged 10 commits into
mainfrom
develop
Jul 6, 2026
Merged

Feat: add policy composition primitives and examples#83
rian-be merged 10 commits into
mainfrom
develop

Conversation

@rian-be

@rian-be rian-be commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds reusable policy composition support and expands examples/tests around composed mutation policies.

Highlights

Policy composition primitives

  • Add PolicyCompositionMode for AllOf, AnyOf, and priority-based evaluation.=
  • Add policy decision composition and merge behavior.
  • Add conflict detection when composed policies modify the same value differently.
  • Keep composition metadata visible in the final policy decision.

Composed policy examples

  • Add PolicyComposition example with release governance scenarios.
  • Demonstrate AllOf approval gates.
  • Demonstrate AnyOf emergency override with approval fallback.
  • Demonstrate priority based deployment selection.
  • Demonstrate explicit owner conflict handling.

Feature flag governance

  • Add reusable FeatureFlagGovernancePolicies.CriticalChanges.
  • Register one composed governance policy instead of wiring multiple policy classes manually.
  • Document composed feature flag governance in the example README.

Test support policies

  • Add sample policies for state propagation, approval aggregation, blocking precedence, and composition behavior.

Why

Policy rules often need to be reused as named governance sets instead of being hand wired per scenario.

This adds composition layer so complex policy behavior can be expressed through small focused policies while preserving deterministic ordering, explicit merge behavior, side effects, requirements, metadata, and conflict diagnostics.

Checks

  • dotnet build

Closes

@rian-be rian-be self-assigned this Jul 5, 2026
@github-actions github-actions Bot added documentation Documentation updates and additions abstractions Public abstractions and contracts runtime Runtime implementation and execution flow examples Runnable examples and sample apps tests Test coverage and test changes labels Jul 5, 2026
@rian-be rian-be marked this pull request as ready for review July 5, 2026 23:07
@rian-be rian-be merged commit 27f4709 into main Jul 6, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abstractions Public abstractions and contracts documentation Documentation updates and additions examples Runnable examples and sample apps runtime Runtime implementation and execution flow tests Test coverage and test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Add governance aware policy composition

1 participant