rw-revision-patch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRW Revision Patch
RW Revision Patch
限制修改范围。第一版只替换已有 Markdown 块,不静默增加、删除或重排章节。
Restrict modification scope. The first version only replaces existing Markdown blocks, without silently adding, deleting, or rearranging sections.
启动
Startup
- 读取 和
references/method.md。references/patch-format.md - 保留原始文稿,运行 生成带块 ID 的副本和 manifest。
scripts/revision_patch.py anchor - 根据已批准的修改范围建立 Patch JSON。
- 运行 ,确认 hash、块 ID、修改比例和问题 ID。
check - 运行 生成新文稿和报告。
apply - 对修改块复核内容,对未修改块核对 preserved ratio。
- Read and
references/method.md.references/patch-format.md - Keep the original document, run to generate a copy with block IDs and a manifest.
scripts/revision_patch.py anchor - Create a Patch JSON based on the approved modification scope.
- Run to verify the hash, block ID, modification ratio, and issue ID.
check - Run to generate the new document and report.
apply - Review the content of modified blocks and check the preserved ratio of unmodified blocks.
命令
Commands
bash
python3 scripts/revision_patch.py anchor draft.md --output draft.anchored.md --manifest draft.manifest.json
python3 scripts/revision_patch.py check draft.anchored.md --manifest draft.manifest.json --patch revision.patch.json
python3 scripts/revision_patch.py apply draft.anchored.md --manifest draft.manifest.json --patch revision.patch.json --output draft.revised.md --report revision.report.json修改块超过全文 60% 时停止。只有用户明确同意大范围修改后才能加入 。
--allow-large-patchbash
python3 scripts/revision_patch.py anchor draft.md --output draft.anchored.md --manifest draft.manifest.json
python3 scripts/revision_patch.py check draft.anchored.md --manifest draft.manifest.json --patch revision.patch.json
python3 scripts/revision_patch.py apply draft.anchored.md --manifest draft.manifest.json --patch revision.patch.json --output draft.revised.md --report revision.report.jsonStop when modified blocks exceed 60% of the full text. Add only after the user explicitly approves large-scale modifications.
--allow-large-patch工作阶段
Work Stages
- 固定基础文稿和版本 hash。
- 把标题、段落、列表或代码块按空行边界编号。
- 将每项修改连接到块 ID、旧 hash、理由和 issue ID。
- 先验证所有操作;任意一项失败时不生成部分结果。
- 生成新文件,不覆盖原文件。
- 输出修改块、保留块、保留比例和新 hash。
- Fix the base document and version hash.
- Number headings, paragraphs, lists, or code blocks by blank line boundaries.
- Link each modification to the block ID, old hash, reason, and issue ID.
- Verify all operations first; do not generate partial results if any operation fails.
- Generate new files without overwriting the original files.
- Output modified blocks, preserved blocks, retention ratio, and new hash.
运行规则
Operation Rules
- 原文件不被修改。
- Patch 第一版只支持 。
replace - 一个块在一次 Patch 中只能修改一次。
- 必须与 manifest 一致。
expected_hash - 不能包含 RW block marker。
new_text - 任意 precondition 失败时整批停止。
- 未涉及块的正文保持原样。
- 新增、删除、重排章节进入结构修改,不伪装成局部替换。
- Patch 只能限制改动范围,不能证明修改内容正确。
- Original files are not modified.
- The first version of Patch only supports .
replace - A block can only be modified once in a single Patch.
- must match the manifest.
expected_hash - cannot contain RW block markers.
new_text - Stop the entire batch if any precondition fails.
- The content of unmentioned blocks remains unchanged.
- Adding, deleting, or rearranging sections constitutes structural modification and cannot be disguised as partial replacement.
- Patch can only restrict the scope of changes, not prove the correctness of modified content.
输出
Outputs
- Anchored Markdown 副本。
- Block manifest JSON。
- Patch JSON。
- Revised Markdown 新文件。
- Apply report JSON,包含 preserved ratio 和修改追踪。
- Anchored Markdown copy.
- Block manifest JSON.
- Patch JSON.
- Revised Markdown new file.
- Apply report JSON, including preserved ratio and modification tracking.
停止条件
Stop Conditions
- 输入文稿没有稳定版本时,不生成 Patch。
- hash、块 ID 或基础文稿不匹配时停止。
- 修改比例超过 60% 且用户没有明确批准时停止。
- 需要新增、删除或重排章节时,改走结构修订流程。
- Do not generate Patch when the input document has no stable version.
- Stop when the hash, block ID, or base document does not match.
- Stop when the modification ratio exceeds 60% and the user has not explicitly approved it.
- Switch to the structural revision process when sections need to be added, deleted, or rearranged.
接续
Follow-up Workflows
- 学术写作:。
rw-phd-write - 作者语气:。
rw-phd-tone - 审稿回复:。
rw-journal-submission - 主张复核:。
rw-claim-audit
- Academic writing: .
rw-phd-write - Author tone: .
rw-phd-tone - Review response: .
rw-journal-submission - Claim review: .
rw-claim-audit