工程(闸 09 存量红照实记+基线只降不升): 撤销「把两条恶化登记为现行值」的做法(用户裁:标准是尺,不以现状为尺)——①tools/gdstyle_baseline.txt 两条登记值回退 battle_orchestrator max-file-length 1314→1302、level_map_screen max-class-variables 22→21(波 0 已批准的 18 条陈旧键清理保留不动);②tools/gdstyle_gate.py 逐条 NEW/恶化行加 FAIL 前缀——gate 09 的存量红指纹只取含 FAIL 的行,原「NEW/WORSENED」行不进指纹,两次不同恶化集指纹相同=存量红期间任何新增违规或进一步恶化都会被「同款存量红」放过;顺带加 refresh 抬升守卫(重生成会把任一登记值抬高即拒写,须 --force 显式确认;原只有骤降守卫,37625317 曾借重生成静默吸收 3 条抬高);③game/tests/.gates/baseline.json 09 条目改 exit=1+现算指纹 91d45583cf6d(红项=上列两条,逐条点名可核;此前记的 user-approved-iter38 是手写标记,永不等于现算指纹,合回必被拦),note 记现行口径:阈值不变=gdstyle 默认(文件 1000 行/类变量 15 等),还债归迭代 40 卡①与迭代 41 卡③;④static_scan.sh S13 头注补 FAIL 前缀与只降不升两句。验证:--refresh 实测拒写且基线文件逐字节未变;静态扫描实测 exit=1,两条恶化逐条列名。

This commit is contained in:
DKChan committed 2026-10-27 06:27:36 +08:00
1 parent 4f4a9bdaad
commit 05745df3fb
4 files changed
+38 -17

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
{ {
"note": "存量基线·首次自动生成;闸况变化时本脚本会判红,需人工确认后重生成;2026-10-17 人工确认重生成 06 条目:af94ce97 把 gdd_lint 记为存量红(01 篇 R5),该红已由 fcb8c3f8 补流程图消除,实测 --docs 域 06 exit=0,故基线改回绿。2026-10-18 新增闸件 08c 流水线闸(tools/pipeline_gate.py 注册上电),手工加入绿记录(roadmap 压缩批实测 --docs 域 exit=0),其余条目原样保留。2026-10-22 测试术语与层级重构批 A 改键:01 冒烟全量→01 系统测试(同一断言面 smoke_all.gd,运行器换 tools/run_system_test.py,过渡期判定口径不变)、02 单元套件→02 单元与集成测试(同一 run_all.gd 入口,名从实)、新增 00 冒烟测试(tools/run_smoke.py+game/tests/smoke_boot.tscn,重写后单跑实测 17 项 0 失败 PASS);09 静态扫描基线 exit=1(fp=4354b2aa72a7)系滞后红,本批单跑实测 exit=0(与 2026-10-22 16:20 回执一致),基线改回绿;其余条目原样保留。;2026-10-23 主会话记 07 doc_link 为存量红(用户令忽略:锻造工坊.md 死链的修复在另一会话未合入,合回闸豁免;外部修复合入后应重生成基线归绿);2026-10-26 用户特批带红合并(迭代 38 收口):09 静态扫描记存量红——gdstyle 恶化 2 条(battle_orchestrator.gd max-file-length 1314>1302=卡④头注必载内容、level_map_screen.gd max-class-variables 22>21=卡①缓存成员,均为卡片义务的记账漂移非缺陷,压缩还债经计算不可行),用户裁「不管引入的恶化直接提交、特许免测试重跑」;后续批次若触及两文件可顺带还债或经批准重生成基线归绿;两项恶化已按用户批准登记为现行值(gdstyle 基线重生成、09 归绿),迭代 40 卡① 还债后再次收紧", "note": "存量基线·首次自动生成;闸况变化时本脚本会判红,需人工确认后重生成;2026-10-17 人工确认重生成 06 条目:af94ce97 把 gdd_lint 记为存量红(01 篇 R5),该红已由 fcb8c3f8 补流程图消除,实测 --docs 域 06 exit=0,故基线改回绿。2026-10-18 新增闸件 08c 流水线闸(tools/pipeline_gate.py 注册上电),手工加入绿记录(roadmap 压缩批实测 --docs 域 exit=0),其余条目原样保留。2026-10-22 测试术语与层级重构批 A 改键:01 冒烟全量→01 系统测试(同一断言面 smoke_all.gd,运行器换 tools/run_system_test.py,过渡期判定口径不变)、02 单元套件→02 单元与集成测试(同一 run_all.gd 入口,名从实)、新增 00 冒烟测试(tools/run_smoke.py+game/tests/smoke_boot.tscn,重写后单跑实测 17 项 0 失败 PASS);09 静态扫描基线 exit=1(fp=4354b2aa72a7)系滞后红,本批单跑实测 exit=0(与 2026-10-22 16:20 回执一致),基线改回绿;其余条目原样保留。;2026-10-23 主会话记 07 doc_link 为存量红(用户令忽略:锻造工坊.md 死链的修复在另一会话未合入,合回闸豁免;外部修复合入后应重生成基线归绿);2026-10-26 用户特批带红合并(迭代 38 收口):09 静态扫描记存量红——gdstyle 恶化 2 条(battle_orchestrator.gd max-file-length 1314>1302=卡④头注必载内容、level_map_screen.gd max-class-variables 22>21=卡①缓存成员,均为卡片义务的记账漂移非缺陷,压缩还债经计算不可行),用户裁「不管引入的恶化直接提交、特许免测试重跑」;后续批次若触及两文件可顺带还债或经批准重生成基线归绿;2026-10-27 用户裁「标准是尺、不以现状为尺」:09 存量红照实记(exit=1+现行红项指纹,两条恶化各自点名可核),gdstyle 基线登记值回退 1302/21(波 0 的 18 条陈旧键清理保留),gdstyle_gate 逐条违规行加 FAIL 前缀并加「refresh 禁抬高登记值」守卫——存量红期间任何新增违规或进一步恶化都会改指纹被拦;阈值口径不变=gdstyle 默认值(文件 1000 行/类变量 15 等),还债归迭代 40 卡①(battle_orchestrator 1314→≤1000)与迭代 41 卡③(level_map_screen 22→≤15),还清后重新生成基线归绿",
"gates": { "gates": {
"00 冒烟测试": { "00 冒烟测试": {
"exit": "0", "exit": "0",
@@ -46,8 +46,8 @@
"fp": "green" "fp": "green"
}, },
"09 静态扫描": { "09 静态扫描": {
"exit": "0", "exit": "1",
"fp": "green" "fp": "91d45583cf6d"
}, },
"10 熵增闸": { "10 熵增闸": {
"exit": "0", "exit": "0",
+4 -2
View File
@@ -291,8 +291,10 @@ fi
# probe/sim/tests 测量面直构惯例不在面)。存量基线 tools/gdstyle_baseline.txt 用稳定身份键(函数级带数 # probe/sim/tests 测量面直构惯例不在面)。存量基线 tools/gdstyle_baseline.txt 用稳定身份键(函数级带数
# 条目=文件|规则|函数名,类级/文件级带数条目=文件|规则,均带登记数值;无数字条目=文件|规则|消息全文 # 条目=文件|规则|函数名,类级/文件级带数条目=文件|规则,均带登记数值;无数字条目=文件|规则|消息全文
# 裸键)——消息里的行数/分支数等计数漂移不假红;判定=基线外新违规红(NEW)+同键指标较登记值恶化红 # 裸键)——消息里的行数/分支数等计数漂移不假红;判定=基线外新违规红(NEW)+同键指标较登记值恶化红
# (WORSENED),改小/持平不红。基线重生成=人工专用(python tools/gdstyle_gate.py --refresh,附对账; # (WORSENED),改小/持平不红;逐条违规行带 FAIL 前缀,使存量红期间的红项清单(哪几条、恶化到多少)
# 键数骤降逾 10% 须 --force),禁清基线换绿。二进制本机固定路径 # 进 gate 09 指纹,新增或进一步恶化不会被「同款存量红」放过。阈值口径=gdstyle 默认值;基线只是欠账
# 簿,登记值只准随还债下降,禁抬高到现状。基线重生成=人工专用(python tools/gdstyle_gate.py
# --refresh,附对账;键数骤降逾 10% 或登记值被抬高均拒写,须 --force),禁清基线换绿。二进制本机固定路径
# D:/code/gdstyle/gdstyle.exe(不入库),GDSTYLE_BIN 环境变量覆盖;版本与钉定版不符即红(升级须重测)。 # D:/code/gdstyle/gdstyle.exe(不入库),GDSTYLE_BIN 环境变量覆盖;版本与钉定版不符即红(升级须重测)。
if python tools/gdstyle_gate.py; then if python tools/gdstyle_gate.py; then
echo "[static_scan] S13 ok" echo "[static_scan] S13 ok"
+5 -3
View File
@@ -3,8 +3,10 @@
# (class variables/public methods/file length)=文件|规则;无数字条目=文件|规则|消息全文(裸键)。 # (class variables/public methods/file length)=文件|规则;无数字条目=文件|规则|消息全文(裸键)。
# 带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键。 # 带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键。
# 判定=键不在基线红(NEW)、同键数值较登记值恶化红(WORSENED)、改小/持平不红。 # 判定=键不在基线红(NEW)、同键数值较登记值恶化红(WORSENED)、改小/持平不红。
# 阈值口径=gdstyle 默认值(tools/gdstyle.toml 不设数值阈值);本文件只是欠账簿,登记值只准随
# 还债下降,禁抬高到现状(抬高=把既有代码当尺子,默认恶化)。
# 重生成=人工专用:python tools/gdstyle_gate.py --refresh(禁清基线换绿;改规则口径/工具升级须随批 # 重生成=人工专用:python tools/gdstyle_gate.py --refresh(禁清基线换绿;改规则口径/工具升级须随批
# 重生成;新键数较旧基线少逾 10% 须加 --force 显式确认)。 # 重生成;新键数较旧基线少逾 10% 或登记值被抬高均拒写,须加 --force 显式确认)。
game/core/action_economy.gd|quality/max-class-variables = 18 game/core/action_economy.gd|quality/max-class-variables = 18
game/core/adventure_runner.gd|quality/max-branches|_apply_curio_pick = 10 game/core/adventure_runner.gd|quality/max-branches|_apply_curio_pick = 10
game/core/adventure_runner.gd|quality/max-class-variables = 42 game/core/adventure_runner.gd|quality/max-class-variables = 42
@@ -13,7 +15,7 @@ game/core/adventure_runner.gd|quality/max-returns|_apply_curio_pick = 9
game/core/battle_orchestrator.gd|quality/max-branches|begin_battle = 17 game/core/battle_orchestrator.gd|quality/max-branches|begin_battle = 17
game/core/battle_orchestrator.gd|quality/max-branches|use_treasure = 18 game/core/battle_orchestrator.gd|quality/max-branches|use_treasure = 18
game/core/battle_orchestrator.gd|quality/max-class-variables = 50 game/core/battle_orchestrator.gd|quality/max-class-variables = 50
game/core/battle_orchestrator.gd|quality/max-file-length = 1314 game/core/battle_orchestrator.gd|quality/max-file-length = 1302
game/core/battle_orchestrator.gd|quality/max-function-length|_place_variants = 52 game/core/battle_orchestrator.gd|quality/max-function-length|_place_variants = 52
game/core/battle_orchestrator.gd|quality/max-function-length|begin_battle = 141 game/core/battle_orchestrator.gd|quality/max-function-length|begin_battle = 141
game/core/battle_orchestrator.gd|quality/max-function-length|use_treasure = 62 game/core/battle_orchestrator.gd|quality/max-function-length|use_treasure = 62
@@ -205,7 +207,7 @@ game/presentation/views/hero_info_panel_view.gd|quality/max-function-length|set_
game/presentation/views/hero_info_panel_view.gd|quality/max-local-variables|set_treasure_inventory = 13 game/presentation/views/hero_info_panel_view.gd|quality/max-local-variables|set_treasure_inventory = 13
game/presentation/views/legend_overlay.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop game/presentation/views/legend_overlay.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop
game/presentation/views/level_map_screen.gd|quality/max-branches|_draw_graph = 9 game/presentation/views/level_map_screen.gd|quality/max-branches|_draw_graph = 9
game/presentation/views/level_map_screen.gd|quality/max-class-variables = 22 game/presentation/views/level_map_screen.gd|quality/max-class-variables = 21
game/presentation/views/level_map_screen.gd|quality/max-function-length|_draw_graph = 78 game/presentation/views/level_map_screen.gd|quality/max-function-length|_draw_graph = 78
game/presentation/views/level_map_screen.gd|quality/max-function-length|_init = 135 game/presentation/views/level_map_screen.gd|quality/max-function-length|_init = 135
game/presentation/views/level_map_screen.gd|quality/max-local-variables|_draw_graph = 27 game/presentation/views/level_map_screen.gd|quality/max-local-variables|_draw_graph = 27
+26 -9
View File
@@ -16,19 +16,25 @@ quality/*+syntax/reserved-identifier,format/naming/order 全关)。扫描
带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键无数值。 带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键无数值。
判定:①键不在基线=新违规(NEW)红;②键在基线且双方有数值、当前数值 > 基线登记值= 判定:①键不在基线=新违规(NEW)红;②键在基线且双方有数值、当前数值 > 基线登记值=
恶化(WORSENED)红——独立于差集,防稳定键吞掉 104→300 行式恶化;③其余绿(改小/持平不红)。 恶化(WORSENED)红——独立于差集,防稳定键吞掉 104→300 行式恶化;③其余绿(改小/持平不红)。
逐条违规行带 FAIL 前缀——gate 09 的存量红指纹只取含 FAIL 的行,带前缀才能让「红项清单」
(哪几条、恶化到多少)进指纹:否则存量红期间的任何新增/进一步恶化都算同款红被放行。
基线重生成=人工专用(--refresh,附新旧对账与骤降守卫),禁在闸内自动重生成(防清基线换绿); 阈值口径=gdstyle 默认值(tools/gdstyle.toml 不设数值阈值);基线只是欠账簿,登记值只准因
新键数较旧基线少逾 10% 时拒绝写入,须加 --force 显式确认(防扫面断裂静默缩基线换绿), 还债下降,禁抬高到现状(抬高=把既有代码当尺子,默认恶化)。
--force 只在 refresh 路径有效。
基线重生成=人工专用(--refresh,附新旧对账、骤降守卫与抬升守卫),禁在闸内自动重生成
(防清基线换绿);新键数较旧基线少逾 10% 拒绝写入(防扫面断裂静默缩基线换绿);任一键登记
值被抬高同样拒绝(防以现状为尺吞掉恶化)。两条守卫都须 --force 显式确认,--force 只在
refresh 路径有效。
二进制:本机固定路径 D:/code/gdstyle/gdstyle.exe(不入库不入包),GDSTYLE_BIN 环境变量覆盖; 二进制:本机固定路径 D:/code/gdstyle/gdstyle.exe(不入库不入包),GDSTYLE_BIN 环境变量覆盖;
版本与钉定版不符即红——升级工具须重测语法兼容性并人工重生成基线。 版本与钉定版不符即红——升级工具须重测语法兼容性并人工重生成基线。
退出码:0=无基线外新违规且无恶化;1=有新违规/有恶化/二进制缺失或版本不符/扫描面为空/ 退出码:0=无基线外新违规且无恶化;1=有新违规/有恶化/二进制缺失或版本不符/扫描面为空/
输出不可解析/refresh 骤降拒写;2=用法错。 输出不可解析/refresh 骤降或抬升拒写;2=用法错。
用法:python tools/gdstyle_gate.py # 闸判定 用法:python tools/gdstyle_gate.py # 闸判定
python tools/gdstyle_gate.py --refresh # 人工重生成基线(覆盖旧文件,附对账) python tools/gdstyle_gate.py --refresh # 人工重生成基线(覆盖旧文件,附对账)
python tools/gdstyle_gate.py --refresh --force # 骤降守卫触发时显式确认写入 python tools/gdstyle_gate.py --refresh --force # 骤降/抬升守卫触发时显式确认写入
""" """
import json import json
import os import os
@@ -171,6 +177,17 @@ def run_gate() -> int:
if len(current) < len(old) * SHRINK_GUARD and not force: if len(current) < len(old) * SHRINK_GUARD and not force:
return fail("新键数 %d 较旧基线 %d 少逾 10%%——疑扫面断裂静默缩基线换绿,拒绝写入;" return fail("新键数 %d 较旧基线 %d 少逾 10%%——疑扫面断裂静默缩基线换绿,拒绝写入;"
"确认缩基线正当(如删规则/缩扫描面)须加 --force 显式确认" % (len(current), len(old))) "确认缩基线正当(如删规则/缩扫描面)须加 --force 显式确认" % (len(current), len(old)))
raised = sorted(
(k, old[k], current[k]) for k in current
if k in old and old[k] is not None and current[k] is not None and current[k] > old[k]
)
if raised and not force:
for k, was, now in raised[:MAX_REPORT]:
print(" FAIL 抬高 %s = %d(登记 %d)" % (k, now, was))
if len(raised) > MAX_REPORT:
print(" ...(截断,共 %d 条)" % len(raised))
return fail("重生成会抬高 %d 条登记值——基线只准因还债下降,抬高=以现状为尺默认恶化;"
"确属阈值口径变更或经用户批准须加 --force 显式确认" % len(raised))
else: else:
print("[gdstyle_gate] 旧基线不存在,跳过对账(首次落位)") print("[gdstyle_gate] 旧基线不存在,跳过对账(首次落位)")
write_baseline(current) write_baseline(current)
@@ -191,15 +208,15 @@ def run_gate() -> int:
red = False red = False
if new: if new:
for k in new[:MAX_REPORT]: for k in new[:MAX_REPORT]:
print(" NEW " + k) print(" FAIL 新增 " + k)
if len(new) > MAX_REPORT: if len(new) > MAX_REPORT:
print(" ...(截断,共 %d 条)" % len(new)) print(" FAIL ...(截断,共 %d 条)" % len(new))
red = True red = True
if worsened: if worsened:
for k in worsened[:MAX_REPORT]: for k in worsened[:MAX_REPORT]:
print(" WORSENED %s = %d(基线登记 %d)" % (k, current[k], base[k])) print(" FAIL 恶化 %s = %d(基线登记 %d)" % (k, current[k], base[k]))
if len(worsened) > MAX_REPORT: if len(worsened) > MAX_REPORT:
print(" ...(截断,共 %d 条)" % len(worsened)) print(" FAIL ...(截断,共 %d 条)" % len(worsened))
red = True red = True
if red: if red:
return fail("基线外新违规 %d 条/恶化 %d 条——新码须修到基线口径内,恶化须还债或经用户批准随批重生成基线" return fail("基线外新违规 %d 条/恶化 %d 条——新码须修到基线口径内,恶化须还债或经用户批准随批重生成基线"