MOPC-App/docs/round-redesign-architecture.../mixed-round-design-implemen.../shared/api-contracts.md

98 lines
1.8 KiB
Markdown

# API Contracts
## Contract Conventions
- All mutations return typed `errorCode` and machine-readable `details` on failure.
- All state-changing operations emit deterministic audit events.
- All response shapes include stable identifiers for client cache invalidation.
## Router Families
### `pipeline`
- `pipeline.create`
- `pipeline.update`
- `pipeline.simulate`
- `pipeline.publish`
- `pipeline.getSummary`
### `stage`
- `stage.create`
- `stage.updateConfig`
- `stage.list`
- `stage.transition`
- `stage.openWindow`
- `stage.closeWindow`
### `routing`
- `routing.preview`
- `routing.execute`
- `routing.listRules`
- `routing.upsertRule`
- `routing.toggleRule`
### `filtering`
- `filtering.previewBatch`
- `filtering.runStageFiltering`
- `filtering.getManualQueue`
- `filtering.resolveManualDecision`
### `assignment`
- `assignment.previewStageProjects`
- `assignment.assignStageProjects`
- `assignment.getCoverageReport`
- `assignment.rebalance`
### `cohort`
- `cohort.create`
- `cohort.assignProjects`
- `cohort.openVoting`
- `cohort.closeVoting`
### `live`
- `live.start`
- `live.setActiveProject`
- `live.jump`
- `live.reorder`
- `live.pause`
- `live.resume`
### `decision`
- `decision.override`
- `decision.auditTimeline`
### `award`
- `award.createTrack`
- `award.configureGovernance`
- `award.routeProjects`
- `award.finalizeWinners`
## Error Contract
- `BAD_REQUEST`
- `UNAUTHORIZED`
- `FORBIDDEN`
- `NOT_FOUND`
- `CONFLICT`
- `PRECONDITION_FAILED`
- `INTERNAL_SERVER_ERROR`
## Event Contract (Representative)
- `stage.transitioned`
- `routing.executed`
- `filtering.completed`
- `assignment.generated`
- `live.cursor.updated`
- `cohort.window.changed`
- `decision.overridden`
- `award.winner.finalized`