lili a9d1172509 docs(ip): 知识产权申报材料(6软著+4专利)+ 双层复核(Codex×Opus)整改
- 6 件软著材料 ruanzhu-1..6(软件说明书/源文件清单/源代码鉴别材料/申请信息表)
- 4 件发明专利交底材料 patents/01..04 + 知识产权申报总表
- 双层复核报告 + 整改(均经验证、零第三方泄漏):
  · ru-3 补漏纳 2 文件 + 重生成鉴别材料消逐字不符 + 统计→123/10186
  · ru-6 补 service.py(300行)→12/1650;ru-1 修鉴别材料截断边界
  · ru-4/ru-5 计数漂移同步(12841 / 9859);run.py/prompt.py「九门」口径
  · 6 包 清单/鉴别材料/申请表 三者一致
- docs/ip/_tools 确定性重生成器 + README(提交窗口重快照复用)
- 材料含【待填】行政占位,待律所终审 + 著作权人实名提交后生效(尚未提交)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 07:09:16 -07:00

24 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ru-6 源代码鉴别材料.txt 插入 service.py 块(字节忠实、最小改动)。
service.py 字典序在 run.py 与 validate.py 之间 → 块插在 validate.py 分隔符前。
块格式复刻现有:`// ===`/`// 文件worker/<rel>`/`// ===` + 文件正文 + 2 空行(块间分隔)。"""
P = "docs/ip/ruanzhu-6-gen-worker/源代码鉴别材料.txt"
SRC = "wg1/gen-worker/worker/service.py"
EQ = "// ============================================================"
txt = open(P, encoding="utf-8").read().split("\n") # 末尾若有 \n → 末元素 ''(join 时还原)
idx = txt.index("// 文件worker/validate.py") # validate 块「文件:」行
assert txt[idx - 1] == EQ, "validate 开头分隔符不符: %r" % txt[idx - 1]
ins_at = idx - 1 # 插在 validate 块开头 // === 之前
svc = open(SRC, encoding="utf-8").read().split("\n")
if svc and svc[-1] == "":
svc.pop() # 去掉尾换行造成的末空元素 → 300 行正文
block = [EQ, "// 文件worker/service.py", EQ] + svc + ["", ""] # 3 分隔 + 300 正文 + 2 块间空行
new = txt[:ins_at] + block + txt[ins_at:]
open(P, "w", encoding="utf-8").write("\n".join(new))
print("svc_content_lines=%d block_lines=%d old_total=%d new_total=%d insert_before_line=%d"
% (len(svc), len(block), len(txt), len(new), ins_at + 1))