Harden CMP review and recovery workflow - #2
Merged
Conversation
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.
背景
本次修改集中处理 CMP 校对与写回流程中的完整性、并发一致性和可恢复性问题,同时改善章节解析、前端审校效率及自动化测试覆盖。
此前存在以下风险:
chapters模式依赖正则提取,容易受到嵌套结构、注释和字符串内伪字段影响;translating状态缺少安全、可解释的恢复流程;主要修改
CMP 完整性与并发保护
protected_hash,覆盖:protected_hash,仍允许正常人工校对。cmp_revision乐观锁,防止旧页面覆盖外部编辑器修改。task_id、protected_hash或使用旧式源指纹时仍可读取。源文件与写回安全
v2::章节解析
chapters/*.snbt提取从正则替换为轻量 token/span walker。//;限流重试与提供商错误
rate_limited且译文仍等于原文的条目。review,不会再次发送或被覆盖。Retry-After,等待时间最高 60 秒。任务状态恢复
translating记录。applying状态始终不会自动解锁,避免任务书被二次覆盖。前端审校体验
测试、CI 与版本
CmpTableVite SSR 组件测试。0.2.2。用户影响
兼容性
验证
cargo fmt --manifest-path src-tauri/Cargo.toml -- --checkcargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warningscargo test --manifest-path src-tauri/Cargo.tomlnpm run test:frontendnpm run buildnpm run check:versionsgit diff --check未包含的验证