Repository navigation
fix(tier3): end feedback chat URL spans where a path after them can start - #389
Merged
Merged
Conversation
…tart The feedback chat leaves a URL other than a file: URL unchanged while it masks local paths (#364). Its URL pattern ran to the next whitespace, so in minified JSON such as {"doc":"https://host/e","log":"/home/alice/skill/evals/results/<id>/a.log"} everything after the URL, including the run's, the skill's and the home directory's local paths, reached the provider unmasked. 0.8.0 replaced the run's path there with the run ID. A URL now ends: - at whitespace, at a character a URL never holds unencoded (" < > ` ^ { | }), and at a single quote; - at a \n \r or \t escape (JSON or repr text), so the next line of an escaped env dump or stderr (HOME=..., ERROR:..., --log=..., file://...) is masked; - before an absolute-path root or another scheme that follows a , or ; (a list), a , or ; with an option or variable name and = (DOC=https://h/e;LOG=/x, ,--find-links=file:///x), or a Markdown ](, so a file: URL listed after one is masked. Commas, semicolons, parentheses, = and other backslashes inside a URL still belong to it, so a Windows path in a URL is kept, and a local path in its query or fragment stays unchanged, as #364 intended. A backslash, n, r or t is an escape even when its backslash is doubled, as in JSON inside JSON. It is a Windows folder instead when a name and as many backslashes follow: C:\Users\bob\t\runs\<id> has a folder t, and so does its JSON spelling with doubled backslashes. So a copied Windows or UNC run path with such a folder is masked whole, as in 0.8.0, and a URL holding one is kept. A scheme starts after an escape, not inside it, so \nfile:///x is a file: URL and is masked, not an nfile: URL that is kept. A +file: scheme such as git+file: names a local path, so it is masked like file: instead of being kept as a remote URL; 0.8.0 masked the run path there. A skill or home path right after a \n, \r or \t escape counts as a whole path and is masked. A copied run's path after one, or after a path-list separator and one, keeps the escape and the earlier list item. The scheme is now at most 64 characters. Unbounded, it was rescanned from every word boundary, so 300,000 characters of a.a.a took minutes; it now takes well under a second. The CLI reference now says what a URL keeps and where it ends, and the Unreleased #364 entry describes the fixed behavior. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
requested review from
chrisknvidia,
mosheabr and
rmalani-nv
as code owners
November 7, 2026 06:48
rng1995
commented
Nov 8, 2026
rng1995
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewed at a33c416 across privacy, correctness, tests and docs, with each finding reproduced against main and v0.8.0.
1 P2 and 8 P3 inline comments. The P2 is over-masking: a relative path after a URL's \n escape is read as absolute. Of the P3s, two are narrow leaks: a \n escape followed by an ANSI color code, and \nfile://localhost/. The rest are test-coverage gaps and wording.
One note on the description: it says the 14 new cases that pass on main "are the keep-the-URL cases". Only 10 of them keep a URL. The other 4 are the copied Windows/UNC paths with an n/r/t folder (test lines 511–517), which main already masks whole. The totals (47 new, 33 failing on main) are correct.
- The backslash of a \n, \r or \t escape or of an escaped ANSI code is never an absolute-path root, and only the first backslash of a run can be one, so a relative path after an escape stays relative (also in JSON, evals\\results) and long runs are scanned once. - A root right after an ANSI code (any CSI sequence: colors, erase line, cursor moves; up to 64 parameter characters) starts a path. ANSI codes after a line escape or separator, escaped at the same level, split paths, so /opt/a.py\r\x1b[K/srv/<id> keeps the earlier path; a path colored in parts is masked whole; a drive letter after a code is a drive. - An even run of backslashes, a name, half as many backslashes and a share name is a UNC server (\\nas01\share, \\tsclient\C), not a doubled escape, unless the server is named only n, r or t and an escaped character follows (\\n\u201c from JSON around repr text). - Folders named only n, r or t in a row (\r\n), and folders named like escapes after one (\t\x64\x86, \n\x64@2), are read together, up to eight steps; any \uXXXX or \xNN after such a folder is an escape unless it is a folder itself. In JSON a folder may start with an escaped letter (\\t\\\u00e9cole). The URL pattern mirrors the folder check. - A URL ends at an ANSI escape; the URL's escape checks are case-sensitive and linear on long backslash runs. - file://localhost may start right after an escape. - Docs and the Unreleased CHANGELOG entry describe the rules. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
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.
Summary
#364 leaves a URL unchanged while
tier3 feedbackmasks local paths, but its URL pattern ran to the next whitespace. In minified JSON, an escaped env dump or stderr, or a,/;list, everything after a URL was kept, including the run's, the skill's and the home directory's local paths. 0.8.0 masked the run's path there. This PR ends a URL where a path after it can start, so those paths are masked again. The URL itself, including any path in its query or fragment, stays unchanged, as #364 intended.main(#364){"doc":"https://h/e","log":"<run>/a.log"}"log":"<id>/a.log""https://h/e\nHOME=/home/alice\nLOG=<run>/a.log"HOME=~,LOG=<id>/a.loghttps://h/e,--find-links=file://<run>/wfile:<id>/whttps://h/a;/home/alice/x,[https://h/e](/home/alice/x)~/x"https://h/e\nfile:///home/alice/x"file://~/x"https://h/e\n\u001b[2m<copied run>/a.log"\u001b[2m<id>/a.logpip install git+file:///home/alice/xgit+file://~/xa.a.aWhere a URL now ends
"'<>a backtick^{|}, or an ANSI escape (raw,\u001bor\x1b);\n\r\tescape. The backslash may be doubled, as in JSON inside JSON. A Windows folder name made of letters, digits,_.~$%-and followed by as many backslashes (C:\Users\t\runs,C:\\Users\\t\\runs) is a folder, not an escape, unless an escaped character such as\u001bor\xa0comes next and is not a folder name itself (\t\x64\runsstays a folder);,or;, also with aNAME=or--opt=in between, or after a Markdown](.,;()=and other backslashes inside a URL still belong to it. Sohttps://h/a;jsessionid=x?v=1,2andvscode://file/C:\Users\bob\t\runs\<id>are kept whole.Where a copied run's path starts
,;:=([{or a\n\r\tescape, as before. The escape or separator may now be followed by ANSI codes, so/opt/a.py\r\x1b[K/srv/ci/<id>keeps/opt/a.py;ERROR\u001b[0m/srv/ci/<id>or\x1b[1;38;2;255;255;255m, or another one such as erase line in\r\x1b[K\\nas01\share\<id>, also before a drive letter (\x1b[KC:\ci\<id>). A path colored in parts (\u001b[34m/srv/ci\u001b[0m/runs/<id>) is masked whole;\nevals/results/<id>, JSON\nevals\\results\\<id>) is kept, and so is an escape or ANSI code before a masked path;\\nas01\share,\\tsclient\C, JSON\\\\nas01\\share. A server named onlyn,rortbefore an escaped character is not one:\\n\u201c(JSON around repr text) is a doubled escape before a single one;n,rortin a row are read together, so\r\n\u001b[2mis three escapes. Folders named like escapes in a row are read together too, and may hold other characters:C:\Users\bob\t\x64\x86\<id>,\n\x64@2\;n,rortis masked whole, as in 0.8.0, also when the next folder looks like an escape (C:\Users\bob\t\u1234\runs\<id>,\t\x64\) or starts with an escaped letter in JSON (\\t\\\u00e9cole).The CLI reference and the Unreleased #364 CHANGELOG entry describe the fixed behavior. The 0.8.0 section is unchanged.
Testing
tests/evaluation/test_tier3_feedback_chat.py: 144 new cases, 94 of which fail onmain. The 50 that pass pin whatmainalready gets right: 18 inputs that must stay unchanged (URLs, and a relative path after one), 23 Windows or UNC paths with a folder, server or share name that starts withn,rortor looks like an escape, which must be masked whole, and 9 copied paths in JSON or repr encoder chains, which must be masked.compact_run_contextwith minified JSON;NAME=+scheme, Windows and UNCn/r/tnames, ANSI codes, URLs that must be kept), and tests for JSON and repr encoder chains;\t/\nchains.mainon this machine: 13 intests/tier3/test_judge_failure_artifacts.py, whose generated scripts run under the host's Python 3.9python3, and the 2 host-onlytest_sidecar_retains_*tests.mainand this branch, under POSIX, Windows and UNC-share scrubbers. Wherever this branch keeps more path text than 0.8.0, it is inside a URL (fix(tier3): mask skill and home paths and keep more text in feedback chat evidence #364's design), a relative path (a root glued to a name, also right after an escape or ANSI code), an earlier list item kept by the documented separator rule, as inPATH=/usr/bin:/home/ci/results/<id>, or one of the gaps below.n/r/tfolder chains, CRLF chains, long and repeated ANSI codes) take at most about 1.2 s under POSIX and Windows scrubbers on a loaded machine; realistic shapes take well under 0.5 s. The time doubles when the input doubles.Known gaps (left as is)
&,[,!,@,*,+, a\f/\b/\u002fescape,\\and a root, a glued short option,-I/x,,mailto:x@y/path, or an uppercase\X1B/\U001B, which is not an escape.\u001b[0mhttps://...) is not recognized, so a path in its query is masked.\x1b8or\x1b(B, reads as glued to its last character and is kept.n,rortafter a backslash inside a URL loses that backslash. This is cosmetic, and Tier 3 run IDs start with a digit (YYYYMMDD_HHMMSS).{…}before the run ID in the same URL loses the text between them, because{ends a URL. This is cosmetic.n/r/t, or after a folder named like an escape that follows one (D:\cache\n/srv/<id>,C:\b\t\x64/<id>), keep that prefix. So do more than eight such folders in a row.\/slash spelling.🤖 Generated with Claude Code