rw-revision-patch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

RW 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

  1. 读取
    references/method.md
    references/patch-format.md
  2. 保留原始文稿,运行
    scripts/revision_patch.py anchor
    生成带块 ID 的副本和 manifest。
  3. 根据已批准的修改范围建立 Patch JSON。
  4. 运行
    check
    ,确认 hash、块 ID、修改比例和问题 ID。
  5. 运行
    apply
    生成新文稿和报告。
  6. 对修改块复核内容,对未修改块核对 preserved ratio。
  1. Read
    references/method.md
    and
    references/patch-format.md
    .
  2. Keep the original document, run
    scripts/revision_patch.py anchor
    to generate a copy with block IDs and a manifest.
  3. Create a Patch JSON based on the approved modification scope.
  4. Run
    check
    to verify the hash, block ID, modification ratio, and issue ID.
  5. Run
    apply
    to generate the new document and report.
  6. 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-patch
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
Stop when modified blocks exceed 60% of the full text. Add
--allow-large-patch
only after the user explicitly approves large-scale modifications.

工作阶段

Work Stages

  1. 固定基础文稿和版本 hash。
  2. 把标题、段落、列表或代码块按空行边界编号。
  3. 将每项修改连接到块 ID、旧 hash、理由和 issue ID。
  4. 先验证所有操作;任意一项失败时不生成部分结果。
  5. 生成新文件,不覆盖原文件。
  6. 输出修改块、保留块、保留比例和新 hash。
  1. Fix the base document and version hash.
  2. Number headings, paragraphs, lists, or code blocks by blank line boundaries.
  3. Link each modification to the block ID, old hash, reason, and issue ID.
  4. Verify all operations first; do not generate partial results if any operation fails.
  5. Generate new files without overwriting the original files.
  6. Output modified blocks, preserved blocks, retention ratio, and new hash.

运行规则

Operation Rules

  • 原文件不被修改。
  • Patch 第一版只支持
    replace
  • 一个块在一次 Patch 中只能修改一次。
  • expected_hash
    必须与 manifest 一致。
  • new_text
    不能包含 RW block marker。
  • 任意 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.
  • expected_hash
    must match the manifest.
  • new_text
    cannot contain RW block markers.
  • 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
    .