Repository navigation
fix(ladder): convert amend ceiling amounts by the amended tranche's basis - #969
Conversation
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 55 minutes for your next included review. View limit details
Comment |
|
Automated review of
Posted by a read-only review sweep. It stays silent on this commit and re-reviews only after a new push. |
Independent review verdict (ladder stack #968 → #969 → #972): CLEAN
Reviewer: fresh Claude agent (Sonnet, high effort), not the author, cold brief, covering each PR's own diff and the whole stack against main. The PR bodies were treated as claims. Coordinator: claude-cc-reviewer. Blocking findings: none. Non-blocking notes (follow-ups before the go bump):
What was attacked and how (local macOS):
Gate: labels are set on each PR (they reference #799, with no closing issue). CI must be green at each head. Merge order is #968, then #969 rebased onto main, then #972 rebased onto main. Each rebase needs an empty |
201b877 to
f4a286a
Compare
2c390a1 to
6cc1b90
Compare
Independent review at 2c390a1Verdict: no actionable findings in the code of this PR (it inherits the lint blocker and test-strength gaps from #968, reviewed at 201b877, which must land first). Observations
Attacked
Mutation probesKilled: NULL assumption disabled; netting assumes NULL; old amount unconverted; new amount unconverted; ceiling Local verification (native local PostgreSQL 17 integration with synthetic data)At this SHA in a fresh detached scratch worktree: |
Rebase + delta: verdict carried to the new headsThe stack was rebased onto main (picks up #960) by claude-cc-impl. Range-diffs against the reviewed heads: Delta review of f4a286a (same independent reviewer): CLEAN.
The CLEAN stack verdict above therefore covers #968 f4a286a, #969 6cc1b90 and #972 57c3dd5. Merge order is #968, then #969, then #972, each when its CI is green. (claude-cc-reviewer) |
…wn basis The config-wide amend ceiling is in on-demand-equivalent dollars, but the amended tranche's old and new amounts were subtracted and added as stored numbers. A raise on a commitment-basis row (rate 0.5) could therefore pass while its on-demand equivalent exceeded the ceiling. Old and new amounts now convert by that row's basis and rate, and the comparison is exact in big.Rat. A NULL basis (rows from before 000121, left unknown by #886) is assumed on-demand-equivalent on this path, as before; netting still fails loud. Records the open risk that a future executor could claim a legacy on-demand row as commitment dollars. Refs #799 Refs LeanerCloud/cloud-commitments-go#349 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6cc1b90 to
2952deb
Compare
|
Retargeted to main after #968 merged (f064294) and rebased with |
Summary
The ladder amend ceiling now converts the amended tranche's old and new amounts into on-demand-equivalent (OD) dollars using that tranche's own
amount_basisandcommitment_rate, and compares against the OD ceiling exactly inbig.Rat.Why
The ceiling is
LEAST(target, baseline*coverage) - existing, which is in OD. Once tranches are stored in commitment dollars (after the go bump, cloud-commitments-go#349), comparing a raw commitment amount against it would let an amend raise exceed target coverage by 1/rate. The independent plan review found this. Fixing it before any commitment writer exists keeps main safe.Changes
checkLadderConfigCeilingnets in-flight and settled rows per row in OD, building on fix(ladder): net in-flight tranches per row basis in on-demand-equivalent dollars #968. It convertsold/newby the amended row's basis and rate, and compares exactly against the ceiling in micros.Verification
checkLadderRunTotalon a single-basis run.TestLadderAmendCeiling_RaiseOnCommitmentRowNetsInOnDemand.go build ./...andgo vet -tags integration ./...are clean.-run 'LadderAmend|LadderNetting'integration tests pass against a native local PostgreSQL 17 on loopback, using the same overlay as fix(ladder): net in-flight tranches per row basis in on-demand-equivalent dollars #968.Stack: base is #968 (
fix/ladder-basis-aware-netting). This PR retargets to main after #968 merges. Refs #799, refs LeanerCloud/cloud-commitments-go#349.🤖 Generated with Claude Code