|
| 1 | +# ADR-019: Governance Package Separation |
| 2 | + |
| 3 | +## Tag |
| 4 | +#adr_019 |
| 5 | + |
| 6 | +## Status |
| 7 | +Accepted |
| 8 | + |
| 9 | +## Date |
| 10 | +2026-06-21 |
| 11 | + |
| 12 | +## Scope |
| 13 | +ModularityKit.Mutator |
| 14 | +ModularityKit.Mutator.Governance |
| 15 | + |
| 16 | +## Context |
| 17 | + |
| 18 | +`ModularityKit.Mutator` started as focused mutation runtime: |
| 19 | + |
| 20 | +- mutation execution |
| 21 | +- policy evaluation |
| 22 | +- audit and history basics |
| 23 | +- side effects |
| 24 | +- metrics and interception |
| 25 | + |
| 26 | +At the same time, the roadmap and emerging API gaps point toward broader governance model: |
| 27 | + |
| 28 | +- mutation requests |
| 29 | +- pending execution lifecycle |
| 30 | +- approval workflows |
| 31 | +- version aware deferred execution |
| 32 | +- governance-specific persistence and query capabilities |
| 33 | +- compensation and resolution flows |
| 34 | + |
| 35 | +Those concerns are related to mutation execution, but they are not the same layer. |
| 36 | + |
| 37 | +If they are added directly into the core package, the main risk is that `ModularityKit.Mutator` turns from lightweight mutation runtime into heavy workflow and governance framework. That would make the core package harder to understand, harder to keep small, and harder to adopt for users who only need deterministic mutation execution. |
| 38 | + |
| 39 | +## Decision |
| 40 | + |
| 41 | +- Keep `ModularityKit.Mutator` as the core execution package. |
| 42 | +- Introduce `ModularityKit.Mutator.Governance` as separate package in the same repository. |
| 43 | +- Place governance specific abstractions and runtime components under the governance package rather than in the core runtime. |
| 44 | +- Keep both packages in one repository for now, with separate project files and separate package boundaries. |
| 45 | + |
| 46 | +Current package split: |
| 47 | + |
| 48 | +### Core: `ModularityKit.Mutator` |
| 49 | + |
| 50 | +Responsible for: |
| 51 | + |
| 52 | +- mutation execution |
| 53 | +- policy evaluation |
| 54 | +- audit and history basics |
| 55 | +- side effects |
| 56 | +- metrics |
| 57 | +- interceptor pipeline |
| 58 | + |
| 59 | +### Extension: `ModularityKit.Mutator.Governance` |
| 60 | + |
| 61 | +Responsible for: |
| 62 | + |
| 63 | +- `MutationRequest` |
| 64 | +- pending mutation lifecycle |
| 65 | +- request decisions and resolution |
| 66 | +- approval-oriented contracts |
| 67 | +- governance request storage contracts |
| 68 | + |
| 69 | +## Design Rationale |
| 70 | + |
| 71 | +- Preserves small and execution focused core package. |
| 72 | +- Allows governance to evolve at different pace than the core runtime. |
| 73 | +- Makes governance an opt in capability instead of default weight for all users. |
| 74 | +- Keeps repo level development simple by avoiding an early split into multiple repositories. |
| 75 | +- Provides a clean place for future packages such as persistence providers without polluting the core runtime surface. |
| 76 | + |
| 77 | +## Consequences |
| 78 | + |
| 79 | +### Positive |
| 80 | + |
| 81 | +- The mutation engine stays focused on direct execution concerns. |
| 82 | +- Governance can grow into a richer model without forcing all consumers to adopt it. |
| 83 | +- Future packages such as `EntityFrameworkCore` or `PostgreSql` governance providers have natural home. |
| 84 | +- The repository structure now reflects the architectural boundary explicitly. |
| 85 | + |
| 86 | +### Negative |
| 87 | + |
| 88 | +- Some concepts will span package boundaries and require careful API ownership. |
| 89 | +- Documentation must explain clearly when a feature belongs to core versus governance. |
| 90 | +- Cross-package evolution will need discipline to avoid circular design pressure. |
| 91 | + |
| 92 | +## Follow up |
| 93 | + |
| 94 | +- Keep new governance runtime features out of `ModularityKit.Mutator` unless they are fundamental to direct execution. |
| 95 | +- Grow pending lifecycle, approval flow, and request storage inside `ModularityKit.Mutator.Governance`. |
| 96 | +- Revisit repo/package boundaries only if governance becomes large enough to justify separate repository in the future. |
0 commit comments