Skip to content

fix(archera): adopt validated comparison amounts and exact decimals - #2267

Merged
cristim merged 1 commit into
mainfrom
chore/2266-archera-pkg-adoption
Oct 18, 2026
Merged

cristim merged 1 commit into
mainfrom
chore/2266-archera-pkg-adoption

Conversation

@cristim

@cristim cristim commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Existing Archera comparisons now reject missing, null or negative selected_amount fields consistently by adopting the published shared-package revision 570d168c6bc7. Explicit zero remains valid. The CLI formatter also renders accepted tiny decimal amounts exactly instead of falling back to fractions.

Only the shared-package pin changes; provider pins remain unchanged. The formatter's bounded precision increases from 100 to 164 places to cover the decoder's existing token/exponent limits. This adds no listing command and is a prerequisite for #2266.

Validation:

  • Exact parent reproduction: 15 invalid selected-amount cases were incorrectly accepted, and two successfully decoded decimal cases rendered fractions. Seven controls passed.
  • Final focused tests: 33 top-level tests, 232 named passes, no failures.
  • Full CLI suite: 473 top-level tests; all passed. Six affected shared-package areas: 506 top-level tests; all passed.
  • Independent reviewer replay: six top-level tests with 32 named passes, including purchase guards, without failures/skips/races. Its exact parent replay reproduced all 17 intended failures and seven passing controls.
  • Build, vet, complexity, tidy, pinned lint and normal commit hooks passed.
  • Both independent reviewers completed two adversarial passes. Module graphs differ only in the selected shared-package version after normalization; all 32 changed cached package files match the published target source.

All transport and purchase-guard checks used synthetic boundaries. No vendor request, purchase, installation or deployment was performed.

Refs #2266.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the display of high-precision monetary amounts in Archera comparisons, preserving more decimal places where possible.

Reject invalid selected amounts and preserve accepted long decimal values
using the existing formatter. Keep all provider module pins unchanged.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 56 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 82 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-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: fd97711f-6af0-4d0f-acd8-cd80d6a67d96
📥 Commits

Reviewing files that changed from the base of the PR and between 021f162 and 1108603.

⛔ Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing: 3
  • cmd/archera_pkg_adoption_test.go
  • cmd/archera_render.go
  • go.mod

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 23e52387-4d66-4890-96da-2134cc5947f3
📥 Commits

Reviewing files that changed from the base of the PR and between 021f162 and 1108603.

⛔ Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing: 3
  • cmd/archera_pkg_adoption_test.go
  • cmd/archera_render.go
  • go.mod

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

📝 Walkthrough

Archera decimal formatting now tries more precisions before using a rational representation. The cloud commitments package dependency is updated. New tests cover comparison selected_amount values and decimal token boundaries.

Changes: Archera decimal handling

Layer / File(s) Summary
Update decimal handling
cmd/archera_render.go, go.mod
archeraMoney now tries precision up to 164 before falling back to a rational representation. The cloud commitments package dependency advances to a new revision.
Test comparison inputs and decimal boundaries
cmd/archera_pkg_adoption_test.go
Added tests for missing, null, negative, and zero selected_amount values in current offers and candidates. Added client and JSON CLI tests for accepted and rejected decimal tokens, including precision and token-length boundaries.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 11086

No specific issue remains that should delay merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the two main changes: validated Archera comparison amounts and exact decimal handling.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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 18, 2026

Copy link
Copy Markdown
Member Author

go441_reviewer_a

APPROVED 1108603 by go441_reviewer_a

Two adversarial code passes are clean. Verified tree 389003bf798ed818255f05c4138ef0bb83a6e387 and all four committed blobs match the reviewed/tested snapshot, with 109 changed lines. Independently replayed real CLI/client and purchase guards: six top-level tests, 32 named passes, no failures/skips/races. An exact parent scratch produced 17 intended regression failures and seven passing controls; its manifest remained unchanged. CI and normal merge gates remain separate.

@cristim

cristim commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

go441_reviewer_b

APPROVED 1108603 by go441_reviewer_b

Two adversarial code passes are clean. Independently mapped the commit, tree, parent and four blobs to the reviewed snapshot. Inspected parent/fixed regression, full consumer and affected shared-package evidence; recalculated module-graph equivalence after normalizing only the selected package version and checked all 32 changed cached files against the published target. No tests were rerun by this reviewer. CI and normal merge gates remain separate.

@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/low Minor harm urgency/this-quarter Within the quarter impact/few Limited audience effort/m Days type/feat New capability labels Oct 18, 2026
@cristim
cristim marked this pull request as ready for review October 18, 2026 11:18
@cristim

cristim commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your current included review allowance is based on your included PR review attempts over the past 7 days. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 56 minutes.

@cristim

cristim commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

resume-cc-audit

Exact head 11086030758c703cf4cc5700520505277797dc7b has both independent two-pass approvals, passing local verification and green CI. CodeRabbit comment6249258823 includes a completed review whose coverage metadata is kind: reviewed for this same SHA, with no actionable comments; the inline-comment list is empty. Its older rate-limit banner remains in the combined comment, but does not replace the later exact-head review evidence.

The optional docstring-coverage warning is dismissed: the production change is an existing private formatter's precision bound, and the new tests describe their contracts through names and assertions. No public API needs new documentation; redundant test comments conflict with the repository's guidance. No required check or protection is bypassed.

This prerequisite adds no listing command and does not complete #2266. A normal merge is authorized after one final current-head/protection check. The audited default-branch workflows perform CI only; no release tag, installation or deployment is included.

@cristim
cristim merged commit 83a7193 into main Oct 18, 2026
12 checks passed
@cristim
cristim deleted the chore/2266-archera-pkg-adoption branch October 18, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/few Limited audience priority/p2 Backlog-worthy severity/low Minor harm triaged Item has been triaged type/feat New capability urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant