fix: harden shell-history privacy and enhance CLI type safety - #23
Open
mertcano wants to merge 1 commit into
Open
fix: harden shell-history privacy and enhance CLI type safety#23mertcano wants to merge 1 commit into
mertcano wants to merge 1 commit into
Conversation
### Description This PR addresses data privacy and code cleanliness findings within the `uwu` CLI repository. It implements defense-in-depth credential redaction for the opt-in shell history feature and replaces unsafe type suppressions with strict type boundaries. ### Key Changes * **Shell History Privacy (`context.ts`, `README.md`):** - The opt-in shell history feature now strictly bounds the requested command history to a maximum of 50 lines to prevent excessive prompt contributions[cite: 40, 41]. - Implemented proactive redaction that scrubs common secrets, including assignments, secret flags, bearer tokens, recognized provider token formats, and complete PEM private-key blocks, replacing them with redaction markers before transmitting data to the model provider[cite: 40, 41]. * **Documentation & Trust Limits (`README.md`):** - Updated the documentation to explicitly clarify that history redaction is a defense-in-depth measure, not an absolute guarantee against application-specific secret leakage[cite: 40, 41]. - Emphasized that users must review the generated commands before they are executed via `eval`[cite: 40, 41]. * **Type Safety & Error Handling (`index.ts`):** - Replaced the unsafe `@ts-ignore` directive in the Anthropic response path by explicitly narrowing the content block discriminant (`type === "text"`)[cite: 40]. - Removed `any` types from the clipboard and top-level error handlers, replacing them with safe `unknown` parsing and explicit formatting helpers[cite: 40]. ### Validation & Testing * **Focused Regression (`context.test.ts`):** Verified 5 focused cases covering count normalization, secret flags, and multi-line PEM blocks, which all passed successfully[cite: 40]. * **Reviewer Action Required:** The full CLI module build (`bun build`) and end-to-end type check are currently blocked by local dependency (`https-proxy-agent / debug`) resolution issues[cite: 40]. A maintainer must install dependencies in an authorized environment and run a strict TypeScript check before merging[cite: 40].
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses data privacy and code cleanliness findings within the
uwuCLI repository. It implements defense-in-depth credential redaction for the opt-in shell history feature and replaces unsafe type suppressions with strict type boundaries.Key Changes
context.ts,README.md):README.md):eval[cite: 40, 41].index.ts):@ts-ignoredirective in the Anthropic response path by explicitly narrowing the content block discriminant (type === "text")[cite: 40].anytypes from the clipboard and top-level error handlers, replacing them with safeunknownparsing and explicit formatting helpers[cite: 40].Validation & Testing
context.test.ts): Verified 5 focused cases covering count normalization, secret flags, and multi-line PEM blocks, which all passed successfully[cite: 40].bun build) and end-to-end type check are currently blocked by local dependency (https-proxy-agent / debug) resolution issues[cite: 40]. A maintainer must install dependencies in an authorized environment and run a strict TypeScript check before merging[cite: 40].