maintain | 2026-08-07 机制固化(frontmatter 字段审计强制 + 月度回顾归档提醒)+ 18 页补 last_updated

This commit is contained in:
AAsige
2026-08-07 17:35:48 +08:00
parent 87f8143db0
commit f1c7036c33
21 changed files with 56 additions and 1 deletions
+29
View File
@@ -69,6 +69,28 @@ foreach ($page in $pages) {
}
$text = [IO.File]::ReadAllText($page.FullName)
# frontmatter 必填字段(schema 第 3 节:title/type/last_updated/tags/confidence
# 导航页整体豁免(走导航 frontmatter 约定),raw_sources 另对 query 页豁免)
$fmMatch = [regex]::Match($text, '(?s)^---\r?\n(.*?)\r?\n---')
if ($fmMatch.Success) {
$fmText = $fmMatch.Groups[1].Value
$isNavPage = $page.Name -in @('INDEX.md', 'Glossary.md', 'sources.md', '期货研究资料目录.md', '期货资料来源与证据边界.md')
if (-not $isNavPage) {
foreach ($field in @('title', 'type', 'last_updated', 'tags', 'confidence')) {
if (-not [regex]::IsMatch($fmText, "(?m)^$field\s*:")) {
Add-Warning "missing frontmatter field '$field' in $($page.FullName)"
}
}
}
$isQueryPage = [regex]::IsMatch($fmText, '(?m)^type:\s*query')
if (-not $isQueryPage -and -not $isNavPage) {
if (-not [regex]::IsMatch($fmText, '(?m)^raw_sources\s*:')) {
Add-Warning "missing raw_sources field in $($page.FullName)"
}
}
}
foreach ($match in [regex]::Matches($text, '\[\[([^\]|#]+)(?:#[^\]|]+)?(?:\|[^\]]+)?\]\]')) {
$target = $match.Groups[1].Value.Trim()
if (-not $byBaseName.ContainsKey($target)) {
@@ -137,6 +159,13 @@ if (Test-Path -LiteralPath $State -PathType Leaf) {
Add-Error "compile-results.tsv does not exist: $State"
}
# 月度回顾页积累提醒(schema 第 7 节时序内容约定:满 3 页应归档最早为历史层)
$reviewPages = @($pages | Where-Object { $_.BaseName -match '20\d{2}年\d{1,2}月市场回顾$' })
if ($reviewPages.Count -ge 3) {
$reviewNames = ($reviewPages | Sort-Object Name | ForEach-Object { $_.BaseName }) -join '、'
Add-Warning "月度回顾页已积累 $($reviewPages.Count) 页($reviewNames);按 schema 时序内容约定应归档最早页面为历史层(status: historical)并由季度/年度综述承接"
}
$allTextFiles = @(Get-ChildItem -LiteralPath $Root -Recurse -File -Include '*.md', '*.tsv', '*.log' -ErrorAction SilentlyContinue)
$deletedSourceRefs = @()
foreach ($file in $allTextFiles) {
+2 -1
View File
@@ -169,13 +169,14 @@ pwsh -File .\tools\wiki-audit.ps1
必须确认:
- frontmatter 完整;
- frontmatter 完整(必填字段 `title`/`type`/`last_updated`/`tags`/`confidence`,导航页整体豁免;`raw_sources` 对导航页与 `type: query` 页豁免,缺字段报 WARNING
- Wiki 内部链接无断链;
- 图片路径存在;
- INDEX 覆盖全部内容页;
- `raw_sources` 路径存在;
- `compile-results.tsv` 可解析、无重复来源行和占位哈希;
- 用户主动删除的来源没有活动派生引用;
- 月度回顾页(`20xx年N月市场回顾` 命名)积累满 3 页时审计输出归档 WARNING(按第 7 节时序内容约定归档最早页面为历史层);
- `git diff --check` 通过。
超长页面检查默认以 200 行为阈值;经人工确认确实需要保留完整结构的页面,可通过 `tools/wiki-audit.ps1``$LongPageAllowlist` 白名单豁免。当前白名单包含:`Glossary.md``INDEX.md`(唯一总入口与阅读地图,需完整列出全部内容页,2026-08-07 加入)、`concepts/Harness-Engineering-Complete-Guide.md``concepts/Meta-Harness.md``practices/OpenAI-Codex-Harness-Engineering.md``queries/What-is-Harness-Engineering-in-Simple-Terms.md`。白名单只抑制超长页面警告,不豁免 frontmatter、链接、图片、来源路径或编译状态检查。
+7
View File
@@ -416,3 +416,10 @@
- D 第二批:62 个 contested 页面逐页信号核验——全部为 A 类(标注完整:均有版本/年份/时点/核验声明,页面定位明确证据边界),B 类(需补标注)0、C 类(可疑)0,维持不变。累计 20 low_confidence + 62 contested 全部核验完成,无页面需升级/降级。
- 顺带修复 frontmatter 合规:23 处。利弗莫尔交易纪律 type=practices→practice22 个 llm-wiki 初始批次页面补 type14 concept / 8 practice / 1 query)与 confidence: mediumpaddleocr-ocr工具链 sources 键改名 raw_sources 并补 last_updated(初插位置破坏 YAML 结构,已修复并全库 PyYAML 校验通过)。
- 验证:wiki-audit.ps1 normal + strict 双绿(0 ERROR / 0 WARNING);reflect missing_role=0 保持;97 页 frontmatter 全部 YAML 可解析。
## [2026-08-07] maintain | 机制固化:frontmatter 字段强制 + 月度回顾归档提醒
- wiki-audit.ps1 新增两条硬检查:(1) 非导航页 frontmatter 必填 title/type/last_updated/tags/confidence(导航页整体豁免,raw_sources 另对 type:query 页豁免),缺失报 WARNING;(2) 命名匹配 20xx年N月市场回顾 的页面满 3 页时输出归档 WARNING(按 schema 第 7 节时序内容约定)。
- 新检查首跑暴露 27 条 WARNING:3 个导航页被误查(已改豁免)+18 页缺 last_updated(已批量补 2026-08-07),修复后 normal+strict 双绿。
- 临时探针验证(mini wiki):3 个回顾页触发归档提醒且列出名称、缺字段页精确报 2 条缺失、无回顾页误报、normal exit 0 / strict exit 1——行为全部正确。
- WIKI-SCHEMA.md 第 8 节检查清单同步更新;wiki-compilation-verification 技能已固化两条仓库约定。
@@ -1,5 +1,6 @@
---
title: "商品市场金融化与库存套利"
last_updated: 2026-08-07
source: "raw/期货/00-整体相关/交易的世界-第三章至结论.md"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "商品超级周期与交易商资产化"
last_updated: 2026-08-07
source: "raw/期货/00-整体相关/交易的世界-第三章至结论.md"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "大宗商品交易商与石油市场权力"
last_updated: 2026-08-07
source: "raw/期货/00-整体相关/交易的世界-第二章-石油教父.md"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "股票市场周期与大势判断:作者体系及验证边界"
last_updated: 2026-08-07
source: "胡斐,《股票投资要义》,经济管理出版社,2015 年 6 月第 1 版"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "铸造铝合金与 ADC12 产业链、废铝成本及需求"
last_updated: 2026-08-07
source: "铝行业研讨学习(周彦希)"
created: 2026-08-03
updated: 2026-08-03
@@ -1,5 +1,6 @@
---
title: "阿布量化(ABuQuant)框架架构"
last_updated: 2026-08-07
source: "https://github.com/bbfamily/abu (commit d602d847677e4c2b77b0a122df30816ea68b5710)"
created: 2026-08-07
updated: 2026-08-07
@@ -1,5 +1,6 @@
---
title: "大宗商品交易政治风险与合规"
last_updated: 2026-08-07
source: "raw/期货/00-整体相关/交易的世界-第三章至结论.md"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "技术分析形态与突破确认"
last_updated: 2026-08-07
source: "技术分析图教学材料"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "期货基本分析逻辑"
last_updated: 2026-08-07
source: "raw/期货/01-基本分析逻辑/期货基本分析逻辑.md"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "期货量化回测与位移路程比"
last_updated: 2026-08-07
source: "https://github.com/bbfamily/abu (commit d602d847677e4c2b77b0a122df30816ea68b5710)"
created: 2026-08-07
updated: 2026-08-07
@@ -1,5 +1,6 @@
---
title: "股票交易系统与技术分析:趋势、MACD和买卖点"
last_updated: 2026-08-07
source: "胡斐,《股票投资要义》,经济管理出版社,2015 年 6 月第 1 版"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "股票交易纪律与资金管理:从作者经验到可检验流程"
last_updated: 2026-08-07
source: "胡斐,《股票投资要义》,经济管理出版社,2015 年 6 月第 1 版"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "股票基本面与筹码选股:作者框架和可观测指标"
last_updated: 2026-08-07
source: "胡斐,《股票投资要义》,经济管理出版社,2015 年 6 月第 1 版"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "《股票投资要义》:周期、筹码与交易纪律"
last_updated: 2026-08-07
source: "胡斐,《股票投资要义》,经济管理出版社,2015 年 6 月第 1 版"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "阿布量化策略开发与回测"
last_updated: 2026-08-07
source: "https://github.com/bbfamily/abu (commit d602d847677e4c2b77b0a122df30816ea68b5710)"
created: 2026-08-07
updated: 2026-08-07
@@ -1,5 +1,6 @@
---
title: "用通俗易懂的方式理解 Harness 工程"
last_updated: 2026-08-07
type: query
confidence: medium
source: "WikiLLM Q&A"
+1
View File
@@ -1,5 +1,6 @@
---
title: "期货研究资料目录"
last_updated: 2026-08-07
source: "raw/期货/README.md"
created: 2026-08-02
updated: 2026-08-02
@@ -1,5 +1,6 @@
---
title: "期货资料来源与证据边界"
last_updated: 2026-08-07
source: "期货研究资料目录迁移与来源登记"
created: 2026-08-02
updated: 2026-08-02