返回 DeepSeek-Reasonix
provenance.py
根目录 / scripts / official-theme-art / provenance.py
1 """Emit docs/THEME_ASSETS.md + .zh-CN.md — provenance & licence ledger for the
2 official theme assets. Reads hashes from out/report.json (produced by build.py).
3 """
4 from __future__ import annotations
5
6 import datetime
7 import json
8 import os
9
10 HERE = os.path.dirname(__file__)
11 DOCS = os.path.join(HERE, "..", "..", "docs")
12
13 # scene function name + seed per theme (see scenes.py).
14 SCENES = {
15 "official-rose-dawn": ("scene_rose_dawn", 20260117),
16 "official-fortune-forge": ("scene_fortune_forge", 20260118),
17 "official-crimson-horizon": ("scene_crimson_horizon", 20260119),
18 "official-sage-breeze": ("scene_sage_breeze", 20260120),
19 "official-spark-notebook": ("scene_spark_notebook", 20260121),
20 "official-violet-starlight": ("scene_violet_starlight", 20260122),
21 "official-cyan-stage": ("scene_cyan_stage", 20260123),
22 "official-noir-gold": ("scene_noir_gold", 20260124),
23 }
24
25 NAMES = {
26 "official-rose-dawn": "Rose Dawn / 玫瑰晨光",
27 "official-fortune-forge": "Fortune Forge / 鸿运工坊",
28 "official-crimson-horizon": "Crimson Horizon / 赤曜新城",
29 "official-sage-breeze": "Sage Breeze / 鼠尾草清风",
30 "official-spark-notebook": "Spark Notebook / 灵感手账",
31 "official-violet-starlight": "Violet Starlight / 紫曜星夜",
32 "official-cyan-stage": "Cyan Stage / 青岚舞台",
33 "official-noir-gold": "Noir Gold / 黑金序曲",
34 }
35
36
37 def main():
38 report = json.load(open(os.path.join(HERE, "out", "report.json")))
39 today = datetime.date.today().isoformat()
40
41 rows = []
42 for tid in sorted(SCENES):
43 fn, seed = SCENES[tid]
44 r = report[tid]
45 prompt = f"scripts/official-theme-art/scenes.py::{fn} (seed {seed}, 2560×1440 canvas, low-info left 0–52%, key content x 62–88% / y 16–72%)"
46 rows.append((tid, NAMES[tid], prompt, r["background_sha256"], r["preview_sha256"]))
47
48 en = []
49 en.append("# Official Theme Asset Provenance\n")
50 en.append("All eight official Reasonix themes ship with **original** artwork generated procedurally")
51 en.append("from scratch with the scripts in `scripts/official-theme-art/` (numpy + Pillow, fixed seeds,")
52 en.append("fully reproducible). The visual *direction* was inspired by the MIT-licensed")
53 en.append("[Codex-Dream-Skin](https://github.com/Fei-Away/Codex-Dream-Skin) concept gallery, but:\n")
54 en.append("- **No pixels, layouts, UI mockery, text, logos or watermarks were copied** from the reference")
55 en.append(" project or any third party. Every background is re-authored code output.")
56 en.append("- All depicted people are **original fictional adults** drawn by the generator: an illustrated")
57 en.append(" muse (Rose Dawn), a lucky programmer mascot (Fortune Forge), a reader (Sage Breeze), an anime")
58 en.append(" adult (Spark Notebook), a silhouette muse (Violet Starlight), a digital performer (Cyan Stage)")
59 en.append(" and a gentleman (Noir Gold). Crimson Horizon contains no people.")
60 en.append("- Backgrounds contain no windows, sidebars, cards, buttons, inputs or readable text, and are")
61 en.append(" stripped of EXIF/author metadata.\n")
62 en.append("Assets are released under the MIT License as part of the Reasonix repository,")
63 en.append("© Reasonix Contributors. Human review: Reasonix Contributors (release PR review).\n")
64 en.append(f"Generation date: {today}\n")
65 en.append("| Theme | Generator (final prompt equivalent) | background.webp SHA-256 | preview.webp SHA-256 |")
66 en.append("| --- | --- | --- | --- |")
67 for tid, name, prompt, bg, pv in rows:
68 en.append(f"| {name} (`{tid}`) | `{prompt}` | `{bg}` | `{pv}` |")
69 en.append("")
70
71 zh = []
72 zh.append("# 官方主题素材来源与许可记录\n")
73 zh.append("八款 Reasonix 官方主题的全部图片均为**原创**,由 `scripts/official-theme-art/` 中的脚本")
74 zh.append("从零程序化生成(numpy + Pillow,固定随机种子,可完全复现)。视觉*方向*参考了 MIT 许可的")
75 zh.append("[Codex-Dream-Skin](https://github.com/Fei-Away/Codex-Dream-Skin) 概念图库,但是:\n")
76 zh.append("- **未复制参考项目或任何第三方素材的任何像素**、布局、界面元素、文字、标志或水印;")
77 zh.append(" 所有背景均为代码重新生成的独立素材。")
78 zh.append("- 图中人物均为生成器绘制的**原创虚构成年人**:插画女性(玫瑰晨光)、吉祥程序员(鸿运工坊)、")
79 zh.append(" 读者(鼠尾草清风)、动漫人物(灵感手账)、剪影女性(紫曜星夜)、数字表演者(青岚舞台)、")
80 zh.append(" 绅士(黑金序曲)。赤曜新城不含人物。")
81 zh.append("- 背景中不含窗口、侧栏、卡片、按钮、输入框或可读文字,并已去除 EXIF 等元数据。\n")
82 zh.append("素材随 Reasonix 仓库以 MIT 许可发布,© Reasonix Contributors。人工审核:Reasonix Contributors(发布 PR 审核)。\n")
83 zh.append(f"生成日期:{today}\n")
84 zh.append("| 主题 | 生成器(最终提示词等价物) | background.webp SHA-256 | preview.webp SHA-256 |")
85 zh.append("| --- | --- | --- | --- |")
86 for tid, name, prompt, bg, pv in rows:
87 zh.append(f"| {name}(`{tid}`) | `{prompt}` | `{bg}` | `{pv}` |")
88 zh.append("")
89
90 with open(os.path.join(DOCS, "THEME_ASSETS.md"), "w") as f:
91 f.write("\n".join(en))
92 with open(os.path.join(DOCS, "THEME_ASSETS.zh-CN.md"), "w") as f:
93 f.write("\n".join(zh))
94 print("wrote docs/THEME_ASSETS.md + .zh-CN.md")
95
96
97 if __name__ == "__main__":
98 main()
99
99 lines PYTHON