Skip to content

fix(cli): require interactive purchase confirmation - #2125

Merged
cristim merged 1 commit into
mainfrom
fix/1943-purchase-confirmation
Sep 30, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/1943-purchase-confirmation

Conversation

@cristim

@cristim cristim commented Sep 29, 2026

Copy link
Copy Markdown
Member

Removes the --yes flag and its confirmation bypass. Both AWS purchase paths now require an affirmative terminal response once for the whole run; nonterminal stdin is refused even when it contains yes. Unattended dry runs retain their reports and audit records. Existing commands with --yes are rejected during parsing.

Closes #1943.

Validation: the flag regression fails on the original code and passes after the fix. The full race suite passed, followed by focused race checks after test-only review corrections. Build, vet, golangci-lint 2.10.1 and normal commit hooks passed. Local pseudo-terminal checks drove the actual prompt and both coordinators: yes/y produced two successful fake SDK purchases, no/EOF produced none, and removed-flag CLI invocations reached no provider. These were local fake-provider scenarios with synthetic credentials, not cloud purchases.

The terminal prompt is an operator safeguard, not a security boundary against software that can control a terminal.

Independent gpt-6-astra review approved commit 2c6f21a00cab38b21baa748326f15b686a140b1d after two source-review passes and final runtime verification in a separate clone. The reviewer independently passed focused race tests (7.436s), build, and all 16 local PTY/coordinator/CLI checks; restoring the original flag registration made the regression fail at the intended assertion. Required CI remains a merge gate. Local review substitutes for CodeRabbit under the session authorization.

Remove the --yes bypass from both purchase coordinators while preserving
unattended dry runs. Cover flag rejection, nonterminal refusal and dry-run
reports, and update the purchase-safety reference.

Closes #1943
@cristim cristim added triaged Item has been triaged priority/p1 Next up; this sprint severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/few Limited audience effort/s Hours type/security Security finding labels Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 10 billable files and costs up to $2.50.

  • 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 17 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 68 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: a288282d-1004-4325-96a4-62ee2c2bc697

📥 Commits

Reviewing files that changed from the base of the PR and between 76d1d4e and 2c6f21a.

📒 Files selected for processing (10)
  • README.md
  • cmd/effective_dry_run_test.go
  • cmd/helpers.go
  • cmd/helpers_test.go
  • cmd/main.go
  • cmd/multi_service.go
  • cmd/multi_service_test.go
  • cmd/purchase_confirmation_test.go
  • docs/cli/README.md
  • docs/cli/purchase-safety.md

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

@cristim
cristim merged commit 911dc5d into main Sep 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/few Limited audience priority/p1 Next up; this sprint severity/medium Moderate harm triaged Item has been triaged type/security Security finding urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sec(cli): the --yes flag skips the purchase confirmation on irreversible RI buys

1 participant