Repository navigation
Claude/server events implementation u e xga - #51
Merged
Merged
Conversation
Critical fixes: - C1: EventEmitterService now implements DisposableBean with destroy() that calls awaitTermination(30s) on shutdown. Prevents pending events from being silently dropped when JVM exits. - C2: DeliveryHandler staleness check now handles null attemptedAt by logging a warning and treating delivery as fresh (null shouldn't occur but defensive against malformed data). - C3: ReservationController commit overage check adds null guard on Amount.getAmount() (Long boxed type can be null). - C4: DecisionController DENY event now includes scope from response.getAffectedScopes(), matching ReservationController pattern. Also sets scope in EventDataReservationDenied builder. High fixes: - H2: RetryScheduler batch size now configurable via dispatch.retry.batch-size (default 100). Prevents backlog during spikes. - H3: WebhookService.test() catches JsonProcessingException separately from HTTP delivery errors for clearer debugging. https://claude.ai/code/session_016Q37ybM3sjFmUFvpRektgV
amavashev
added a commit
that referenced
this pull request
Apr 17, 2026
Closes v0.1.25.21 spec gap (second bullet): two new AdminKeyAuth-only endpoints — POST /v1/admin/tenants/bulk-action and POST /v1/admin/webhooks/bulk-action — with matching safety gates (empty-filter 400, expected_count 409 COUNT_MISMATCH, 500-row cap 400 LIMIT_EXCEEDED, 15-minute idempotency replay). Ships with a new Redis-backed IdempotencyStore under cycles-admin-service-data for bulk-action envelope caching. The existing BudgetController.fund idempotency is deliberately NOT migrated onto this store — fund-path idempotency is atomic inside its Redis Lua script with the balance mutation; externalising would break that atomicity. Rationale documented inline in IdempotencyStore.java javadoc and in AUDIT.md. Paired with cycles-protocol PR #51 (spec v0.1.25.23) which widens the ErrorCode enum to include COUNT_MISMATCH and LIMIT_EXCEEDED required by v0.1.25.21 prose but missing from the enum. Cloud CI on this branch will be red until PR #51 merges to cycles-protocol main; local verify passes with a cache-seeded v0.1.25.23 spec (646/646 tests, JaCoCo ≥95% on both data and api modules). - Model: BulkActionRowOutcome (shared), TenantBulkAction/Filter/Request/Response, WebhookBulkAction/Filter/Request/Response. - Data: TenantRepository.matchForBulk, WebhookRepository.matchForBulk (cap+1 sentinel for LIMIT_EXCEEDED detection without full hydration). - Api: bulkAction controllers + per-row applyTenantAction/applyWebhookAction with try/catch classifying GovernanceException via classifyFailureCode and generic exceptions as INTERNAL_ERROR. Reads live status at apply-time so concurrent mutations land in the correct per-row outcome bucket. - AuthInterceptor: admin-only routing for both bulk-action paths. - Contract tests: KNOWN_MISSING allowlists emptied; bulk-action now fully covered by OpenApiContractDiffTest and SpecCoverageReportTest. - AUDIT.md: spec header → info.version 0.1.25.23; full release section describing endpoints, safety gates, apply semantics, IdempotencyStore rationale, and verification. - pom.xml: revision 0.1.25.25 → 0.1.25.26.
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checklist
AUDIT.mdupdated (if protocol surface changed)README.mdupdated (if public API changed)Test plan