Skip to content

fix: 修复分页同线程多文件同步无法收敛的问题 - #108

Merged
Dailin521 merged 4 commits into
mainfrom
codex/fix-107-paginated-provider
Sep 28, 2026
Merged

Dailin521 merged 4 commits into
mainfrom
codex/fix-107-paginated-provider

Conversation

@Dailin521

@Dailin521 Dailin521 commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

目的 / Why

同一线程有多个分页 rollout 时,Sync 会更新文件,但 SQLite 持续因关联冲突保持旧 Provider,重试也无法收敛。本次允许有明确分页标记、同 ID 和唯一 SQLite 路径锚点的文件组共享一行;已有半同步状态可只补齐 SQLite,随后 noop 不创建备份。

关联 Issue / Related issue

Closes #107

改动 / Changes

  • 保留缺少归属证据、跨 ID 和多 owner 的冲突保护;ordinal 不用于文件身份。统一 Windows DOS/UNC 命名空间及目录大小写别名比较,已对齐的跨 ID owner 仍参与保护,数据库原路径与现有边界保持。
  • 原计划成员冻结可信 ID/historyMode。新增文件始终延后写入,提交前重新有界读首行;归属失效时保护分页候选,即使 SQLite 已有指向该文件的路径。只要有 SQLite 写候选,就终检当前归属,包括传统单文件和首轮 Apply 后才新增的文件;确认本次成功写入的 binding,覆盖原本已对齐的成员。在原生 SQLite 事务内重验全部 owner,更新集合只收缩;无 SQLite 写候选时不增加确认读取、终检、事务或备份。
  • 补充分页组、SQLite-only 收敛、执行期变化、未知新增和 Restore 范围回归;更新 ADR-0047、行为契约、fixture 清单及用户说明。公开 API、CLI 参数、协议版本和错误码保持原合同。
  • 根项目、Electron、锁文件与要求统一的 Legacy .NET 版本元数据更新至 1.0.4;准备发布说明并感谢 @Lorikein12138 提供复现和根因分析。维护者已授权发布,正式产物仍须通过最终 main SHA 的 CI 和隔离容器验收。

影响范围 / Impact

  • Node.js CLI
  • Shared .NET Core
  • Windows GUI
  • macOS GUI
  • WSL / SQLite paths
  • Backup / restore
  • CI / GitHub Actions
  • Documentation

共享 Node Core 的 CLI/Web/Electron 使用同一修复。Windows 路径关联有变化;WSL 限制保持。Legacy .NET 仅统一版本元数据,业务行为保持原样。

数据写入 / Data writes

Sync 仍只更新 rollout 首行 Provider 和 SQLite Provider;整组成员均对齐或成功写入才更新对应行。正文、其他 metadata、历史 model、updated_at 与原始 rollout_path 保持。沿用 UndoBackup、原地写/流式写和 partial 重试合同。

验证 / Validation

Automated

  • 最终 head c1c8588b6662d5ea4ca94098e50e2efc43e30ef8:84 项定向回归通过;npm run architecture:check 通过,PIO 69 通过、15 项 POSIX 跳过;npm test 635 通过、57 跳过、0 失败。跳过包括 15 项 POSIX、3 项 Windows 文件符号链接权限不足、39 项已被 ADR 取代的旧行为。
  • 版本、发布元数据及 docs-check 回归 28 项通过,9 份修改文档的本地链接通过。旧 head CI 超时的 stale-plan 桌面用例在 Windows 隐藏窗口连续运行 3 次通过,保留 trace,未增加超时或放松断言。
  • 从最终 head 重建生产 Electron,production bundle 通过;698 个跟踪源码/配置/依赖文件在构建后复核不变。
  • 新本地 1.0.4 便携 ZIP 解压后,9 个生产文件逐字节比对、ASAR 完整性/fuses、原生 SQLite 与体积门禁通过。实际解压程序隐藏窗口 production E2E 7 项通过,覆盖分页 Sync → noop → Restore、大首行及混合异常数据。
  • 最终 head 的完整跨平台 CI 36375269420 通过:27 项成功、普通文档例外 1 项预期跳过,C10 与 ci-gate 成功。首次 Windows Node 16 的旧 Repair 锁探测到达原 10 秒期限后失败;同版本精确用例连续两次通过后,仅重跑同 run/SHA 的失败任务,保留成功产物,代码、断言及超时均未改动。

以上自动化写入只使用 D 盘合成 Home。

Manual

2026-09-28,维护者反馈先前交付的本地 1.0.4 便携包(d491990)实测成功修复 Issue #107。记录为维护者现场反馈,不能将其自动套用到后续产物,也未扩展为再次同步、Restore 或真实安装/升级/卸载的人工验收。

Not run

最终 main SHA 的 CI 和正式包容器验收另行执行;真实安装/卸载由隔离容器完成。线上跨版本下载安装与真实 WSL 使用未独立验收。未签名;本轮不发布 npm、Legacy 或其他平台包。最后文件复核后与外部写者不承诺原子隔离,沿用部分完成与重试机制。

检查清单 / Checklist

  • PR 只包含相关修改 / This PR contains only related changes
  • 已补充相关测试,或说明不需要测试的原因 / Tests were added or the reason they are unnecessary is explained
  • 如有用户可见变化,已更新相关文档 / Relevant documentation was updated for user-facing changes
  • 未提交未脱敏的凭据、会话、SQLite、备份、日志或个人信息 / No unredacted credentials, sessions, databases, backups, logs, or personal data are included

@Dailin521
Dailin521 marked this pull request as ready for review September 28, 2026 02:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T03:55:04.327941Z c1c8588 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d491990681

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/application/provider-sync.js Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1223f96ccf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/application/provider-sync.js Outdated
@Dailin521
Dailin521 merged commit dc03ca8 into main Sep 28, 2026
53 of 56 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.

bug: 从openai同步至custom时固定报错会话关联冲突

1 participant