Filter terminal-unsafe characters through one helper: list and the status printer keep bidi overrides and zero-width characters that core policy::strip_unsafe drops
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读crates/socket-patch-core/src/policy/mod.rs以及crates/socket-patch-cli/src/commands/list.rs和crates/socket-patch-cli/src/ui/status.rs中的过滤器。按描述整合过滤逻辑,然后为包含 U+202E 和 U+200B 的描述添加单元测试;当这些字符被移除且普通列表输出仍逐字节完全一致时,即完成。
由索引模型根据 Issue 内容生成。
描述
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T23.
Problem
Three functions filter characters before they reach the terminal:
list.rssanitize, L230-L238:.filter(|&c| c == '\n' || c == '\t' || !c.is_control()).ui/status.rsprintln, L96-L104: the same filter.- core
policy/mod.rsunsafe_for_output/strip_unsafe, L50-L60: drops controls and bidi overrides and isolates (U+202A–202E,U+2060–2069), zero-width characters (U+200B–200F) and the BOM.
So core already decided that bidi and zero-width characters are unsafe in output. list, however, prints API-sourced patch descriptions and vulnerability summaries through the weaker filter, so a description carrying U+202E can still reorder what the user sees. I found this by reading the code; I did not run it.
Proposed change
- Make core
policy::strip_unsafe(or a renamedprintable) keep\nand\t, and normalize\r\n, aslist::sanitizedoes. Move it to a neutral home, such asutils::textor the CLIuilayer if core does not need it. - Call it from
list::sanitize's callers and fromStatusPrinter::println, and delete the two copies.
Size
3 files, about −15 lines plus one test.
Acceptance criteria
listoutput for ordinary text is byte-identical.- A new unit test shows that a description containing
\u{202E}and\u{200B}is printed without them. policytests are unchanged.
- 主要语言
- Rust
- 星标
- 8
- 派生
- 2
- 平均合并
- 19 小时 12 分钟
- 30 天内合并 PR
- 709
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SocketDev/socket-patch 的其他 Issue
-
agent:triaged arch-audit priority:p3 refactor
难度 2/5 1-3 小时 新手友好度 78/100
SocketDev/socket-patch#1838 ·
维护者通常 1 天内回复
-
Share one scoped env-var test guard: EnvGuard is copy-pasted 11 times across core unit and integration tests可能已有人在做 @mikolalysenko 于 1 天前认领。 未关闭agent:claimed agent:triaged arch-audit priority:p3 refactor
难度 4/5 3-5 天 新手友好度 55/100
SocketDev/socket-patch#1889 · 2 条评论 ·
维护者通常 1 天内回复
-
Memoize env-keyed subprocess probes through one helper: composer, python and ruby each define the same env key and drifted on when an answer is kept可能已有人在做 @mikolalysenko 于 1 天前认领。 未关闭agent:claimed agent:triaged arch-audit priority:p1 refactor
难度 4/5 1-2 天 新手友好度 25/100
SocketDev/socket-patch#1888 · 3 条评论 ·
维护者通常 1 天内回复
-
agent:triaged arch-audit priority:p3 refactor
难度 4/5 1-2 天 新手友好度 55/100
SocketDev/socket-patch#1887 · 1 条评论 ·
维护者通常 1 天内回复
-
agent:needs-human agent:triaged arch-audit priority:p3 refactor
难度 4/5 3-5 天 新手友好度 38/100
SocketDev/socket-patch#1881 ·
维护者通常 1 天内回复
查看 SocketDev/socket-patch 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
calcit-lang/caps#16 ·
-
难度 2/5 1-3 小时 新手友好度 85/100
penso/herdr-gpui#934 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
Y-ASLant/ElegantClipboard#178 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
linxiv-dev/linXiv#384 · 1 条评论 ·
维护者通常 1 天内回复
-
priority middle
难度 2/5 1-3 小时 新手友好度 70/100
KATO-Hiro/AtCoderClans#12945 ·
维护者通常 1 天内回复