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
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
Research direction
Read crates/socket-patch-core/src/policy/mod.rs and the filters in crates/socket-patch-cli/src/commands/list.rs and crates/socket-patch-cli/src/ui/status.rs. Consolidate the filtering as described, then add the unit test for a description containing U+202E and U+200B; done when those characters are removed and ordinary list output remains byte-identical.
Written by the indexing model from the issue text.
Description
[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.
- Dominant language
- Rust
- Stars
- 9
- Forks
- 2
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 309
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SocketDev/socket-patch
-
Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)Possibly taken @mikolalysenko claimed this today. Openagent:claimed agent:triaged ci-janitor priority:p1
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
SocketDev/socket-patch#2238 · 1 comment ·
Maintainers usually reply within 1 day
-
agent:triaged arch-audit priority:p3 refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SocketDev/socket-patch#1838 ·
Maintainers usually reply within 1 day
-
Nightly: pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed fails on Windows (pnpm records the RUNNER~1 short path as a second importer)Possibly taken A pull request linked to this issue is open or already merged. Openagent:triaged ci-janitor priority:p1
Difficulty 3/5 Half a day Newbie friendliness 42/100
SocketDev/socket-patch#2235 ·
Maintainers usually reply within 1 day
-
Agent mode reports a gem whose installed file was edited as "not installed on this host" / "not found on disk", `apply --check` says to run `apply`, and `rollback` exits 1 with "modified after patching" on every runPossibly taken @mikolalysenko claimed this today. Openagent:claimed agent:triaged bug bughunt pm:bundler priority:p1 ux
Difficulty 4/5 3-5 days Newbie friendliness 18/100
SocketDev/socket-patch#2231 · 1 comment ·
Maintainers usually reply within 1 day
-
Behind a private gem mirror a hosted gem pin cannot be undone: `rollback` and `remove` refuse on a `CHECKSUMS` lock, and without `CHECKSUMS` `rollback` leaves the patched builds installed with no warning that names themPossibly taken @mikolalysenko claimed this today. Openagent:claimed agent:triaged bug bughunt pm:bundler priority:p1
Difficulty 4/5 3-5 days Newbie friendliness 12/100
SocketDev/socket-patch#2230 · 1 comment ·
Maintainers usually reply within 1 day
All issues in SocketDev/socket-patch
Similar issues
-
[Bug] StreamLifecycleConfig clamps post-TTFT stream timeouts to remaining admission budgetPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lbjlaq/Antigravity-Manager#4063 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
farion1231/cc-switch#9981 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bot:ai-assisted component:indexer status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
midnightntwrk/midnight-indexer#1834 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day