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
### 2026-04-07 — v0.1.25.4: Event data payload completeness
10
+
11
+
**Compliance review** against protocol spec v0.1.25 + admin spec v0.1.25 found 5 event data payload gaps. Core protocol (endpoints, schemas, error codes, Lua scripts, idempotency, scope derivation, auth/tenancy) was fully compliant.
12
+
13
+
**Fixes applied:**
14
+
15
+
| # | Issue | Fix |
16
+
|---|-------|-----|
17
+
| 1 |`EventDataReservationDenied` missing `unit`, `remaining`, `action`, `subject`| Populated from request context in DecisionController and ReservationController |
18
+
| 2 |`EventDataCommitOverage` missing `scope`, `unit`, `estimatedAmount`, `overage`, `overagePolicy`, `debtIncurred`| Populated from CommitResponse internal fields; added `scope_path`/`overage_policy` to commit.lua return. Audit fix: uses `request.actual` (not `response.charged`) for actualAmount/overage — charged is capped by ALLOW_IF_AVAILABLE |
19
+
| 3 |`EventDataBudgetDebtIncurred` missing `reservationId`, `debtIncurred`, `overagePolicy`| Added per-scope `debt_incurred` tracking in commit.lua/event.lua via `scope_debt_incurred` table; plumbed through `scopeDebtIncurred` map in CommitResponse/EventCreateResponse; `emitBalanceEvents()` overload with full context |
20
+
| 4 |`budget.exhausted` emitted with `null` data | Now emits `EventDataBudgetThreshold` with scope, unit, threshold=1.0, utilization, allocated, remaining=0, spent, reserved, direction="rising" |
21
+
| 5 |`Event.actor` missing `keyId` and `sourceIp`| Added `keyId` to `ApiKeyAuthentication`; `buildActor()` helper in BaseController extracts keyId from auth context and sourceIp from HttpServletRequest |
22
+
23
+
**Modified files:**
24
+
-`commit.lua` — returns `scope_path`/`overage_policy` in response; tracks per-scope `scope_debt_incurred` table, includes in balance snapshots; version comment v0.1.24 → v0.1.25
25
+
-`event.lua` — tracks per-scope `scope_debt_incurred` table, includes in balance snapshots
**Write-path analysis:** All write operations are within noise of v0.1.25.3. Reserve (5.7ms vs 6.2ms), Commit (4.7ms vs 4.1ms), Release (4.8ms vs 4.8ms), Extend (7.6ms vs 7.4ms), Decide (5.5ms vs 5.5ms), Event (5.1ms vs 5.2ms) — all within normal environmental variance. The extra HMGET field in commit.lua (`scope_path`) and the `scope_debt_incurred` table insert add no measurable overhead — both are in-memory Lua operations on a single Redis thread. The `buildActor()` helper is a lightweight SecurityContext lookup (no I/O). The ObjectMapper.convertValue for action/subject maps only executes on the DENY path (not the benchmark happy path). No regressions detected.
41
+
42
+
### Single-Threaded Read-Path Latency
43
+
44
+
| Operation | p50 | p95 | p99 | min | max | mean |
**Read-path analysis:** Read operations are slightly higher than v0.1.25.3 (GET reservation 3.8ms vs 2.8ms, GET balances 4.0ms vs 2.9ms) — environmental variance from container state. No read-path code was changed. These numbers remain well within acceptable range and are consistent with v0.1.25.1 baselines (GET reservation 4.0ms, GET balances 4.1ms).
**Concurrency analysis:** Throughput at 32 threads is 2,655 ops/s — within 8% of v0.1.25.3's 2,873 ops/s, attributable to environmental variance. The scaling ratio from 8→32 threads is 3.4x (789 → 2,655 ops/s), consistent with prior versions (v0.1.25.3: 3.5x, v0.1.25.1: 3.2x). p99 at 32 threads (29.8ms) is higher than v0.1.25.3's 19.3ms but comparable to v0.1.24.3's 22.7ms — container GC variance. Zero errors at all concurrency levels. The benchmark happy-path lifecycle does not trigger overdraft logic, so the new `scope_debt_incurred` table tracking is a no-op during benchmarks. Real-world overhead for overdraft commits would be one additional Lua table insert per scope — negligible compared to Redis I/O.
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-api/src/main/java/io/runcycles/protocol/api/auth/ApiKeyAuthentication.java
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-api/src/main/java/io/runcycles/protocol/api/auth/ApiKeyAuthenticationFilter.java
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-api/src/main/java/io/runcycles/protocol/api/controller/BaseController.java
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-api/src/main/java/io/runcycles/protocol/api/controller/DecisionController.java
Copy file name to clipboardExpand all lines: cycles-protocol-service/cycles-protocol-service-api/src/main/java/io/runcycles/protocol/api/controller/EventController.java
0 commit comments