Skip to content

fix(aws/ladder): reject nil reshape payment caps instead of treating them as unlimited - #605

Merged
cristim merged 2 commits into
mainfrom
fix/83-reject-nil-cap
Oct 20, 2026
Merged

cristim merged 2 commits into
mainfrom
fix/83-reject-nil-cap

Conversation

@cristim

@cristim cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member

ReshapeBuffer always runs in auto mode, and a nil MaxPaymentPerExchangeUSD / MaxPaymentDailyUSD was mapped to math.MaxFloat64, so an omitted field meant unlimited spend. Both caps are now required: requireCap (replacing capOrUnlimited) returns a loud error for nil, and unlimitedCapUSD is removed. This is option (a) from the triage; no production caller wires the write side yet, so runtime behavior is unchanged today.

The old nil-case test is replaced by TestReshapeBuffer_CapMapping_NilRejected (fails before the change: no error returned). go build, go vet, go test -count=1 ./... and golangci-lint on providers/aws pass with and without GOWORK=off.

Follow-up: the "nil means no cap" doc comment in pkg/ladder/capability.go is now stale. It is left untouched to avoid conflicting with the open #441, which edits that file.

Part of #83

🤖 Generated with Claude Code

…them as unlimited

ReshapeBuffer always runs in auto mode, and a nil MaxPaymentPerExchangeUSD
or MaxPaymentDailyUSD was mapped to math.MaxFloat64, so an omitted field
meant unlimited spend. Both caps are now required: requireCap (replacing
capOrUnlimited) returns a loud error for nil and the unlimitedCapUSD
constant is removed. No production caller wires the write side yet, so
nothing changes at runtime today.

The stale "nil means no cap" doc in pkg/ladder/capability.go is left for a
follow-up to avoid conflicting with the open #441, which edits that file.

Part of #83

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 22 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 88 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: bd6b1950-1c9f-4c29-99ee-360b60eb3f1c
📥 Commits

Reviewing files that changed from the base of the PR and between da55737 and 7e58441.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • providers/aws/ladder/reshape.go
  • providers/aws/ladder/reshape_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Merge gate verdict (claude-cc-libs)

Every gate holds at head 7e58441:

  • Two independent reviews approve the reviewed head 1c5c7c8. The branch was then updated from main, and the PR diff is byte-identical to the reviewed diff (compared mechanically).
  • CI is green on 7e58441, which is the reviewed change on top of current main.
  • 0 unresolved threads; MERGEABLE/CLEAN.

CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging.

@cristim
cristim merged commit 205cf99 into main Oct 20, 2026
15 checks passed
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