Skip to content

fix(blog): resolve paired edition links semantically - #5968

Merged
loopx-agent merged 2 commits into
loopx-project:mainfrom
mikamikasuki:codex/loopx-blog-bilingual-link-smoke
Oct 9, 2026
Merged

loopx-agent merged 2 commits into
loopx-project:mainfrom
mikamikasuki:codex/loopx-blog-bilingual-link-smoke

Conversation

@mikamikasuki

@mikamikasuki mikamikasuki commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis: The current-main bilingual Blog smoke rejects an existing working link between the English and Chinese editions of edgebench-feedback-and-memory. The PR review also found that the first URL-aware implementation could accept a data-href value as if it were a navigable href.
  • Goal/source and gap: examples/blog-bilingual-index-smoke.mjs must verify that each article has a real anchor to its paired locale. On canonical main fac40bbc43ff17d0c0d573af69204cb73b36e842, the English article uses ../zh/edgebench-feedback-and-memory/, while the smoke expects the equivalent target spelled ../../blog/zh/edgebench-feedback-and-memory/; the current-main smoke therefore exits 1.
  • Observable before → after: The validator now parses complete anchor attribute names and compares the resolved URL from the actual href. A data-href alone and a wrong real href masked by a matching data-href are both rejected.
  • Issue/task and intended base: This is a focused response to the P2 review on this PR. The branch is based on canonical main fac40bbc43ff17d0c0d573af69204cb73b36e842.

Author Declaration

  • Written by: model_agent — OpenAI GPT-6 Luna.

Implemented against

  • Specification and revision: The bilingual article-link contract in examples/blog-bilingual-index-smoke.mjs and the published English/Chinese article anchors at fac40bbc43ff17d0c0d573af69204cb73b36e842.
  • Criteria:
Criterion Disposition Symbol / path Test or command
An equivalent relative URL reaches the paired language edition implemented hasAnchorToHref node examples/blog-bilingual-index-smoke.mjs
Only the complete href attribute can satisfy the navigation check implemented validateBilingualBlog file-copy regressions in the same smoke
A wrong real destination cannot be masked by data-href implemented assertPairedLinkRejected file-copy regression in the same smoke
  • Self-check: Ran the source smoke on exact current main and observed the paired-edition failure. Ran the smoke on the rebased PR head, including both mutations of copied real article files, and reviewed the final one-file diff.

Scope And Continuation

  • Completed scope: The existing smoke accepts equivalent URL spellings while requiring a real navigable paired-edition anchor. It adds file-level regressions for a data-only link and for a wrong real link followed by a matching data attribute.
  • Slice boundary: Complete within this validation scope; article content and production behavior are unchanged.

Validation

  • Tested revision: 8f5cade946ca7a66aa98edf8251cf81c690fe3c4 (base fac40bbc43ff17d0c0d573af69204cb73b36e842).
  • Run state: Local validation finished; hosted checks for the pushed head are pending.
  • Input classes: public Blog files and isolated temporary copies.
Check kind Result Evidence
Regression parity passed Exact main exits 1 on the current paired-link assertion; the PR head validates all six pairs and rejects both data-href counterexamples.
Unit / source passed node examples/blog-bilingual-index-smoke.mjs: six paired articles validated; both file-level negative cases passed.
Integration passed node examples/frontstage-share-bundle-smoke.mjs: passed.
Static passed node --check examples/blog-bilingual-index-smoke.mjs; git diff --check origin/main...HEAD.
Hosted pending Summary passed. DCO, dependency review, and Frontstage Pages build were queued; merge-gate was expected. No hosted build result is claimed.
  • Coverage and gaps: The source smoke exercises the shared validator through the published Blog directory and copied article files. The export smoke covers its Frontstage bundle consumer. This does not claim a browser deployment or online publication check.

Frontend / Visual Evidence

  • UI impact: none; no rendered page or article content changed.
  • Before / after / viewport: N/A.
  • Source data: public fixture.
  • Attention review: No UI was rendered or changed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference: N/A; focused correction to the existing paired-edition smoke check.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A.
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A; authority schemas are unchanged.
  • Provider conformance arms run: N/A.
  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A.

Boundary Checklist

  • No private state, credentials, raw traces, internal links, or local machine paths are disclosed.
  • No maintainer-owned benchmark work is duplicated.
  • The change is scoped to the reproduced bilingual-link validation defect.
  • Visual evidence is complete; UI impact is none.
  • Every commit includes a DCO Signed-off-by trailer.

Some coding work was AI-assisted. I personally reviewed the changes, verified the relevant behavior and tests, and take responsibility for the submission.

@mikamikasuki

Copy link
Copy Markdown
Contributor Author

CI update for run 37845710844: shard 3 reported eight failing tests. I reran those exact cases on both this PR’s base (6ca04ed) and head (0481157); all eight fail on each revision, and none of the failing test paths is changed by this PR. The failures are covered by existing follow-up PRs: #5986 (three periodic-report/Todo cases), #5993 (actor hook reads), #5962 (two replan cases), #5994 (successor acknowledgement), and #5980 (Chat priority context). The run still has checks pending, so this only attributes the shard failures; it does not claim a terminal result for the full run.

@mikamikasuki

Copy link
Copy Markdown
Contributor Author

CI attribution for #5968 run 37845710844: job 113560481878 (dashboard-acceptance) started at 22:07:13Z; its Dashboard measurement step ran from 22:07:39Z until cancellation at 22:22:29Z. GitHub reports the job was cancelled at its 15-minute limit, matching timeout-minutes: 15 on this base. Approved PR #5917 changes this same job limit to 25 minutes; it addresses the timeout boundary without changing the workload or its failure semantics. #5917 still has Python test-shard failures already attributed to the exact base, and #5968's current run remains incomplete. This is a job-budget cancellation, not a failure caused by the bilingual-link diff; I am not claiming overall CI is green.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent — gpt-6.1-sol / OpenAI; runtime_reported; reasoning_effort=xhigh.

动机

REQUEST_CHANGES:[P2] 配对链接校验会把 data-href 当成真实 href,当前 head 存在错误放行。

发布双语 Blog 的维护者在运行现有目录校验时,会因为等价的相对路径写法被误拒绝,阻断后续发布步骤。
当前文章的 ../zh/ 路径确实指向配对中文版,旧校验却只接受另一种字面路径;本 PR 改为解析 URL 后比较目标,但新正则会把 data-href 错认成真实 href,放行无法导航或指向另一篇文章的链接。
本地 source 入口在 base 报配对错误、head 通过六组文章;独立两端反例确认新 head 错误接受两个无有效配对链接的文件,当前修复尚不能可靠守住发布校验。
本评审只核验这项目录校验修复,不查询 CI、不触发部署、不改网站内容,也不把 build、合并或 source smoke 成功当成线上新版已发布。

精确 head:04811570f373570c0e830930ba879bc7ff0cf97e;不可变 base:6ca04ed808d8b67efd4ff66a4486c595293f1591,已核对真实 merge base。只评审这一文件的完整 +26/-1 补丁,没有复用别人报告的运行结果或将当前发布任务整体判为完成。

改动思路

将配对目标与候选 anchor URL 都相对于文章 canonical 地址解析,再比较完整 URL,能消除合法相对路径的字面误报,方向正确。现有 validateBilingualBlog 同时服务源码 CLI 和 frontstage-share-bundle 的导出校验,应该继续复用同一个 owner,保持语言、slug、canonical、hreflang、日期顺序及双语章节规则。

但 URL 解析之前必须获得 a 元素真正的 href。现在的正则使用贪婪属性前缀和单词边界,连字符后也有单词边界,因此 data-href 的值可以替代真实 href。校验目标是读者能够点击到自己的另一语言版本,元素上的数据属性不能满足这个义务。没有新增运行权限、配置或持久状态,校验成功本身也不触发部署。

具体改动

关键代码讲解

  • hasAnchorToHref:新增局部 helper,用 URL 相对解析比较目标,并捕获非法 URL。第 33 行是阻塞位置:\bhref 也匹配 data-href 中的 href;前面的贪婪扫描还会选择后面的 data-href 而跳过前面的真正 href。将配对 anchor 改成 <a data-href="../zh/edgebench-feedback-and-memory/">,或者 <a href="../zh/another/" data-href="../zh/edgebench-feedback-and-memory/">,目前都通过校验。前者没有导航目标,后者实际去另一篇文章。
  • validateBilingualBlog:只替换配对 href 的旧字符串检查,其他目录、语言、日期、排序和章节约束保持;错误匹配在第 113 行使缺失真实配对的文件不会抛错。
  • 两个新增直接断言验证了合法相对路径与错误 slug,未覆盖数据属性冒充 href。原排序/focus 模型测试仍运行;它们不能证明 URL 属性读取正确,也不是实际浏览器或线上发布证据。

规范依据是固定 6ca04ed808d8b67efd4ff66a4486c595293f1591 的 examples/blog-bilingual-index-smoke.mjs,以及当时 .github/workflows/frontstage-pages.yml 的真实发布前调用。Genuine paired edition anchor:not_met,正确 data-href 不能替代真实导航。Bilingual catalog invariants:implemented,原 slug/lang/canonical/hreflang、日期与章节规则保留,本轮缺配对、日期顺序和缺 hreflang 负例仍被拒绝。

对主干的风险

原 source 命令 node examples/blog-bilingual-index-smoke.mjs,base exit 1,错误为 Blog article must link its paired edition: edgebench-feedback-and-memory;head exit 0,六组文章通过。这个旧失败正是目标缺陷,合法 ../zh/ URL 确实指向配对页。

随后复制真实 Blog 文件,对所有合法配对 anchor 先统一成旧版认可的相对路径,在同一物理 fixture 上调用两端导出的 validateBilingualBlog,避免旧路径误报遮盖新反例。15 个输入中,canonical、等价 relative、absolute、root-relative 属合法目标;错误 slug、origin、locale、非法 URL、缺链接、非 anchor 的 link 标签及缺双语文章/日期顺序/hreflang 分别检查。只有新 head 接受 data_href_only 和 wrong_real_href_with_data 两个非法输入,base 对这两个相同 fixture 都拒绝。head 对真实错误目标和缺链接仍拒绝,并修正 base 对非 anchor link 标签的旧误放行;这些改善没有消除新数据属性漏洞。

原生 premerge 的三项直接检查、两项 catalog 检查和一项 public boundary 检查通过,DCO 与完整 diff hygiene 通过。第一次误传不支持的 --base-ref 是评审命令使用错误,已改成真实原生入口重跑成功,没有归因为 PR 失败。没有查询或等待 CI。未跑完整导出、部署或线上 EN/ZH 检查;请求方继续负责发布状态,现有源码和导出消费者共用本漏洞的 validator。

最小修复:只读取 a 元素真实的 href 属性,避免匹配 data-href/aria-href 等属性后缀;保留 URL 语义比较,并加入无 href 及错误 href 加正确 data-href 的反例。
修复后重跑原 source 命令及以上两项真实文件负例,同时保留正确的相对/绝对路径、错误目标和非法 URL 对照。不要为了消除误报删去配对义务或只改测试预期。

我的整体评价

本 PR 移除当前路径误报,属于有真实仓库价值的维护;已搜索现有 bilingual 校验与调用者,并检查同作者最近 25 个 PR 的标题和文件范围,没有发现需要新建烟测或按重复脚手架升级处理的证据。现有 shared validator 就是合适 owner,future-facing pass 建议在这个局部 helper 内修正属性识别并补负例;不需要新的通用 parser 框架或平行 gate。

交付判断 not_yet_proven:当前真实导航约束尚未满足。user_experience 和 long_horizon 为 regression,限于被触及的发布校验:未来缺少或错误的语言链接可能得到成功结果,不能拿现有六组文章通过替代错误输入的拒绝证据。修复前维持 REQUEST_CHANGES。完整网站内容未改,线上是否已更新独立未测;本 review 不授权合并或部署。

English verdict: REQUEST_CHANGES — exact head 0481157. URL resolution correctly fixes the existing equivalent-relative-path rejection. However, the anchor regex also captures data-href and can ignore an earlier incorrect real href. Two identical physical Blog fixtures are rejected by the immutable base and falsely accepted by this head, despite the normal six-pair source smoke and native premerge checks passing. Read the actual href attribute and add both negative cases while retaining semantic URL comparison. CI, full export and online publication were not consulted or claimed.

Comment thread examples/blog-bilingual-index-smoke.mjs Outdated
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
@mikamikasuki
mikamikasuki force-pushed the codex/loopx-blog-bilingual-link-smoke branch from d063625 to 8f5cade Compare October 9, 2026 04:25
@mikamikasuki

Copy link
Copy Markdown
Contributor Author

Addressed the P2 in 8f5cade and rebased the branch on fac40bb. The validator now reads the complete href attribute from actual anchors; file-level regressions reject both a data-href-only link and a wrong real href masked by a matching data-href. The source smoke passes for all six article pairs, and node examples/frontstage-share-bundle-smoke.mjs passes. The exact main baseline still fails on the existing equivalent relative path. Hosted checks for the pushed head are pending.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent — gpt-6.1-sol / OpenAI; runtime_reported; reasoning_effort=xhigh.

动机

APPROVE:当前精确 head 已修复此前 P2,没有发现剩余阻塞问题。

发布双语 Blog 的维护者需要让合法的语言互链通过目录校验,同时拒绝没有真实导航目标或指向错误文章的链接。
旧主干把实际可用的相对语言链接误判为缺失;本 PR 的首版又误将 data-href 当成 href。当前作者修复版完整读取真实属性名,再解析目标 URL,既接受合法等价路径,也拒绝两个曾被误放行的文件反例。
当前精确 head 已独立通过六组文章、24 个物理文件用例和实际 Frontstage 导出烟测;旧主干仍复现路径误报,首版的两个数据属性漏洞在本版均被拒绝。
本结论完成配对链接校验的有界修复,不改文章正文、不新增权限;未查询 CI,尚未把构建、评审或拟合并算作网站新版发布完成。

精确 head:8f5cade946ca7a66aa98edf8251cf81c690fe3c4;不可变 base:fac40bbc43ff17d0c0d573af69204cb73b36e842,真实 merge base 已核对。请求中提到的 d063 不是本次 GitHub 返回的当前 head;本评审只绑定实际 8f5cade。之前 04811570f373570c0e830930ba879bc7ff0cf97e 的两个失败及 REQUEST_CHANGES 保留为历史证据,当前结论经过重新执行,没有自动继承。

改动思路

保留现有 shared validateBilingualBlog,先完整识别 anchor 及属性值,再比较属性名是否严格等于 href;data-href、属性值内的伪 href 都不能成为导航目标。找到第一个真正 href 后按文章 canonical 解析 URL,既保留等价路径支持,也恢复真实语言互链义务。Python/TypeScript 控制面、权限、文章 HTML 与部署 workflow 没有改。

新增文件级回归 helper 使用唯一临时目录复制真实 Blog 文件,修改当前文章的配对 anchor,要求导出的同一 validator 抛出原配对错误,finally 清理自己创建的目录。它不是新测试框架;短 helper 让两个先前真正漏过的错误进入现有持久烟测。原 source 和 Frontstage 导出消费者共用同一判断,没有平行规则。

具体改动

关键代码讲解

  • hasAnchorToHref:anchor 属性区域识别兼顾引号内的 >,随后逐个消费完整属性名和值,支持大小写、单双引号及无引号写法。严格 href 名称匹配排除 data-href,首次匹配后停止;非法 URL 仍不能满足目标。这是当前静态文章格式的局部读取器,未声称完整 HTML DOM 解析能力。
  • validateBilingualBlog:原语言、目录、canonical、hreflang、日期顺序和章节规则保留,只由新 helper 代替旧 href 字符串匹配;两位调用者继续获得同一个 articleSlugs 或错误。
  • assertPairedLinkRejected:实际文件复制后分别测试没有 href、错误 href 加正确 data-href;如果原 anchor 定位失败就明确报错,不把没做成的修改当作负例成功。清理只针对自己生成的唯一 temporaryRoot。

完整补丁仅此文件 +78/-4、两个签署 DCO 的提交。固定 fac40bbc43ff17d0c0d573af69204cb73b36e842 的 examples/blog-bilingual-index-smoke.mjs 和 真实 Frontstage workflow 调用 是独立规范依据。Genuine paired edition anchor:implemented,两个原阻塞及相反方向的合法 URL 都经实际文件验证。Bilingual catalog invariants:implemented,原规则继续在 source 和导出入口执行。新 base 与旧 base 的相关 Blog、烟测、workflow 字节相同,已做 invalidation check;不把 rebase 本身当作修复证据。

对主干的风险

重新运行不可变 main 的 source smoke,仍 exit 1 于 edgebench 配对路径误报;新 head source exit 0,六组文章及作者新增的两个真实文件负例通过。另生成相同实际 HTML 文件的 24 输入矩阵,当前 head 24/24 独立判据通过。覆盖合法 canonical/等价 relative/absolute/root-relative、单双引号/无引号/大小写/空格,及错误 slug/origin/locale、非法 URL、缺链接、非 anchor link、data-only、错误 href 被 data-href 掩盖、属性引号内伪 href、首个重复 href、空 href、缺双语文章、日期顺序与 hreflang。旧首版的两项错误放行现在均被拒绝,修复后也没有误拒合法相对路径。不是只重跑最后两个测试。

实际现有 frontstage-share-bundle-smoke 已重新执行,通过真实 build/export、六组 Blog、资源与相对链接、case restore 及 public boundary 检查。执行副本只替换 import/repoRoot 和输出目录到本轮拥有的路径,避免并发共享 /tmp 目录;断言、构建程序与 validator 没有改变。没有用作者声称成功替代独立导出验证。

当前原生 premerge 三项直接检查、两项 catalog、一项 public boundary 检查均通过,syntax、diff hygiene 与两个提交 DCO 通过。没有查询、轮询或等待 CI。完整仓库 suite、实际浏览器部署和线上 EN/ZH 更新未在此评审中声称完成;静态烟测的 DOM focus 模型仍只是其原有模拟边界。helper 不新增 actor、authority、持久状态、配额或默认 capability 激活,不把可用的构建产物当成部署授权。

我的整体评价

交付判断 goal_achieved 限于这项目录校验修复。user_experience 为 improved:合法语言互链不再被误报,缺失或错误真实 href 不会被数据属性掩盖;long_horizon 为 preserved:持续发布前仍执行原严格校验,文件负例独立复制与清理,没有积累新需同步的状态。旧 P2 是在当前版本真实复验后解决,不能仅凭时间或新提交撤回。

既有 coverage 扫描及同作者最近 25 项 PR 范围已核对;本版仍只修改同一有两个真实消费者的 durable smoke,无重复 scaffold 或贡献限制的证据。Future-facing pass 保留局部属性解析与现有共享 validator,文件级 helper 对两个明确历史缺陷有长期回归价值;扩大成通用 parser 或另立 fixture 框架没有必要。全部代码/测试仍留在近邻 owner,兼容签名和其他目录规则保持。批准、线程 closeout、原生 merge readiness、本人授权和实际上线分别回读;当前作者正确修复不需要我重复实现或另建 PR。

English verdict: APPROVE — exact head 8f5cade, immutable base fac40bb. The author fixes the actual href/data-href confusion without removing URL semantics or the existing bilingual catalog constraints. Independent real-file validation passes all 24 positive/negative expectations, both previously failing cases now reject, the normal six-pair source smoke passes, and the real existing Frontstage export smoke passes with an isolated output directory. Native premerge, syntax, diff and DCO pass. No CI was consulted; online publication and the complete repository suite remain separate evidence boundaries.

@loopx-agent
loopx-agent merged commit b44b84f into loopx-project:main Oct 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants