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: Docs/ExecutionModel.md
+30-8Lines changed: 30 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This document describes the execution model that `ModularityKit.Mutator` is moving toward as governance features become first-class runtime capabilities.
4
4
5
-
It complements the roadmap by explaining the lifecycle of a mutation once the engine supports pending execution, approvals, versioning, and compensation.
5
+
It complements the roadmap by explaining the lifecycle of a mutation now that governance already has request lifecycle, approval workflow, and version-resolution primitives, but still needs a fully closed governed execution loop.
6
6
7
7
## Current Model
8
8
@@ -18,7 +18,7 @@ Today, the engine is centered around direct mutation execution:
18
18
This model is strong for immediate execution flows, but it is intentionally narrow:
19
19
20
20
- blocked mutations are terminal outcomes
21
-
-approval requirements are modeled but not yet lifecycle-driven
21
+
-direct mutation execution is still the dominant runtime path
22
22
- concurrency is not yet part of a first-class execution contract
23
23
- compensation and re-execution are not yet modeled as governed transitions
24
24
@@ -32,11 +32,12 @@ The target shape is:
32
32
2. Evaluate policies and requirements
33
33
3. Enter pending state when execution is deferred
34
34
4. Resolve requirements through approvals or external checks
35
-
5.Re-validate against the current state version
36
-
6. Execute or reject
35
+
5.Resolve against the current state version
36
+
6. Execute through a governed execution manager
37
37
7. Emit side effects
38
38
8. Audit and persist history
39
-
9. Optionally compensate or reverse
39
+
9. Record executed or terminal governance decision
40
+
10. Optionally compensate or reverse
40
41
41
42
This is the key conceptual shift in the project:
42
43
@@ -69,7 +70,7 @@ Possible pending reasons:
69
70
-`PendingDependency`
70
71
-`PendingQuota`
71
72
72
-
Pending state should be treated as a first-class runtime state, not just a flag in `MutationResult`.
73
+
Pending state is already a first-class governance state. The remaining work is to ensure every pending path has a clear re-entry route into governed execution.
73
74
74
75
### Resolution
75
76
@@ -83,6 +84,8 @@ Possible outcomes:
83
84
- expired
84
85
- superseded by a newer request or state version
85
86
87
+
Resolution is already modeled in the governance runtime. The remaining gap is making it part of one mandatory execution path rather than a helper that callers compose manually.
88
+
86
89
### Versioned Execution
87
90
88
91
Approval and deferred execution require explicit version handling.
@@ -95,6 +98,23 @@ When a request is approved against a later state than the one originally evaluat
95
98
96
99
This behavior must be explicit and consistent across all pending mutation types.
97
100
101
+
The main hardening point is no longer whether version resolution exists, but whether approved requests always pass through it before execution and whether revalidation has its own explicit runtime semantics.
102
+
103
+
### Governed Execution Manager
104
+
105
+
Once approvals and version resolution exist, the runtime needs one orchestrator that closes the loop.
Copy file name to clipboardExpand all lines: Docs/Roadmap.md
+82-61Lines changed: 82 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This document captures the most valuable next steps for `ModularityKit.Mutator` based on the current state of the API, runtime, and examples.
4
4
5
-
The goal is not to add features for their own sake. The goal is to close gaps between the public model and the runtime behavior, then extend the engine into a more complete governance platform for state mutations.
5
+
The goal is not to add features for their own sake. The goal is to close gaps between the public model and the runtime behavior, then complete the governed execution loop and extend the engine into a more operational governance platform for state mutations.
6
6
7
7
## Principles
8
8
@@ -15,102 +15,120 @@ The goal is not to add features for their own sake. The goal is to close gaps be
15
15
16
16
These areas already exist in the model but are only partially realized in the runtime:
17
17
18
-
-`PolicyRequirement` exists, but there is no approval lifecycle around it.
18
+
-Governance now has request lifecycle, approval workflow, and version resolution primitives, but the end-to-end execution loop is still incomplete.
19
19
-`MutationIntent.IsReversible` exists, but there is no undo or compensation mechanism.
20
-
-`MutationEngineOptions.MaxConcurrentMutations` exists, but concurrency control is not enforced in runtime execution.
20
+
-`MutationEngineOptions.MaxConcurrentMutations` exists, but concurrency control is not enforced in core mutation execution.
21
21
-`MutationIntent.EstimatedBlastRadius`, `Tags`, and `Metadata` exist, but the engine does not yet use them for governance or query workflows.
22
-
-The project has examples and benchmarks, but no dedicated test project yet.
22
+
-Approved governance requests do not yet flow through a single runtime path that performs version resolution, mutation execution, audit/history persistence, and terminal executed-state recording.
23
23
24
-
## v1.1 Governance Runtime
24
+
## v1.1 Governance Runtime Hardening
25
25
26
-
Focus: establish a first-class governance runtime centered around mutation requests, pending execution, and version-aware decision making.
26
+
Focus: close the governed execution loop and harden the current governance runtime rather than introducing the first lifecycle concepts.
27
27
28
-
### 1. Pending Mutation Lifecycle
28
+
### 1. Governed Execution Manager
29
29
30
-
Add a first-class lifecycle around deferred mutation requests.
30
+
Add a first-class runtime path that executes approved governance requests end to end.
31
31
32
32
Scope:
33
33
34
-
- Introduce a `PendingMutation` or `MutationRequest` model for governed execution.
35
-
-Support pending reasons beyond approval, such as external checks, scheduling, or dependencies.
36
-
-Support approval expiration and explicit cancellation.
37
-
-Persist approval decisions and approval history.
38
-
-Define re-execution rules when a pending mutation is resolved against a newer state version.
39
-
-Support listing and resolving pending mutation records.
34
+
- Introduce a `GovernanceExecutionManager` or equivalent orchestration runtime for approved requests.
35
+
-Always perform version resolution before executing an approved request.
36
+
-Execute the underlying mutation through the core runtime once the request is still valid.
37
+
-Record execution outcome, resulting state version, and terminal request decision.
38
+
-Mark requests as `Executed`, rejected as stale, or sent back into a renewed approval / revalidation path.
39
+
-Ensure audit and history flows capture both request-level and execution-level outcomes.
40
40
41
41
Why this matters:
42
42
43
-
-Approval workflow is only one specialization of pending execution.
44
-
-A single `PendingApproval` status in `MutationResult`is not enough once the engine owns a real governance process.
43
+
-Governance runtime already knows how to hold, approve, reject, expire, and version-check requests.
44
+
-The biggest missing behavior is the actual transition from approved request to governed mutation execution.
45
45
46
-
### 2. Approval Workflow for `PolicyRequirement`
46
+
### 2. Approval Workflow Hardening
47
47
48
-
Add first-class support for approval-based policy outcomes.
48
+
Harden the approval model now that first-class approval workflow exists.
49
49
50
50
Scope:
51
51
52
-
- Introduce a pending approval result state for blocked mutations that require action rather than hard denial.
53
-
- Persist approval requirements to audit and history.
54
-
- Add follow-up mutations such as `ApproveRequirement` and `RejectRequirement`.
55
-
- Support multi-step approvals such as two-man approval and role-based approval chains.
52
+
- Replace generic approval failure paths with explicit domain exceptions and outcomes where they still leak through.
0 commit comments