Conversation
Code ReviewOverall this is a well-structured follow-up PR that addresses real issues from #180. The changes are focused and mostly improvements. One behavior change in the redaction logic deserves discussion.
|
| Change | Verdict |
|---|---|
| IAM dead code removal | ✅ Merge |
S3 IsFailure() refactor |
✅ Merge |
sessionPath() extraction |
✅ Merge |
hasProfileRegionToken() extraction |
✅ Merge |
redactSensitiveRaw fast path |
✅ Merge |
| Acronym segment splitting | ✅ Merge |
Remove environment/variables from sensitive sets |
✅ Merge |
redacted["[REDACTED]"] = "[REDACTED]" key hiding |
The key-name redaction is the only change I'd push back on. Everything else is clean, well-tested, and clearly motivated.
|
Addressed the latest Claude review note in
Validation run locally:
|
Follow-up ReviewThe previous concern (map key collision from
|
| Key | Segments | Sensitive? |
|---|---|---|
DBPassword |
["db", "password"] |
✓ |
DBMasterPassword |
["db", "master", "password"] |
✓ |
APIToken |
["api", "token"] |
✓ |
environment |
["environment"] |
✗ (correct) |
ALLCAPS |
["allcaps"] |
✗ (correct) |
The index+1 >= len(runes) guard prevents a panic on the last character. The algorithm correctly uses lookahead for UPPER→UPPER→lower boundaries without being fooled by all-caps sequences.
Removing "environment" / "variables" from sensitive sets
The fix is targeted. EnvironmentVariables still matches via the exact set ("environmentvariables"), and DB_PASSWORD/DBPassword now correctly match through the improved segmenter.
session_test.go — TOKEN removal ✅
Removing TOKEN from the "should not contain" assertion is correct given the design decision to preserve key names (redact values only). The key name TOKEN legitimately appears in the persisted file for AI schema context. The test still asserts [REDACTED] is present and the secret values (persist-me-not, persist-output-secret, DB_PASSWORD) are absent.
Test Coverage ✅
TestIsSensitiveRawKeyAvoidsSubstringFalsePositivesnow coversenvironmentandvariables(now-safe) alongsideDBPassword,DBMasterPassword,MasterUserPassword(now-sensitive).TestFormatResourceDetailKeepsNonSensitiveEnvironmentFieldsis a well-targeted regression test for the false-positive fix.TestFormatResourceDetailPreservesMultipleSensitiveKeyNamesdirectly addresses the previous review concern — multiple distinct sensitive keys remain distinct.
Summary
| Change | Verdict |
|---|---|
| IAM dead code removal | ✅ |
S3 IsFailure() abstraction |
✅ |
sessionPath() extraction |
✅ |
hasProfileRegionToken() extraction |
✅ |
redactSensitiveRaw fast path |
✅ |
[]map[string]any recursive case |
✅ |
| Acronym segment splitting | ✅ |
Remove environment/variables from sensitive sets |
✅ |
| Key name preservation (previous concern resolved) | ✅ |
No remaining issues. Ready to merge.
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [github:clawscli/claws](https://github.com/clawscli/claws) | patch | `0.15.3` → `0.15.4` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>clawscli/claws (github:clawscli/claws)</summary> ### [`v0.15.4`](https://github.com/clawscli/claws/releases/tag/v0.15.4) [Compare Source](clawscli/claws@v0.15.3...v0.15.4) #### Changelog - [`1ad7a57`](clawscli/claws@1ad7a57) Add gopls to dev shell - [`ea05c51`](clawscli/claws@ea05c51) Address review feedback - [`45b0ce4`](clawscli/claws@45b0ce4) Bound tag search fetch concurrency - [`dcdf036`](clawscli/claws@dcdf036) Clarify pagination token filtering - [`87d4e15`](clawscli/claws@87d4e15) Correct AI chat session docs path - [`54e37d2`](clawscli/claws@54e37d2) Fix stuck AWS initializing status during profile change - [`adfd5ba`](clawscli/claws@adfd5ba) Guard SageMaker training S3 URI rendering - [`c69e666`](clawscli/claws@c69e666) Harden AWS docs search privacy - [`6aa41e7`](clawscli/claws@6aa41e7) Harden exec actions and pagination - [`379e4db`](clawscli/claws@379e4db) Harden safety-sensitive AWS operations - [`c7628dc`](clawscli/claws@c7628dc) Limit pagination to token-bearing pairs - [`bb97771`](clawscli/claws@bb97771) Merge branch 'main' into dependabot/go\_modules/gopkg.in/ini.v1-1.67.2 - [`a8285ce`](clawscli/claws@a8285ce) Merge pull request [#​180](clawscli/claws#180) from clawscli/develop - [`f772864`](clawscli/claws@f772864) Merge pull request [#​181](clawscli/claws#181) from clawscli/develop - [`493b81c`](clawscli/claws@493b81c) Merge pull request [#​182](clawscli/claws#182) from clawscli/dependabot/go\_modules/aws-sdk-98bf9e9202 - [`97f5f31`](clawscli/claws@97f5f31) Merge pull request [#​183](clawscli/claws#183) from clawscli/dependabot/go\_modules/gopkg.in/ini.v1-1.67.2 - [`40ee108`](clawscli/claws@40ee108) Merge pull request [#​184](clawscli/claws#184) from clawscli/develop - [`48fc777`](clawscli/claws@48fc777) Normalize VHS shell prompts - [`8df4fa6`](clawscli/claws@8df4fa6) Normalize genimports path tests - [`9adfd42`](clawscli/claws@9adfd42) Preserve sensitive raw data key names - [`7a5a6d8`](clawscli/claws@7a5a6d8) Redact sensitive AI raw resource data - [`b0fa729`](clawscli/claws@b0fa729) Refine AI raw data redaction - [`3898f5e`](clawscli/claws@3898f5e) Remove Claude code review workflows - [`8eaad51`](clawscli/claws@8eaad51) Run VHS demos with host binary - [`ddd062f`](clawscli/claws@ddd062f) Simplify enrichment status rendering - [`0c83fd1`](clawscli/claws@0c83fd1) Track IAM policy enrichment failures - [`55d033d`](clawscli/claws@55d033d) Track IAM role enrichment failures - [`118836a`](clawscli/claws@118836a) Track IAM user enrichment failures - [`dca965a`](clawscli/claws@dca965a) Track S3 enrichment failures - [`f6b1043`](clawscli/claws@f6b1043) Update Go dependencies - [`dd3ae9c`](clawscli/claws@dd3ae9c) Use bus-qualified EventBridge rule IDs - [`f2854d5`](clawscli/claws@f2854d5) deps: bump gopkg.in/ini.v1 from 1.67.1 to 1.67.2 - [`5775c5c`](clawscli/claws@5775c5c) deps: bump the aws-sdk group with 5 updates </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
Summary
environment/variablesfalse positives while still redacting sensitive key names and values.DBPasswordandDBMasterPassword.Validation
go test ./internal/ai ./internal/view ./custom/s3/buckets ./custom/iam/policiesgo test ./...go vet ./...go build ./cmd/clawsgolangci-lint run --config .golangci.yml ./...gofmt -l cmd internal custom scriptsgit diff --checkContext
Follow-up for the post-merge Claude review on #180.