lili 6404ea7db1 docs(ip): 命名空间同步 com.wanxiang.huijing + Codex 复核整改
- 软著3/4 源代码鉴别材料按当前 com.wanxiang.huijing 源码重新提取(gen_ru3/新增 gen_ru4,字节忠实)
- 全量同步包名/路径/芋道目录标签;自研主张以 .game. 段为界,芋道(MIT)整体排除
- 总表 §一统计对齐各清单(123/10186、210/12841、9859、12/1650、461 文件);5.6万→约4.7万(纠无支撑数)
- Codex 只读复核整改:高企表述加限定;专利4 权9 矛盾、专利1 manifest 口径修正;ru-6 便宜→低成本、七门九门→多门统一
- 新增双层复核报告对外洁净版

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 11:17:02 -07:00

74 lines
4.1 KiB
Python
Raw Permalink 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-4 源代码鉴别材料 重生成器(确定性、字节忠实)。
复刻 ru-4 既有格式:7 模块按目录字典序(ad→biz→community→compliance→feed→telemetry→trade),
模块内按相对 game-cloud 路径字典序;仅 src/main 下 .java;
分隔「// ===== 文件: <相对game-cloud路径> =====」;每文件 = 分隔行 + 源码行(splitlines,文件间无空行);
总行 = 文件数 + 物理行;取前 1500 + 后 1500,中间省略。
只读源码,产物写 /tmp/ru4_new.txt;打印逐文件/分模块/总计数,并落各模块清单表行 /tmp/ru4_tbl_*.md。"""
import os, glob
from collections import OrderedDict
REPO = "/Users/lili/Project/games-development-ai"
CLOUD = os.path.join(REPO, "game-cloud")
# 目录字典序(与既有 .txt 起始 game-module-ad 一致)
MODULES = ["game-module-ad", "game-module-biz", "game-module-community", "game-module-compliance",
"game-module-feed", "game-module-telemetry", "game-module-trade"]
SEP = "// ===== 文件: {rel} ====="
files = [] # (module, rel_from_cloud, wcl, splitlines)
no_trailing_nl = []
for m in MODULES:
found = []
for j in glob.glob(os.path.join(CLOUD, m, "game-module-*", "src", "main", "**", "*.java"), recursive=True):
found.append((os.path.relpath(j, CLOUD), j))
found.sort(key=lambda x: x[0])
for rel, j in found:
raw = open(j, encoding="utf-8").read()
wcl = raw.count("\n") # wc -l 口径
if raw and not raw.endswith("\n"):
no_trailing_nl.append(rel)
files.append((m, rel, wcl, raw.splitlines())) # splitlines:无文件间空行,总行=文件数+物理行
# 拼接(字节忠实:每文件=分隔行 + 源码各行)
concat = []
for m, rel, wcl, sl in files:
concat.append(SEP.format(rel=rel))
concat.extend(sl)
total = len(concat)
front = concat[:1500]
back = concat[-1500:]
omit_from, omit_to, omit_cnt = 1501, total - 1500, total - 3000
nfiles = len(files)
nsrc = sum(f[2] for f in files)
nonblank = sum(sum(1 for x in sl if x.strip() != "") for (m, rel, wcl, sl) in files)
blank = nsrc - nonblank
mod = OrderedDict()
for m, rel, wcl, sl in files:
e = mod.setdefault(m, [0, 0]); e[0] += 1; e[1] += wcl
RULE = "=" * 80
header = [
"软件名称绘境AI游戏分发变现与合规云服务系统 版本V1.0",
"说明本鉴别材料为本软件原创业务源代码Java包名 com.wanxiang.huijing.game.module.*),按纳入文件目录字典序连续拼接。",
"统计:纳入原创源文件 %d 个;连续有效代码(含文件分隔标记行)共 %d 行(其中物理代码行 %d 行、空白行 %d 行、非空白有效行 %d 行)。" % (nfiles, total, nsrc, blank, nonblank),
"因总行数超过 3000 行,依软著登记规范取【前 1500 行 + 后 1500 行】,中间部分以分隔标识省略。完整文件清单见《源文件清单.md》。",
"(已严格排除第三方与生成物:芋道(Yudao CloudMIT)基座 huijing-framework/gateway/module-system/module-infra/module-bpm/module-pay/server/dependencies、node_modules、target、各模块 src/test 测试代码、littlejsengine、spikes、*.min.js 等。)",
]
out = header + [RULE, "【前 1500 行】"] + front \
+ [RULE, "【中间部分省略:第 %d 行 至 第 %d 行,共省略 %d 行】" % (omit_from, omit_to, omit_cnt), RULE, "【后 1500 行】"] + back
open("/tmp/ru4_new.txt", "w", encoding="utf-8").write("\n".join(out) + "\n")
print("FILES=%d SRC_LINES=%d CONCAT=%d NONBLANK=%d BLANK=%d OMIT=%d (%d-%d) TXT_LINES=%d" % (
nfiles, nsrc, total, nonblank, blank, omit_cnt, omit_from, omit_to, len(out)))
for m, (c, l) in mod.items():
print(" %-26s %d files / %d lines" % (m, c, l))
if no_trailing_nl:
print(" [WARN 无尾换行]", no_trailing_nl)
print(" BOUNDARY concat[1500]=%r" % (front[1499],))
# 各模块清单表行(刷新《源文件清单.md》用)
for mm in MODULES:
rows = ["| %s | %d |" % (rel, wcl) for (m, rel, wcl, sl) in files if m == mm]
open("/tmp/ru4_tbl_%s.md" % mm, "w", encoding="utf-8").write("\n".join(rows) + "\n")