You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Examples/Governance/ApprovalWorkflow/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Governance ApprovalWorkflow
2
2
3
-
This example shows the governance approval workflow built on top of `MutationRequest.PendingApproval(...)` and `MutationRequestApprovalWorkflowManager`.
3
+
This example shows the governance approval workflow built on top of `MutationRequestFactory.PendingApproval(...)` and `MutationRequestApprovalWorkflowManager`.
@@ -10,106 +10,158 @@ The core package stays responsible for direct mutation execution. Governance bui
10
10
-**Pending Lifecycle** - represent requests that cannot execute immediately
11
11
-**Decision History** - record approvals, rejections, cancellations, and other lifecycle transitions
12
12
-**Approval Workflow** - model request-level approval requirements and explicit approver actions
13
+
-**Governed Execution** - execute approved requests through resolution and the core mutation engine
13
14
-**Request Storage Contracts** - define a persistence seam for governance-oriented stores
14
15
-**Runtime Lifecycle Management** - move requests through pending, approval, expiration, and execution transitions
15
16
-**In-Memory Runtime Support** - provide lightweight request runtime services for development and tests
16
17
17
-
## Current Structure
18
+
## Governance Flow
18
19
19
-
### Abstractions
20
+
The package is built around a request-driven governance loop:
20
21
21
-
The package defines governance-first abstractions under:
22
+
1. create `MutationRequest`
23
+
2. move it through pending lifecycle states when direct execution is not allowed
24
+
3. collect approval decisions when approval is required
25
+
4. resolve the request against the current state version before execution
26
+
5. execute the underlying mutation through the core engine
27
+
6. persist the terminal governance outcome and execution metadata
22
28
23
-
-`Abstractions/Requests`
24
-
-`Abstractions/Approval`
25
-
-`Abstractions/Lifecycle`
26
-
-`Abstractions/Storage`
27
-
-`Abstractions/Resolution`
28
-
-`Abstractions/Exceptions`
29
+
The important point is that governance owns the request lifecycle around execution. The base `ModularityKit.Mutator` package still owns the mutation engine itself.
30
+
31
+
## Main Entry Points
32
+
33
+
Most consumers only need a small set of types.
29
34
30
-
Key types:
35
+
### Request Model
31
36
32
37
-`MutationRequest`
33
-
-`MutationApprovalRequirement`
34
-
-`MutationApprovalRequirementStatus`
38
+
-`MutationRequestFactory`
35
39
-`MutationRequestDecision`
36
-
-`MutationRequestDecisionType`
37
-
-`MutationRequestDecisionCategory`
38
-
-`MutationRequestLifecycleDecisionType`
39
-
-`MutationRequestApprovalDecisionType`
40
-
-`MutationRequestVersionResolutionDecisionType`
41
40
-`MutationRequestStatus`
42
41
-`PendingMutationReason`
42
+
43
+
Use these to create and inspect governed requests.
44
+
45
+
### Storage
46
+
43
47
-`IMutationRequestStore`
44
-
-`IMutationRequestApprovalWorkflowManager`
48
+
-`InMemoryMutationRequestStore`
49
+
50
+
Use the store to persist requests and load them back into governance runtime services.
51
+
52
+
### Lifecycle
53
+
45
54
-`IMutationRequestLifecycleManager`
55
+
-`MutationRequestLifecycleManager`
56
+
57
+
Use lifecycle services to submit, pend, approve, reject, expire, supersede, cancel, and mark requests as executed.
58
+
59
+
### Approval
60
+
61
+
-`IMutationRequestApprovalWorkflowManager`
62
+
-`MutationRequestApprovalWorkflowManager`
63
+
-`MutationApprovalRequirement`
64
+
65
+
Use approval workflow services when a request must be explicitly approved by one or more actors before execution.
66
+
67
+
### Version Resolution
68
+
46
69
-`IMutationRequestVersionResolver`
47
70
-`IMutationRequestVersionResolutionManager`
48
71
-`MutationRequestVersionResolution`
49
72
-`MutationRequestVersionResolutionOutcome`
50
73
-`VersionedRequestResolutionStrategy`
51
-
-`MutationRequestAlreadyExistsException`
52
-
-`MutationApprovalRequirementNotFoundException`
53
-
-`InvalidMutationApprovalActionException`
54
-
-`MutationRequestConcurrencyException`
55
-
-`MutationRequestNotFoundException`
56
-
-`InvalidMutationRequestTransitionException`
57
74
58
-
`Abstractions/Requests` is further split into:
75
+
Use resolution services to decide what happens when deferred request no longer matches the state version it was created against.
76
+
77
+
### Governed Execution
78
+
79
+
-`IGovernanceExecutionManager`
80
+
-`GovernanceExecutionManager`
81
+
-`GovernedExecutionResult<TState>`
82
+
83
+
Use governed execution to close the loop from approved request to core mutation execution and terminal governance state.
84
+
85
+
## Package Areas
86
+
87
+
The codebase is organized by governance concern rather than by framework layer alone.
88
+
89
+
### Requests
90
+
91
+
`Abstractions/Requests` contains the durable request model, decision taxonomy, and request factory methods.
59
92
60
93
-`Requests/Model`
61
94
-`Requests/Decisions`
95
+
-`Requests/Factory`
96
+
97
+
### Lifecycle
98
+
99
+
`Lifecycle` owns generic request movement between governance states such as pending, approved, rejected, expired, superseded, and executed.
62
100
63
-
`Abstractions/Approval` is further split into:
101
+
-`Lifecycle/Contracts`
102
+
-`Lifecycle/Model`
103
+
-`Runtime/Lifecycle/Execution`
104
+
-`Runtime/Lifecycle/Validation`
105
+
-`Runtime/Lifecycle/State`
106
+
107
+
### Approval
108
+
109
+
`Approval` builds request-level approval workflow on top of the generic lifecycle model.
64
110
65
111
-`Approval/Contracts`
66
112
-`Approval/Model`
67
113
-`Approval/Mapping`
114
+
-`Runtime/Approval/Execution`
115
+
-`Runtime/Approval/State`
116
+
117
+
### Resolution
68
118
69
-
`Abstractions/Resolution`is further split into:
119
+
`Resolution`owns version-aware request handling before governed execution.
70
120
71
121
-`Resolution/Contracts`
72
122
-`Resolution/Model`
73
123
-`Resolution/Strategies`
124
+
-`Runtime/Resolution/Evaluation`
125
+
-`Runtime/Resolution/Execution`
74
126
75
-
`Abstractions/Lifecycle` is further split into:
127
+
### Execution
76
128
77
-
-`Lifecycle/Contracts`
78
-
-`Lifecycle/Model`
129
+
`Execution` owns the bridge from governance request semantics into the core mutation engine.
- governed execution through the core mutation engine
157
+
- in-memory runtime support for examples and tests
108
158
109
-
-`Approval/Execution`
110
-
-`Approval/State`
159
+
What it does not try to do yet:
111
160
112
-
This keeps the first version small while leaving room for later persistence providers such as Entity Framework Core or PostgreSQL-backed governance stores.
161
+
- persistence providers such as EF Core or PostgreSQL
162
+
- query stores for operational governance reporting
163
+
- compensation and retry orchestration
164
+
- external async approval or policy integrations
113
165
114
166
## Relationship to Core
115
167
@@ -135,14 +187,13 @@ Responsible for:
135
187
136
188
## Direction
137
189
138
-
This package is intentionally the place where broader governance behavior should grow.
190
+
This package is the place where broader governance behavior should grow without turning the core mutation engine into a workflow framework.
139
191
140
-
That includes future work such as:
192
+
The near-term direction is:
141
193
142
-
- pending mutation resolution
143
-
- approval workflow execution
144
-
- version aware deferred execution
145
-
- governance persistence providers
146
-
- governance query APIs
194
+
- harden governed execution semantics
195
+
- add governance persistence and query providers
196
+
- expose governance metadata operationally
197
+
- support richer approval and integration scenarios
147
198
148
199
The goal is to keep the core runtime small and execution focused while letting governance evolve as an opt-in extension.
0 commit comments