Skip to content

Add EUPL-1.2 license, refresh submodules, and implement service registration#8

Merged
Snider merged 6 commits into
mainfrom
dev
Jun 29, 2026
Merged

Add EUPL-1.2 license, refresh submodules, and implement service registration#8
Snider merged 6 commits into
mainfrom
dev

Conversation

@Snider

@Snider Snider commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a Core service registration layer for the ratelimit package, enabling it to be used as a first-class service in the dappco.re/go framework. It provides a new Service type that exposes rate limiting operations (such as check, record, stats, decide, and reset) as Core actions, making integration and orchestration with other services straightforward. The update also includes comprehensive tests and usage examples, upgrades dependencies, and ensures all code is licensed under EUPL-1.2.

The most important changes are:

Core Service Integration:

  • Added service.go implementing the ratelimit.Service type, which wraps a live RateLimiter and registers action handlers (ratelimit.check, ratelimit.record, ratelimit.stats, ratelimit.decide, ratelimit.reset) for use as a Core service. This design allows consumers to interact with rate limiting through standard Core action plumbing.
  • Introduced OnStartup and OnShutdown lifecycle hooks for the service, ensuring action handlers are registered and limiter state is persisted as part of service management.

Testing and Examples:

  • Added service_test.go with comprehensive tests for service construction, startup, and shutdown, including edge cases and idempotency checks.
  • Added service_example_test.go with usage examples for constructing, starting up, and shutting down the service, demonstrating integration patterns.

Dependency and Compatibility Updates:

  • Upgraded the dappco.re/go dependency from v0.9.0 to v0.10.4 and updated the Go version to 1.26.2 for improved compatibility and features. [1] [2] [3]

Licensing:

  • Added the full EUPL-1.2 license text in the LICENCE file and ensured all new/modified files include SPDX license headers for compliance. [1] [2] [3] [4]

Snider and others added 6 commits May 1, 2026 08:34
Reference: core/api/LICENCE.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
…block)

- git submodule update on external/* to current dev tips
- go.work paths fixed for Phase 1 /go/ subtree layout where stale
- go.work go-version bumped 1.26.0 → 1.26.2 to match submodule floor

Workspace-mode build (`go build ./...`) is the verification path. Some
repos may surface transitive dep issues (api/go.sum checksum drift, etc.)
which are separate cascade tickets — not blocking this metadata refresh.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
Wires the *RateLimiter surface into Core's service-registration
plumbing behind a *core.ServiceRuntime[Config]. NewService() factory
builds the limiter via NewWithConfig() and returns a *Service ready
for c.Service() registration.

Action handlers exposed via OnStartup:
  ratelimit.check   — opts.model + opts.tokens → bool
  ratelimit.record  — opts.model + opts.prompt_tokens + opts.output_tokens
  ratelimit.stats   — opts.model → ModelStats (or full map)
  ratelimit.decide  — opts.model + opts.tokens → Decision
  ratelimit.reset   — opts.model → clear history

WaitForCapacity (blocking) + BackgroundPrune (returns cancel func) +
Models/Iter (iterators) stay direct method calls — not IPC-friendly.

OnShutdown persists state to disk; OnStartup is idempotent via Once.

Triplets + examples included; audit verdict COMPLIANT.

Co-authored-by: Hephaestus <hephaestus@lthn.ai>
Co-Authored-By: Virgil <virgil@lethean.io>
Advance external/go workspace submodule to v0.10.4 so dev (GOWORK on) and standalone (GOWORK=off) builds resolve the same core/go.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Virgil <virgil@lethean.io>
@Snider Snider merged commit 255f697 into main Jun 29, 2026
3 of 6 checks passed
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Snider, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5aaaeda-f2b4-44a4-905e-19497c628927

📥 Commits

Reviewing files that changed from the base of the PR and between b4a2867 and c896e6f.

⛔ Files ignored due to path filters (2)
  • go.work is excluded by !**/*.work
  • go/go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • LICENCE
  • external/go
  • go/go.mod
  • go/service.go
  • go/service_example_test.go
  • go/service_test.go
  • threats.md

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant