docs: 记录超字数的存量豁免与「下不为例」约定

- MEMORY.md 排版约定下补:01-知识点盘点.md(17335) 与 09-点8-曲线积分.md(17689)
  获一次性豁免、不拆,但再涨即违规;新文件一律不得超 1.3 万
- vector-audit 校验器加 SIZE_EXEMPT:豁免文件走 EXEMPT 而非 WARN,
  同时记下豁免时字数,超过该值仍旧报 WARN
- README 的「一条待处理」改写为「一条已豁免」,写明理由与收紧规则
This commit is contained in:
2026-11-04 09:20:46 +08:00
parent 6efe0b86cd
commit 39408c3e7f
5 changed files with 34 additions and 6 deletions
+6 -2
View File
@@ -41,6 +41,10 @@ cd "D:/考研/第二代数学笔记"
- `inspect_vector_exam_sample.py` 原先用 cwd 相对的 `Path('试卷/...')`,改为 `ROOT` 拼接
- **字符数检查由断言降为警告**。原来 `assert len(text) <= 13000` 一旦超限就中断整个脚本,后面两百多项全不执行;改为记入 `warns`、末尾统一打印。改完跑出 **298 项通过**,其中唯一警告是 `01-知识点盘点.md` 已达 **17335 字符**(超 1.3 万上限)。
## 一条待处理
## 一条已豁免
`01-知识点盘点.md` 17335 字符,超过项目「单文件 ≤ 1.3 万字符」的约定。这是 2026-10-23 21:55 重写时涨上去的(校验脚本 19:47 写好后没再跑,所以 json 里的 180 项是旧快照)。**要不要拆**取决于是否愿意打断「15 个点文件」的编号体系——参照《大题十年考点》的做法,可以把覆盖对照与相邻讲接口拆成 `01b`。目前只记录,未动。
`01-知识点盘点.md` 17335 字符,超过项目「单文件 ≤ 1.3 万字符」的约定。成因是 2026-10-23 21:55 重写时涨上去的(校验脚本 19:47 写好后没再跑,所以 json 里那份 180 项是旧快照)。
**2026-11-04 用户明确:这次允许,下不为例。** 因此本文件不拆——拆会打断「15 个考点文件」的编号体系。脚本里用 `SIZE_EXEMPT` 记了这条豁免,输出走 `EXEMPT:` 而不是 `WARN:`,同时记下豁免时的字数:**以后再涨一样会报 WARN**。
约定收紧的部分:**新增文件一律不得超 1.3 万字符**。真要再加内容,就按第 4 讲的做法把覆盖对照与相邻讲接口拆成 `01b`,`§0.x` 编号保持不动。
@@ -13,6 +13,11 @@ ROOT = Path(__file__).resolve().parents[3]
CHAPTER = ROOT / '基于考研的学习/数学一/在学练习/线性代数-第3讲-向量'
checks = []
warns = []
exempt = []
# 已获豁免的超限文件(2026-11-04 用户批准,仅此一次)。只放这一条,
# 新增的豁免必须单独获得同意;数值写着「不得再涨」,涨了仍会照实打印。
SIZE_EXEMPT = {'01-知识点盘点.md': 17335}
def check(name, value):
assert value, name
@@ -170,8 +175,17 @@ for file in sorted(CHAPTER.glob('*.md')):
check('structure summaries '+file.name, text.count('<summary>') == text.count('</summary>') == text.count('<details>'))
# 字符数上限是项目约定(单文件 ≤ 1.3 万字符)。超限只记警告:它不影响
# 数值与链接的正确性,若直接 assert 会让后面几百项检查全部不执行。
# 2026-11-04 用户明确豁免本讲 01-知识点盘点.md 一次(拆分会打断 15 个考点的
# 编号体系),但**只豁免这一个文件、只此一次**:新文件一律不得超。
if len(text) > 13000:
warns.append('file size %s: %d 字符 > 13000' % (file.name, len(text)))
msg = 'file size %s: %d 字符 > 13000' % (file.name, len(text))
cap = SIZE_EXEMPT.get(file.name)
if cap is None:
warns.append(msg)
elif len(text) > cap:
warns.append(msg + '(豁免时 %d,现又上涨)' % cap)
else:
exempt.append(msg + '(豁免上限 %d)' % cap)
check('structure no replacement chars '+file.name, '\ufffd' not in text)
check('structure math dollar parity '+file.name, text.count('$') % 2 == 0)
for target in re.findall(r'\]\(([^)]+)\)', text):
@@ -180,9 +194,12 @@ for file in sorted(CHAPTER.glob('*.md')):
report = {'passed': len(checks), 'arithmetic': 'fractions.Fraction',
'scope': 'Numerical examples, parameter branches, link and Markdown structure; abstract proofs manually reviewed',
'exempt': exempt,
'warnings': warns,
'checks': checks}
(Path(__file__).resolve().parent / 'vector_learning_checks.json').write_text(json.dumps(report, ensure_ascii=False, indent=2)+'\n', encoding='utf-8')
print(f'PASS: {len(checks)} exact numerical and structural checks')
for w in exempt:
print('EXEMPT:', w)
for w in warns:
print('WARN:', w)
@@ -2,9 +2,10 @@
"passed": 298,
"arithmetic": "fractions.Fraction",
"scope": "Numerical examples, parameter branches, link and Markdown structure; abstract proofs manually reviewed",
"warnings": [
"file size 01-知识点盘点.md: 17335 字符 > 13000"
"exempt": [
"file size 01-知识点盘点.md: 17335 字符 > 13000(豁免上限 17335)"
],
"warnings": [],
"checks": [
"1.1 target",
"1.1 impossible target",