规则库 3.8.1 + 排盘修复 + 评测体系
- 规则库 3.6→3.8.1(542→548 条):剪枝上锁、R-杂-38 从格临界双轨、 R-事-10~13 冲刑方向判别、R-禁-23 自造必要条件之禁 - 排盘修复随 3.6.2 已发:港澳时区夏令时双向误拨、晚子时双重换日 - 新增 评测/ 目录(BaziQA 题答分离、判分工具、记分卡、with/without-skill 对照) 与 scripts/query_rules.py 条款检索;ZIPEC_EVAL 评测额度豁免 - manifest 重建并重新签名;VERSION 保持 3.6.2,不发版不打 tag
This commit is contained in:
@@ -18,12 +18,17 @@ from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import secrets
|
||||
from datetime import date
|
||||
from pathlib import Path
|
||||
|
||||
_ENABLED = True # 软锁总开关:False = 完全放行
|
||||
|
||||
# 评测豁免:环境变量 ZIPEC_EVAL=1 时 check/consume 直接放行——
|
||||
# 跑测试集复测不签发、不扣次、不创建任何文件(见 评测/测试规则.md)。
|
||||
_EVAL_ENV = "ZIPEC_EVAL"
|
||||
|
||||
_SALT = "lingyao-miaojie-ziping-eightchar"
|
||||
_COMPANY = "四川灵爻妙解文化传播有限公司"
|
||||
STATE_REL = Path("data") / ".license.json"
|
||||
@@ -78,6 +83,8 @@ def check(root: Path) -> str | None:
|
||||
"""返回 None 表示放行;返回字符串表示拒跑原因(由调用方打印到 stderr,退出码 4)。"""
|
||||
if not _ENABLED:
|
||||
return None
|
||||
if os.environ.get(_EVAL_ENV) == "1":
|
||||
return None # 评测豁免:不签发、不扣次、不创建任何文件
|
||||
st = _load(root)
|
||||
if st is None:
|
||||
if (root / PUBLIC_MARKER_REL).is_file():
|
||||
@@ -101,6 +108,8 @@ def consume(root: Path) -> None:
|
||||
"""成功排盘一次后扣减一次。仅在 check 放行后调用。"""
|
||||
if not _ENABLED:
|
||||
return
|
||||
if os.environ.get(_EVAL_ENV) == "1":
|
||||
return # 评测豁免:不扣次、不写状态文件
|
||||
st = _load(root)
|
||||
if st is None:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user