|
| 1 | +# ADR-026: Governance Request Query API |
| 2 | + |
| 3 | +## Tag |
| 4 | +#adr_026 |
| 5 | + |
| 6 | +## Status |
| 7 | +Proposed |
| 8 | + |
| 9 | +## Date |
| 10 | +2026-06-22 |
| 11 | + |
| 12 | +## Scope |
| 13 | +ModularityKit.Mutator.Governance |
| 14 | + |
| 15 | +## Context |
| 16 | + |
| 17 | +The governance package is moving toward durable request lifecycle, approval history, and future persistence providers. |
| 18 | + |
| 19 | +Point lookups by request id are not enough for operational governance scenarios. Users need queries such as: |
| 20 | + |
| 21 | +- all pending approvals |
| 22 | +- requests for a given state |
| 23 | +- requests by actor |
| 24 | +- requests by category or risk level |
| 25 | +- requests filtered by tags, metadata, or blast radius |
| 26 | +- recent approval decisions |
| 27 | + |
| 28 | +Without a query API, persistence becomes only storage and governance data remains hard to use operationally. |
| 29 | + |
| 30 | +## Decision |
| 31 | + |
| 32 | +The governance package should define a storage-agnostic request query API. |
| 33 | + |
| 34 | +Expected direction: |
| 35 | + |
| 36 | +- expose query-oriented contracts in the governance package |
| 37 | +- support filtering by status, pending reason, actor, category, and time range |
| 38 | +- support governance-specific filters such as tags, metadata, and blast radius |
| 39 | +- support approval-oriented views such as pending approval queues and recent decisions |
| 40 | +- keep the query surface provider-neutral so future persistence packages can implement it consistently |
| 41 | + |
| 42 | +The exact query object model is intentionally left open for the first implementation. |
| 43 | + |
| 44 | +## Design Rationale |
| 45 | + |
| 46 | +- Governance data becomes useful only when it is operationally queryable. |
| 47 | +- Query semantics should be owned by governance rather than improvised in store implementations. |
| 48 | +- A storage-agnostic contract keeps future provider packages aligned. |
| 49 | + |
| 50 | +## Consequences |
| 51 | + |
| 52 | +### Positive |
| 53 | + |
| 54 | +- Governance can support real review and operational workflows. |
| 55 | +- Future persistence providers have a clear contract to implement. |
| 56 | +- Tags, metadata, and blast radius fields get a practical consumer path. |
| 57 | + |
| 58 | +### Negative |
| 59 | + |
| 60 | +- Query surface design can grow quickly if not kept disciplined. |
| 61 | +- Different storage providers may support different performance characteristics for the same filters. |
| 62 | + |
| 63 | +## Related ADRs |
| 64 | + |
| 65 | +- ADR-020: Governance MutationRequest Model |
| 66 | +- ADR-022: Governance Request Decisions and Storage |
| 67 | +- ADR-023: Governance Versioned Request Resolution |
0 commit comments