Repository navigation
TypeScript project filter reads window paths that are not UTF-8 - #1963
Merged
Merged
Conversation
git_paths prints a name as the tree stores it, and scip_ts_projects.py read the window lists as strict UTF-8. One file name with a Latin-1 byte anywhere in the window, a Markdown file included, raised UnicodeDecodeError, so the TypeScript pass exited 1 and the watermark stayed where it was on every pass. The lists are decoded with os.fsdecode, as Python decodes argv, so a path compares equal to a member path given on the command line; the selected members are written back with os.fsencode, byte for byte. The harness test commits a TypeScript edit beside caf\xe9.md and expects only the edited member to be indexed; the helper test reads and prints a member whose name is not UTF-8 with a strict stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9 of 10 tasks
zlareb1
requested changes
Dec 1, 2026
zlareb1
left a comment
Member
There was a problem hiding this comment.
The byte round-trip and project-filter checks pass. The new harness test fails before running the filter on macOS.
The test wrote caf\xe9.md into the working tree, which macOS rejects with Errno 92 before the filter runs. It now stores the name in a commit built with hash-object, update-index --cacheinfo, write-tree and commit-tree, so no file with that name is created and git_paths prints it from the tree as in production. It still fails on main (UnicodeDecodeError in the filter) and passes with the fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Contributor
Author
|
Main ( |
zlareb1
approved these changes
Dec 2, 2026
zlareb1
left a comment
Member
There was a problem hiding this comment.
The harness regression stores the non-UTF-8 path in Git and tests project selection through the normal window. All 35 focused tests passed on macOS.
9 tasks done
KaloyanNaumov
added a commit
to KaloyanNaumov/loom
that referenced
this pull request
Dec 2, 2026
With ClickHouse#1963 merged in, scip_ts_projects.py reads the changed-file list as git writes it, so the incremental harness test no longer needs to stub `filter` and `has-config`. The non-UTF-8 member name now passes through both the real filter and the real converter. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
1 task done
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.
Closes: #1959
Related: #1782
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A TypeScript pass over an umbrella or a
scip_ts_projectslist no longer fails when the commit window holds a file name that is not valid UTF-8 outside the TypeScript and JavaScript files; before, the pass exited 1 and the TypeScript watermark did not advance. A TypeScript or JavaScript file whose own name is not UTF-8 still fails in the converter, as before #1782.Why
The project filter came with #1782. The harness writes the window's paths with
git_paths, which prints a name as the tree stores it (core.quotePath=false), andscip_ts_projects.pyread those lists withread_text(encoding="utf-8"). One name with a Latin-1 byte anywhere in the window, of any file type, raisedUnicodeDecodeErrorinfilter;filtered=$(…)underset -eexited 1, the worker recorded a harness failure and the watermark stayed, so every later pass failed the same way. Before #1782 the same window passed, because only the TypeScript-glob list was read._read_linesnow decodes withos.fsdecode, the way Python decodes argv, so a window path compares equal to a member path given on the command line.mainwrites the selected members withos.fsencodetosys.stdout.buffer, so the filter prints a member whose name is not UTF-8 back byte for byte (scip-typescript decodes its argv lossily, so such a member is still not indexed); under a UTF-8 locale other than C, stdout's strict error handler raisedUnicodeEncodeErrorthere.Scope and risk
scripts/scip_harness/scip_ts_projects.py(_read_linesand the output loop ofmain) and two tests. For UTF-8 names nothing changes:os.fsdecodegives the same string andos.fsencodethe same bytes. The converter's own window list and the merge are not touched; the converter reads only the TypeScript-glob list, as before #1782.Compatibility, rollout and rollback
Tests
tests/unit/test_run_typescript_delta_umbrella.py::test_delta_with_a_non_utf8_file_name_in_the_window: a TypeScript edit inpackages/appbeside a newpackages/lib/caf\xe9.md; onlypackages/appis indexed. Onmainthe harness exits 1 withUnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9.tests/unit/test_scip_ts_projects.py::test_filter_reads_and_prints_names_that_are_not_utf8:filterreads a list holdingpackages/caf\xe9/src/a.tsand prints the memberpackages/caf\xe9as the same bytes, withPYTHONIOENCODING=utf-8:strict;has-configandhas-sharedread a list with a non-UTF-8 name. It fails onmainin the read and, with only the read fixed, in the write.mainat3058a5816:test_scip_ts_projects.py,test_run_typescript_delta_umbrella.py,test_run_typescript_delta_projects.py,test_scip_merge_indexes.py,test_code_compiler_tier_runner.py,test_code_scip_extra_producers.py,test_tunable_constants.pyandtest_public_copy.py, 126 passed.ruff check,ruff format --check, the function-length gate (52, baseline 52) andscripts/gates/mypy_gate.py(0 errors) pass.mypyonscip_ts_projects.pyalone reports the same five errors as onmain, none on the changed lines. The full unit suite was not run here; CI runs it.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and the tests. Checked: I reviewed the whole diff and its tests; the runs listed under Tests are the agent's.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.main; no merged migration is edited: no migration.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version: no plugin file changed.npm --prefix frontend run build) and its tests pass, iffrontend/changed: it did not.docs/describe the system as it now is, and this description names any operator steps and wire changes: no page describes how the filter reads its lists.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
Low Risk
Narrow change to path list I/O in the TypeScript harness helper; UTF-8 paths are unchanged and no auth or persistence logic is touched.
Overview
Fixes TypeScript umbrella/delta passes that exit 1 when the commit window includes any path whose Git tree name is not valid UTF-8 (e.g. a Latin-1
café.md), which previously raisedUnicodeDecodeErrorin the project filter and blocked the watermark.scip_ts_projects.pynow reads changed-path lists withos.fsdecodeon raw bytes (matching how argv paths are decoded) instead of UTF-8read_text, and writes selected members tosys.stdout.bufferviaos.fsencodeso non-UTF-8 member names round-trip withoutUnicodeEncodeErrorunder a strict UTF-8 locale. UTF-8-only repos behave the same.Tests add plumbing to commit non-UTF-8 tree names and assert a delta beside an unrelated non-TS name still indexes only the touched package, plus direct coverage of
filter,has-config, andhas-sharedon lists with Latin-1 bytes.Reviewed by Cursor Bugbot for commit 28684e7. Bugbot is set up for automated code reviews on this repo. Configure here.