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
- Overdraft/debt model (ALLOW_WITH_OVERDRAFT, is_over_limit, DEBT_OUTSTANDING)
48
+
- Overdraft/debt model (ALLOW_WITH_OVERDRAFT, is_over_limit, DEBT_OUTSTANDING — only blocks when overdraft_limit=0; ALLOW_WITH_OVERDRAFT falls back to ALLOW_IF_AVAILABLE when overdraft_limit=0)
49
49
- Grace period semantics (commits accepted through expires_at_ms + grace_period_ms)
Copy file name to clipboardExpand all lines: cycles-protocol-service/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,8 +160,8 @@ When `overage_policy` is omitted from the request, the server resolves it from t
160
160
161
161
- If `overdraft_limit` is absent or `0`, no overdraft is permitted (`ALLOW_WITH_OVERDRAFT` behaves as `ALLOW_IF_AVAILABLE`).
162
162
-**`debt`** is created when `overage_policy=ALLOW_WITH_OVERDRAFT` and the commit delta exceeds remaining budget.
163
-
- When `debt > 0`, **new reservations** against that scope are blocked with `409 DEBT_OUTSTANDING`.
164
-
- When `debt > overdraft_limit`, the scope enters **over-limit** state (`is_over_limit=true`). New reservations are then blocked with `409 OVERDRAFT_LIMIT_EXCEEDED` (takes precedence over `DEBT_OUTSTANDING`).
163
+
- When `debt > 0` and no `overdraft_limit` is configured (absent or `0`), **new reservations** against that scope are blocked with `409 DEBT_OUTSTANDING`. When an `overdraft_limit > 0` is set, debt within the limit does **not** block new reservations.
164
+
- When `debt > overdraft_limit`, the scope enters **over-limit** state (`is_over_limit=true`). New reservations are then blocked with `409 OVERDRAFT_LIMIT_EXCEEDED`.
165
165
- Debt does **not** block direct events (`/v1/events`); events always apply their own `overage_policy`.
166
166
- Existing active reservations MAY be committed or released normally while a scope is over-limit.
167
167
- Overdraft limit checks are per-commit and are **not** atomic across concurrent commits — concurrent commits may independently pass the check, causing total debt to temporarily exceed `overdraft_limit`. This is by design; the `is_over_limit` flag prevents further damage.
@@ -593,7 +593,7 @@ All errors use this envelope:
593
593
|`RESERVATION_FINALIZED`| 409 | Reservation already committed or released |
594
594
|`IDEMPOTENCY_MISMATCH`| 409 | Idempotency key reused with different parameters |
595
595
|`OVERDRAFT_LIMIT_EXCEEDED`| 409 |`debt + delta > overdraft_limit`; or scope is over-limit |
596
-
|`DEBT_OUTSTANDING`| 409 | Scope has unresolved debt; new reservations blocked |
596
+
|`DEBT_OUTSTANDING`| 409 | Scope has unresolved debt with no overdraft limit; new reservations blocked |
597
597
|`RESERVATION_EXPIRED`| 410 | Operation attempted after expiry window |
598
598
|`INTERNAL_ERROR`| 500 | Unexpected server error |
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-api/src/test/java/io/runcycles/protocol/api/CyclesProtocolIntegrationTest.java
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-data/src/main/java/io/runcycles/protocol/data/repository/RedisReservationRepository.java
0 commit comments