Skip to content

v0.10.0 — restructure to /go/ subtree + audit COMPLIANT (Mantis #1246)#7

Merged
Snider merged 1 commit into
mainfrom
dev
May 1, 2026
Merged

v0.10.0 — restructure to /go/ subtree + audit COMPLIANT (Mantis #1246)#7
Snider merged 1 commit into
mainfrom
dev

Conversation

@Snider

@Snider Snider commented May 1, 2026

Copy link
Copy Markdown
Contributor

Restructure go-ratelimit to canonical /go/ subtree layout, full v0.9.0 contract migration, audit verdict COMPLIANT (197 baseline findings → 0). Closes Mantis #1246.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added comprehensive example tests demonstrating rate limiter usage, configuration, and lifecycle management.
  • Documentation

    • Added repository conventions document.
  • Tests

    • Reorganised and expanded test suite with improved coverage across rate limiter operations.
  • Chores

    • Updated internal dependencies and refactored code structure for consistency.

…1246)

- Move all .go sources from repo root into /go/ subtree (canonical layout)
- Add go.work at repo root + external/go submodule (https://github.com/dappcore/go.git@dev)
- Migrate to v0.9.0 contracts: core.Result, core.E, c.Fs(), c.Process(), c.I18n()
- Replace banned stdlib imports (os/os.exec/fmt/errors/strings/path/log/json/bytes)
- Add docs skeleton (AGENTS.md)
- Backfill Test<File>_<Symbol>_{Good,Bad,Ugly} triplets + Example<Symbol> coverage

Verification:
- GOWORK=off go build ./...    clean
- GOWORK=off go vet ./...      clean
- GOWORK=off go test -count=1 -short ./...  clean
- audit.sh verdict: COMPLIANT (every counter at 0)

Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=1246
@Snider Snider merged commit b4a2867 into main May 1, 2026
4 of 7 checks passed
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 83df8ddb-3f5d-4d1a-b695-826afb05df88

📥 Commits

Reviewing files that changed from the base of the PR and between 206a2e2 and 48ac2b3.

⛔ Files ignored due to path filters (2)
  • go.work is excluded by !**/*.work
  • go/go.sum is excluded by !**/*.sum
📒 Files selected for processing (16)
  • .gitmodules
  • AGENTS.md
  • ax7_public_test.go
  • external/go
  • go/assertions_test.go
  • go/error_test.go
  • go/go.mod
  • go/iter_test.go
  • go/ratelimit.go
  • go/ratelimit_example_test.go
  • go/ratelimit_test.go
  • go/sqlite.go
  • go/sqlite_test.go
  • go/tests/cli/ratelimit/Taskfile.yaml
  • go/tests/cli/ratelimit/main.go
  • tests/cli/ratelimit/main.go

📝 Walkthrough

Walkthrough

The PR refactors test naming conventions across multiple files from descriptive suffixes (_Good, _Bad, _Ugly) to standardized _Case patterns, standardizes utility imports to use dappco.re/go equivalents instead of stdlib, registers a new git submodule for external Go code, adds boundary annotations to function signatures, introduces comprehensive example tests, and restructures a CLI program.

Changes

Cohort / File(s) Summary
Git & Module Management
.gitmodules, external/go
Registers new external/go git submodule pointing to https://github.com/dappcore/go.git on dev branch and updates submodule commit pointer to d661b703e16183b3cbab101de189f688888a1174.
Documentation
AGENTS.md
Introduces new conventions document specifying SPDX licensing, module layout (core/go v0.9.0 consumer pattern), Go module location under go/, usage of dappco.re/go primitives, test naming rules, and restrictions on editing specific directories.
Test Suite Removal
ax7_public_test.go
Removes entire 704-line AX7 public test suite covering rate-limiter constructors, quota/decision logic, persistence backends (YAML/SQLite), migrations, and token counting via HTTP mock.
Test Naming Refactoring
go/error_test.go, go/iter_test.go, go/ratelimit_test.go, go/sqlite_test.go
Standardises test function names by replacing _Good, _Bad, _Ugly suffixes with _Case, _Case_2, _Case_3, or line-number-based identifiers; test logic remains unchanged.
Import Standardisation
go/assertions_test.go, go/ratelimit_test.go, go/sqlite_test.go
Replaces stdlib imports (fmt, strings, errors) with dappco.re/go equivalents (core.Sprint, core.Sprintf, core.Contains, core.Is).
Core Boundary Annotations
go/ratelimit.go, go/sqlite.go
Adds trailing /* core result boundary */ comment markers to function signature lines of public/private constructors, methods, and helpers (e.g., New, Load, Persist, Close, SQLite store operations, migration utilities).
New Example Tests
go/ratelimit_example_test.go
Introduces 182-line suite of Example* functions exercising rate-limiter lifecycle (New, NewWithConfig, Load, Persist, Close), operations (CanSend, RecordUsage, WaitForCapacity, Reset, Decide), statistics/iteration, SQLite backends, and token counting via API.
CLI Program Restructure
go/tests/cli/ratelimit/main.go, tests/cli/ratelimit/main.go
Replaces old CLI implementation with new version that uses dappco.re/go result-wrapper pattern; evaluates CanSend and Decide for a model, outputs decision details as JSON, and persists state.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Review rate limit: 3/5 reviews remaining, refill in 20 minutes and 50 seconds.

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

@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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