Repository navigation
fix(recall): end a link at the first character a URL cannot hold - #110
Conversation
promptTextOf drops links from the prompt before recall. The pattern ran to the next whitespace, and Chinese is written right after a link with no space, so the rest of the sentence went with the link: "官网(https://canary.evomap.work/zh)本周上线,帮我做一条 20 秒的展示视频" was recalled as "官网( 20 秒的展示视频". A link now stops at the first character RFC 3986 does not allow in a URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 另有 3 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 6a60b8fe1249 |
|
Sentinel 保留了 3 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 6a60b8fe1249 |
… structure follows them The ASCII-only link pattern stopped at the first non-ASCII character, so an IDN host (`https://例子.测试/docs`) was not removed at all. A Unicode path (`https://example.com/患者张三/病例?access_code=ABC123`) lost only its ASCII prefix, and its segments and query went into the recall text and the Hub's task context. A non-ASCII run now stays in the link when URL structure follows it: `/`, `?`, `#`, `:`, or a dot and a letter of any script. The Chinese sentence written right after a link has none of that, so it is still kept (`…/abc123/复刻一条…`, `evomap.ai这个网站`). A non-ASCII last segment with nothing after it (`/wiki/中文`) cannot be told from that sentence, and is kept as the person's text. The two alternatives use disjoint character sets, so the pattern stays linear: 200k CJK characters after a link take a few milliseconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,并发现 2 个已核验问题。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 46eab582805d |
| const MARKUP_TAG = /<\/?[a-z][\w-]*(?:\s[^<>]*)?>/gi; | ||
| const LINK = /\b(?:https?:\/\/|www\.)\S+/gi; | ||
| const URL_ASCII_RUN = "[A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=%]+"; | ||
| const URL_NON_ASCII_SEGMENT = '[^\\x00-\\x7F\\s\\u3000-\\u303F\\uFF00-\\uFFEF]+(?=[/?#:]|\\.[\\p{L}\\p{N}])'; |
There was a problem hiding this comment.
末尾 Unicode 路径未被识别为链接内容
🟠 严重程度:中(P2)
URL_NON_ASCII_SEGMENT 仅在非 ASCII 字符后还有 /、?、#、: 或“.加字母/数字”时才将其计入 URL。因此位于 URL 末尾、空白或中文标点之前的合法 Unicode 路径段不会被删除。旧实现使用 \S+,会删除该路径;当前测试反而将残留行为固定为预期。
Finding:finding_b50d2cc1628d767fd215a088
| const MARKUP_TAG = /<\/?[a-z][\w-]*(?:\s[^<>]*)?>/gi; | ||
| const LINK = /\b(?:https?:\/\/|www\.)\S+/gi; | ||
| const URL_ASCII_RUN = "[A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=%]+"; | ||
| const URL_NON_ASCII_SEGMENT = '[^\\x00-\\x7F\\s\\u3000-\\u303F\\uFF00-\\uFFEF]+(?=[/?#:]|\\.[\\p{L}\\p{N}])'; |
There was a problem hiding this comment.
末尾国际化域名后缀残留到召回文本
🟠 严重程度:中(P2)
新正则要求每段非 ASCII 文本后必须仍有 /、?、#、:,或“. 加字母”。因此完整 IDN 域名在 Unicode 顶级域名处结束时,最后一个标签不匹配并残留在清洗结果中。
Finding:finding_cab6693f50227277bfa30d74
…D leaves nothing behind `https://例子.测试` and `https://sub.例子.测试` left their last label in the recall text: after the host there was no `/`, `?` or `.` to keep it in the link. The host is now matched on its own as dot-joined labels of any script, so an IDN host goes whole. A single label is only ASCII, so a Chinese sentence written right after an ASCII host (`https://evomap.ai这个网站`) is still kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,并发现 2 个已核验问题。 无法定位到 diff 的已核验问题Unicode URL 的末尾路径段会残留并进入召回文本🟠 严重程度:中(P2) Finding: 当前为 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 74a294c55e70 |
| const HOST_LABEL = `(?:[A-Za-z0-9-]+|${NON_ASCII_RUN})`; | ||
| const DOTTED_HOST = `${HOST_LABEL}(?:\\.${HOST_LABEL})+`; | ||
| const URL_ASCII_RUN = "[A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=%]+"; | ||
| const URL_NON_ASCII_SEGMENT = `${NON_ASCII_RUN}(?=[/?#:]|\\.[\\p{L}\\p{N}])`; |
There was a problem hiding this comment.
末尾 Unicode 查询值会残留到召回请求
🟠 严重程度:中(P2)
URL_NON_ASCII_SEGMENT 仅在非 ASCII 字符后仍有 /、?、#、: 或“.加字母/数字”时才匹配。对于 ?q=中文、#章节名称 这类结构明确且位于链接末尾的合法 IRI 内容,正则只删除到 q= 或 #,把 Unicode 值错误保留为用户提示。旧正则 \S+ 会删除完整链接,因此属于当前 PR 引入的兼容性回归。
Finding:finding_e5b87c4fbadafc2f6b90c2ec
`?q=患者张三` and `#章节名称` at the end of a link were cut after `=` or `#`, and the value went into the recall text. A non-ASCII run right after `=`, `?`, `#` or `&` is a query value or fragment and stays in the link. Text after an ASCII value (`?b=1帮我总结`) is still the person's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。 另有 1 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 a791c742998c |
|
Sentinel 保留了 1 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 a791c742998c |
Sentinel review items: resolution at a791c74The Sentinel review of head
The pattern stays linear: 200k CJK characters after a link take a few ms. Regression tests are in 🤖 Generated with Claude Code |
Summary
promptTextOfdrops links from the prompt before recall. The link pattern ran to the next whitespace, and Chinese is written right after a link with no space, so the rest of the sentence went with the link. A link now ends at the first character RFC 3986 does not allow in a URL:The recall query and the task context the Hub judges fit by both come from
promptTextOf, so both keep the text written after a link.Found in a dsh session: a Chinese video request with the site URL in parentheses was recalled as
我们新官网( 20 秒…, losing本周上线,帮我做一条.Evidence
Before (
@evomap/dsh-evolver1.0.16):我们新官网(https://canary.evomap.work/zh)本周上线,帮我做一条 20 秒的展示视频→我们新官网( 20 秒的展示视频照着这个视频https://v.douyin.com/abc123/复刻一条我们瑜伽App的版本→照着这个视频把 https://github.com/nexu-io/looper/pull/42这个PR接管到合并→把After:
我们新官网( 本周上线,帮我做一条 20 秒的展示视频照着这个视频 复刻一条我们瑜伽App的版本把 这个PR接管到合并RED: the new test
a link ends where the Chinese text written right after it beginsfailed onmain(actual我们新官网( 20 秒的展示视频), and passes with the change. The existing link test (see https://example.sentry.io/issues/?project=1→see) still passes.npm test: 1223 pass, 10 skipped, 3 fail. The 3 failures are intest/runtime/desktop-engine.test.js("The Evolver Desktop installation could not be verified") and fail the same way onorigin/main(1e13d18) on the same machine, so they come from that machine's Desktop install, not from this change.Merge Danger
Door: two-way. One regex, reverted by reverting this commit.
Blast Radius: recall text
Every host's recall query and task context pass through
promptTextOf. A link with non-ASCII characters in its path (https://zh.wikipedia.org/wiki/中文) now leaves the non-ASCII part in the recall text where it was dropped before. Users get the fix with the next host releases.EvoMap/evolver-claude-code-modshas the same pattern inlib/recall.jsand is not changed here.🤖 Generated with Claude Code