Skip to content

Conversation

@galligan
Copy link
Contributor

@galligan galligan commented Jan 23, 2026

Summary

  • Implement confirmDestructive prompt handling in CLI input.
  • Extend input tests for destructive confirmations.
  • Update CLI package dependencies.

Changes

  • packages/cli/src/input.ts
  • packages/cli/src/tests/input.test.ts
  • packages/cli/package.json
  • bun.lock

Testing

  • Not run (not requested).

Copy link
Contributor Author

galligan commented Jan 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@galligan galligan added the bug Something isn't working label Jan 23, 2026
@galligan galligan marked this pull request as ready for review January 23, 2026 20:25
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@greptile-apps
Copy link

greptile-apps bot commented Jan 23, 2026

Greptile Summary

  • Implements confirmDestructive interactive prompt functionality in CLI input module using @clack/prompts for destructive operations
  • Adds comprehensive test coverage transitioning from RED to GREEN phase of TDD with proper mocking for prompt interactions
  • Updates package dependencies to include @clack/prompts which aligns with project's blessed dependencies

Important Files Changed

Filename Overview
packages/cli/src/input.ts Replaces placeholder implementation with functional destructive confirmation prompts using Result pattern
packages/cli/src/tests/input.test.ts Adds comprehensive test suite for confirmation prompts with mock infrastructure and multiple scenarios

Confidence score: 4/5

  • This PR is safe to merge with only minor concerns about test complexity
  • Score reflects solid implementation following TDD principles but complexity in mock infrastructure could lead to maintenance challenges
  • Pay close attention to packages/cli/src/__tests__/input.test.ts for mock queue management and test isolation

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI
    participant prompts as "@clack/prompts"
    participant process as "Process/TTY"

    User->>CLI: "Invoke destructive command"
    CLI->>CLI: "Check bypassFlag"
    alt bypassFlag is true
        CLI->>User: "Return Ok(true)"
    else bypassFlag is false
        CLI->>process: "Check TTY and TERM"
        alt non-TTY or TERM=dumb
            CLI->>User: "Return Err(CancelledError)"
        else interactive mode
            CLI->>prompts: "confirm({ message })"
            prompts->>User: "Show confirmation prompt"
            User->>prompts: "User response (true/false/cancel)"
            prompts->>CLI: "Return response"
            alt response is true
                CLI->>User: "Return Ok(true)"
            else response is false or cancel
                CLI->>User: "Return Err(CancelledError)"
            end
        end
    end
Loading

@galligan galligan changed the base branch from fix/cli-core to graphite-base/104 January 23, 2026 23:12
@galligan galligan changed the base branch from graphite-base/104 to fix/cli-core January 23, 2026 23:14
@galligan
Copy link
Contributor Author

Restacked and resubmitted. No additional changes in this PR.

This was referenced Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants