Phase 0-2: Schema cleanup, typed relations, event-driven automation

- Phase 0: AGENTS.md cleanup (dedup quotes, renumber sections, merge qmd)
- Phase 1: typed relations (manage-relations.py, graph-search.py, check-staleness.py, detect-conflicts.py)
- Phase 2: frontmatter validator, weekly lint, knowledge promotion, git hooks
- Fix .gitignore to track tools/ and .githooks/
- Fix git remote URL (remove plaintext token)
- New wiki pages: 504 pages, 34 raw sources
This commit is contained in:
hehaiguang1123
2026-07-01 08:05:43 +08:00
parent e544d6e04a
commit a6f05ab2d5
1067 changed files with 522992 additions and 819 deletions
+49
View File
@@ -0,0 +1,49 @@
<#
.SYNOPSIS
每周 Wiki Lint:孤儿 + 断链 + 时效 + 矛盾 + index 同步
.DESCRIPTION
聚合所有 lint 脚本,输出报告到 tools/data/lint-reports/YYYY-MM-DD.log
配合 Windows 定时任务使用:每周日 22:00
#>
$ErrorActionPreference = "Continue"
$env:PYTHONIOENCODING = "utf-8"
$vaultRoot = "D:\Applications\app\kepano-obsidian-main"
$reportDir = "$vaultRoot\tools\data\lint-reports"
$today = Get-Date -Format "yyyy-MM-dd"
$logFile = "$reportDir\$today.log"
# 创建报告目录
New-Item -ItemType Directory -Path $reportDir -Force | Out-Null
"=== Weekly Lint Report — $today ===" | Out-File -FilePath $logFile -Encoding utf8
"=" * 40 | Out-File -FilePath $logFile -Encoding utf8 -Append
# 1. Orphan detection
"`n=== 1. Orphan Pages ===" | Out-File -FilePath $logFile -Encoding utf8 -Append
$orphans = & "$vaultRoot\tools\scripts\wiki-lint-orphan.ps1" 2>&1
$orphans | Out-File -FilePath $logFile -Encoding utf8 -Append
# 2. Broken links
"`n=== 2. Broken Links ===" | Out-File -FilePath $logFile -Encoding utf8 -Append
$broken = & "$vaultRoot\tools\scripts\wiki-lint-broken-v2.ps1" 2>&1
$broken | Out-File -FilePath $logFile -Encoding utf8 -Append
# 3. Staleness
"`n=== 3. Staleness ===" | Out-File -FilePath $logFile -Encoding utf8 -Append
$staleness = python "$vaultRoot\tools\scripts\check-staleness.py" 2>&1
$staleness | Out-File -FilePath $logFile -Encoding utf8 -Append
# 4. Conflicts
"`n=== 4. Conflicts ===" | Out-File -FilePath $logFile -Encoding utf8 -Append
$conflicts = python "$vaultRoot\tools\scripts\detect-conflicts.py" 2>&1
$conflicts | Out-File -FilePath $logFile -Encoding utf8 -Append
# 5. Frontmatter validation
"`n=== 5. Frontmatter Validation ===" | Out-File -FilePath $logFile -Encoding utf8 -Append
$validation = python "$vaultRoot\tools\scripts\validate-frontmatter.py" 2>&1
$validation | Out-File -FilePath $logFile -Encoding utf8 -Append
# Summary
"`n$('=' * 40)" | Out-File -FilePath $logFile -Encoding utf8 -Append
"Report saved: $logFile" | Out-File -FilePath $logFile -Encoding utf8 -Append
Write-Output "Weekly lint complete: $logFile"