Skip to content

Claude/server events implementation u e xga - #51

Merged
amavashev merged 2 commits into
mainfrom
claude/server-events-implementation-uEXga
Apr 1, 2026
Merged

amavashev merged 2 commits into
mainfrom
claude/server-events-implementation-uEXga

Conversation

@amavashev

Copy link
Copy Markdown
Collaborator

Summary

Checklist

  • Tests added/updated for new behavior
  • AUDIT.md updated (if protocol surface changed)
  • README.md updated (if public API changed)
  • Lint and test suite passes locally

Test plan

claude and others added 2 commits April 1, 2026 14:01
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
amavashev merged commit 9d48d8d into main Apr 1, 2026
1 of 2 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants