Skip to content

Commit 1be043e

Browse files
rameerezclaude
andcommitted
Initial commit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit 1be043e

133 files changed

Lines changed: 5139 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
prompt: |
40+
REPO: ${{ github.repository }}
41+
PR NUMBER: ${{ github.event.pull_request.number }}
42+
43+
Please review this pull request and provide feedback on:
44+
- Code quality and best practices
45+
- Potential bugs or issues
46+
- Performance considerations
47+
- Security concerns
48+
- Test coverage
49+
50+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
51+
52+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
53+
54+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55+
# or https://code.claude.com/docs/en/cli-reference for available options
56+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
57+

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
actions: read # Required for Claude to read CI results on PRs
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@v1
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
39+
# This is an optional setting that allows Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44+
# prompt: 'Update the pull request description to include a summary of changes.'
45+
46+
# Optional: Add claude_args to customize behavior and configuration
47+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48+
# or https://code.claude.com/docs/en/cli-reference for available options
49+
# claude_args: '--allowed-tools Bash(gh pr:*)'
50+

.github/workflows/test.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "*.md"
7+
- "LICENSE.txt"
8+
push:
9+
branches:
10+
- main
11+
paths-ignore:
12+
- "*.md"
13+
- "LICENSE.txt"
14+
15+
jobs:
16+
# Main test suite - tests Ruby versions and Rails compatibility with SQLite
17+
sqlite:
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
ruby_version: ["3.3", "3.4", "4.0"]
24+
gemfile:
25+
- Gemfile
26+
- gemfiles/rails_7.2.gemfile
27+
- gemfiles/rails_8.1.gemfile
28+
29+
env:
30+
RAILS_ENV: test
31+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Set up Ruby ${{ matrix.ruby_version }}
38+
uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: ${{ matrix.ruby_version }}
41+
bundler-cache: true
42+
43+
- name: Run tests
44+
run: bundle exec rake test
45+
46+
- name: Upload test results
47+
if: failure()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: test-results-sqlite-ruby-${{ matrix.ruby_version }}-${{ matrix.gemfile }}
51+
path: test/reports/
52+
retention-days: 7
53+
54+
# PostgreSQL compatibility tests
55+
postgres:
56+
runs-on: ubuntu-latest
57+
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
ruby_version: ["3.4"]
62+
63+
services:
64+
postgres:
65+
image: postgres:16
66+
env:
67+
POSTGRES_USER: postgres
68+
POSTGRES_PASSWORD: postgres
69+
POSTGRES_DB: wallets_test
70+
ports:
71+
- 5432:5432
72+
options: >-
73+
--health-cmd="pg_isready -U postgres"
74+
--health-interval=10s
75+
--health-timeout=5s
76+
--health-retries=5
77+
78+
env:
79+
RAILS_ENV: test
80+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/wallets_test
81+
82+
steps:
83+
- name: Checkout code
84+
uses: actions/checkout@v4
85+
86+
- name: Set up Ruby ${{ matrix.ruby_version }}
87+
uses: ruby/setup-ruby@v1
88+
with:
89+
ruby-version: ${{ matrix.ruby_version }}
90+
bundler-cache: true
91+
92+
- name: Prepare database
93+
# Use db:migrate:reset instead of db:test:prepare to avoid loading schema.rb
94+
# which has SQLite-specific defaults that fail on PostgreSQL.
95+
# db:migrate:reset does: db:drop, db:create, db:migrate (using migrations, not schema.rb)
96+
run: bundle exec rake db:migrate:reset
97+
98+
- name: Run tests
99+
run: bundle exec rake test
100+
101+
- name: Upload test results
102+
if: failure()
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: test-results-postgres-ruby-${{ matrix.ruby_version }}
106+
path: test/reports/
107+
retention-days: 7
108+
109+
# MySQL compatibility tests
110+
mysql:
111+
runs-on: ubuntu-latest
112+
113+
strategy:
114+
fail-fast: false
115+
matrix:
116+
ruby_version: ["3.4"]
117+
118+
services:
119+
mysql:
120+
image: mysql:8
121+
env:
122+
MYSQL_ROOT_PASSWORD: root
123+
MYSQL_DATABASE: wallets_test
124+
ports:
125+
- 3306:3306
126+
options: >-
127+
--health-cmd="mysqladmin ping -h localhost"
128+
--health-interval=10s
129+
--health-timeout=5s
130+
--health-retries=5
131+
132+
env:
133+
RAILS_ENV: test
134+
DATABASE_URL: mysql2://root:root@127.0.0.1:3306/wallets_test
135+
136+
steps:
137+
- name: Checkout code
138+
uses: actions/checkout@v4
139+
140+
- name: Set up Ruby ${{ matrix.ruby_version }}
141+
uses: ruby/setup-ruby@v1
142+
with:
143+
ruby-version: ${{ matrix.ruby_version }}
144+
bundler-cache: true
145+
146+
- name: Prepare database
147+
# Use db:migrate:reset instead of db:test:prepare to avoid loading schema.rb
148+
# which has SQLite-specific defaults that fail on MySQL (JSON column defaults).
149+
# db:migrate:reset does: db:drop, db:create, db:migrate (using migrations, not schema.rb)
150+
run: bundle exec rake db:migrate:reset
151+
152+
- name: Run tests
153+
run: bundle exec rake test
154+
155+
- name: Upload test results
156+
if: failure()
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: test-results-mysql-ruby-${{ matrix.ruby_version }}
160+
path: test/reports/
161+
retention-days: 7

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
10+
test/dummy/db/*.sqlite3*
11+
test/dummy/log/*.log
12+
test/dummy/tmp/
13+
test/dummy/public/packs/
14+
test/dummy/public/packs-test/
15+
test/dummy/node_modules/
16+
test/dummy/Gemfile.lock
17+
test/dummy/config/master.key
18+
test/dummy/storage/*.sqlite3*
19+
test/dummy/log/*
20+
test/coverage/*
21+
**/.kamal/
22+
deploy.yml
23+
.DS_Store
24+
25+
/Gemfile.lock
26+
/gemfiles/*.gemfile.lock
27+
28+
/dist/
29+
*.gem
30+
31+
.cursor/
32+
.claude/
33+
.aux/
34+
35+
TODO
36+
pay.md

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
AllCops:
2+
TargetRubyVersion: 3.1
3+
4+
Style/StringLiterals:
5+
EnforcedStyle: double_quotes
6+
7+
Style/StringLiteralsInInterpolation:
8+
EnforcedStyle: double_quotes

.simplecov

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# frozen_string_literal: true
2+
3+
# SimpleCov configuration file (auto-loaded before test suite)
4+
# This keeps test_helper.rb clean and follows best practices
5+
6+
SimpleCov.start do
7+
# Use SimpleFormatter for terminal-only output (no HTML generation)
8+
formatter SimpleCov::Formatter::SimpleFormatter
9+
10+
# Track coverage for the lib directory (gem source code)
11+
add_filter "/test/"
12+
add_filter "/lib/generators/"
13+
14+
# Track Ruby files in lib directory
15+
track_files "lib/**/*.rb"
16+
17+
# Enable branch coverage for more detailed metrics
18+
enable_coverage :branch
19+
20+
# Keep the gate focused on the runtime wallet core, not install scaffolding.
21+
minimum_coverage line: 80, branch: 50
22+
23+
# Disambiguate parallel test runs
24+
command_name "Job #{ENV['TEST_ENV_NUMBER']}" if ENV['TEST_ENV_NUMBER']
25+
end
26+
27+
# Print coverage summary to terminal after tests complete
28+
SimpleCov.at_exit do
29+
SimpleCov.result.format!
30+
puts "\n" + "=" * 60
31+
puts "COVERAGE SUMMARY"
32+
puts "=" * 60
33+
puts "Line Coverage: #{SimpleCov.result.covered_percent.round(2)}%"
34+
branch_coverage = SimpleCov.result.coverage_statistics[:branch]&.percent&.round(2) || "N/A"
35+
puts "Branch Coverage: #{branch_coverage}%"
36+
puts "=" * 60
37+
end

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# AGENTS.md
2+
3+
This file provides guidance to AI Agents (like OpenAI's Codex, Cursor Agent, Claude Code, etc) when working with code in this repository.
4+
5+
Please go ahead and read the full context for this project at `.cursor/rules/0-overview.mdc` and `.cursor/rules/1-quality.mdc` now. Also read the README for a good overview of the project.

Appraisals

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
appraise "rails-7.2" do
4+
gem "rails", "~> 7.2.0"
5+
end
6+
7+
appraise "rails-8.1" do
8+
gem "rails", "~> 8.1.0"
9+
end

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## [0.1.0] - 2026-03-15
2+
3+
- Extract the neutral wallet ledger core from `usage_credits`
4+
- Add multi-asset wallets per owner via `has_wallets`
5+
- Add generic `credit`, `debit`, and `transfer_to` APIs
6+
- Keep append-only transactions, FIFO allocations, expirations, and callbacks
7+
- Add a neutral install generator, dummy app, and test suite

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
Please go ahead and read the full context for this project at `.cursor/rules/0-overview.mdc` and `.cursor/rules/1-quality.mdc` now. Also read the README for a good overview of the project.

0 commit comments

Comments
 (0)