Repository navigation
Keep the text after a bare Windows home path in a Bot's bug report - #1948
Conversation
Stop unquoted bare-home redaction at common clause boundaries while retaining full redaction for quoted names and paths with a directory separator.
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Treat an opening quote or bracket as a path boundary even when punctuation ends the match before the closing delimiter.
There was a problem hiding this comment.
Devin Review found 1 finding. Devin automatically fixed it.
Fixed by Devin (1)
- Quoted Windows profile names leak — An opening quote, parenthesis or bracket before the path now always redacts the whole name; regression test added.
Fei2411
left a comment
There was a problem hiding this comment.
Code Reaper review: fail (head 62609420, comments only)
Fixing the over-redaction was the right call, and the quote/bracket guard works: "C:\Users\Jane Doe and more" → "~" and (C:\Users\Jane Doe and more) → (~). CI shows 7 passed. Locally, view-reply, connectors and privacy tests pass 52/52, build-client --check passes, and lint shows no errors.
Blocking: when two bare Windows home paths are in one sentence, the second username is published. The bare-name branch of WINDOWS_HOME can match the drive letter of the next path, because : is in the closing lookahead, so the regex never sees the second C:\Users\…:
| input | dev (from #1942) |
this head |
|---|---|---|
C:\Users\Jane Doe then C:\Users\Bob Ray or so |
~:\Users\Bob Ray or so |
~ then C:\Users\Bob Ray or so |
C:\Users\Jane Doe and C:\Users\Bob Ray |
~:\Users\Bob Ray |
~ and C:\Users\Bob Ray |
(C:\Users\Jane Doe then C:\Users\Bob Ray) |
(~:\Users\Bob Ray) |
(~:\Users\Bob Ray) |
This bug predates this PR, but this PR is the redaction follow-up, it keeps the bug, and the leaked name goes into a public issue. The fix is to stop the bare name from crossing into another drive path:
// in WINDOWS_HOME, bare-name alternative
(?:(?![A-Z]:[\\/])[^\\/:*?<>|\s'"\x60.,;)\]-]|-(?!>)|\.(?!$|[\s.,;:)\]'"\x60])| )+With that lookahead, the three rows become ~ ~ or so, ~ ~ and (~ ~). C:\Users\Jane Doe and more text → ~ and more text, C:\Users\Jane Doe. → ~. and C:\Users\John Smith\AppData → ~/AppData still pass. Please add a two-path regression test.
Non-blocking:
- As the PR body says, a profile name that contains one of the listed words is split at that word:
C:\Users\Rock and Roll then failed→~ and Roll then failed. That's acceptable, since the user sees the card before approving. <C:\Users\Jane Doe and x>→<~ x>drops the word "and". This hides too much rather than too little.
Overlaps: none. This PR only touches issue-report.js and view-reply.test.js, and #1942 is already in dev.
Stop a bare home match before the next drive prefix so preserved prose cannot prevent redaction of another profile.
Fei2411
left a comment
There was a problem hiding this comment.
Code Reaper re-review — Verdict: pass (head 17bf0d3c, comments only)
The two-path leak is fixed: the bare-name branch now stops at (?![A-Z]:[\\/]), so each Windows home is redacted on its own. The new test covers the three inputs from my last review plus the three cases that must keep working.
Extra probes:
C:\Users\Jane Doe D:\Users\Bob Ray→~ ~C:\Users\Jane Doe then D:/Users/Bob Ray/x→~ ~/xC:\Users\A, C:\Users\B and C:\Users\C D→~, ~ ~"C:\Users\Jane Doe then C:\Users\Bob Ray"→"~ ~"- A 60k-character adversarial input runs in under 1 ms.
Checks: CI 7 passed. Locally, view-reply, connectors and privacy tests pass 53/53, build-client --check passes, and lint has no errors.
Non-blocking, edge cases only:
- When two paths run together with no space between them, the name is only partly hidden:
C:\Users\Jane DoeC:\Users\Bob→~ DoeC:\Users\Bob. The old code also leaked here, and real text rarely looks like this. C:\Users\Jane Doe then C:\tmp\x→~ C:\tmp\xdrops "then". That only over-redacts.
Overlaps: none. The PR touches only issue-report.js and view-reply.test.js.
Issue
Follow-up to #1942 (a non-blocking note in its Code Reaper review). In a Bot's bug report draft, a Windows home path with no trailing separator also hid the rest of the sentence:
C:\Users\Jane Doe and more textbecame~.What changed / 改了什么
issue-report.js: when an unquoted bare Windows home path is followed by a common conjunction (and,or,but,then,because,while,when), the redaction now keeps the text from that word on.C:\Users\Jane Doe and more textbecomes~ and more text.view-reply.test.js: regression tests check both the approval preview and the fallback URL.Changelog
A Bot's bug report no longer drops the text that follows a Windows home path.
How I checked it / 怎么验证的
npm test(inds-bot/): 3590 passed, 0 failed, 4 skippednode scripts/build-client.mjs --checknpm run lintindex.jsorsrc/host/: all 56 steps passedChecklist / 检查
src/client/changed →npm run buildran andclient.jsis committed. / 改了src/client/就已重新 build 并提交client.js。 (not applicable:src/client/is unchanged)Co-authored-by. / 没有把 AI 工具写成作者或Co-authored-by。Agent: Devin (Cognition)
Implemented in session Add self-reporting issue skill to DS-Bot
Review with Devin · Open in Devin Desktop