refactor(vault): Phase 3 — metadata convergence

- Backfill `created` frontmatter on 266 active notes (git date or mtime)
- Normalize `status` to 4 values: draft/active/done/archived (11 notes)
  - Active/进行中/needs-review → active
  - archive → archived
  - 待执行/conditional → draft
  - 完成/accepted → done
- Declare clipper boundary: 04_Archive/Inbox-Clippings/** exempt from migration
- Update depth rule: max 3 → max 4 levels (new notes only)
- Add metadata-converge.mjs script for reproducibility
This commit is contained in:
windyboy
2026-09-26 11:37:19 +08:00
parent aff829a1e2
commit b182762e14
263 changed files with 1281 additions and 13 deletions
+4 -1
View File
@@ -20,5 +20,8 @@
## Organization Principles
- Inbox is temporary - process weekly
- One idea per note (atomic notes)
- Flat structure over deep nesting (max 3 levels)
- Flat structure over deep nesting (max 4 levels for new notes)
- Use links not folders for relationships
## Clipper Boundary
- `04_Archive/Inbox-Clippings/**` permanently uses the web clipper schema (`date`/`page-title`/`url`). Never migrate.
+1 -1
View File
@@ -108,7 +108,7 @@ status: draft|active|complete|archived
### Organization
- Inbox is temporary - process weekly
- One idea per note (atomic notes)
- Flat structure over deep nesting (max 3 levels)
- Flat structure over deep nesting (max 4 levels for new notes)
- Use links not folders for relationships
---
+18
View File
@@ -0,0 +1,18 @@
{
"permissions": {
"allow": [
"mcp__plane__list_projects",
"mcp__plane__*",
"Bash(git ls-files -z | git check-ignore -z --no-index --stdin | tr '\\\\0' '\\\\n' | wc -l)",
"Bash(git ls-files -z | git check-ignore -z --no-index --stdin | tr '\\\\0' '\\\\n')",
"Bash(git tag pre-restructure-2026-09-25 2>&1)",
"Bash(git ls-files -z | git check-ignore -z --no-index --stdin | xargs -0 git rm --cached 2>&1)",
"Bash(node .scripts/verify-vault.mjs 2>&1; echo \"EXIT: $?\")",
"Bash(which node || ls /usr/local/bin/node /usr/bin/node ~/.nvm/versions/node/*/bin/node 2>/dev/null | head -3)",
"Bash(find /home/windy -name \"node\" -type f 2>/dev/null | head -5; find /usr -name \"node\" -type f 2>/dev/null | head -5; ls /home/windy/.local/share/fnm/*/bin/node 2>/dev/null | head -3; ls /home/windy/.volta/bin/node 2>/dev/null | head -3)",
"Bash(/home/windy/.config/nvm/versions/node/v24.21.0/bin/node .scripts/verify-vault.mjs 2>&1; echo \"EXIT: $?\")",
"Bash(sed -n '330,346p' .obsidian/plugins/copilot/main.js | head -20)",
"Bash(for f in \"01_Projects/Infrastructure/Services/vaultwarden.md\" \"03_Resources/Development/DevOps/Gitlab/rest api.md\"; do if [ -f \"$f\" ]; then echo \"EXISTS: $f\"; fi; done; find . -path \"*/Virtual-Data-Center/prod.md\" -o -path \"*/Municipal-Development-Reform/production.md\" -o -path \"*/Municipal-Development-Reform/deploy.md\" -o -path \"*/Industry-Info/Deployment.md\" 2>/dev/null)"
]
}
}
+136
View File
@@ -0,0 +1,136 @@
#!/usr/bin/env node
import { execSync } from 'node:child_process'
import { readFileSync, writeFileSync } from 'node:fs'
const DRY_RUN = process.argv.includes('--dry-run')
const SKIP_CREATED = process.argv.includes('--skip-created')
const SKIP_STATUS = process.argv.includes('--skip-status')
const STATUS_MAP = {
active: 'active',
Active: 'active',
archive: 'archived',
'进行中': 'active',
'待执行': 'draft',
'完成': 'done',
'needs-review': 'active',
conditional: 'draft',
accepted: 'done',
}
const PARA_DIRS = ['00_Inbox', '01_Projects', '02_Areas', '03_Resources']
function getActiveNotes() {
const results = []
for (const dir of PARA_DIRS) {
try {
const out = execSync(`find ${dir} -name '*.md' -type f`, { encoding: 'utf8' })
results.push(...out.split('\n').filter(Boolean))
} catch { /* dir may not exist */ }
}
return results
}
function getGitCreatedDate(filepath) {
try {
const out = execSync(
`git log --follow --format=%ai -- "${filepath}" | tail -1`,
{ encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }
).trim()
if (out) return out.split(' ')[0]
} catch { /* no git history */ }
return null
}
function getFileMtime(filepath) {
try {
const out = execSync(`stat -c %Y "${filepath}"`, { encoding: 'utf8' }).trim()
const d = new Date(parseInt(out) * 1000)
return d.toISOString().split('T')[0]
} catch {
return null
}
}
function parseFrontmatter(content) {
if (!content.startsWith('---\n')) return null
const end = content.indexOf('\n---', 4)
if (end === -1) return null
const fmText = content.slice(4, end)
const lines = fmText.split('\n')
const fm = {}
for (const line of lines) {
const m = line.match(/^([a-zA-Z_-]+):\s*(.*)$/)
if (m) fm[m[1]] = m[2]
}
return { fm, fmText, end }
}
let createdCount = 0
let statusCount = 0
let noFrontmatterCount = 0
const notes = getActiveNotes()
console.log(`Scanning ${notes.length} active notes...`)
for (const filepath of notes) {
const content = readFileSync(filepath, 'utf8')
const parsed = parseFrontmatter(content)
if (!parsed) {
if (!SKIP_CREATED) {
const date = getGitCreatedDate(filepath) || getFileMtime(filepath)
if (date) {
createdCount++
if (DRY_RUN) {
console.log(` +frontmatter: ${filepath} (created: ${date})`)
} else {
const newContent = `---\ncreated: ${date}\n---\n${content}`
writeFileSync(filepath, newContent, 'utf8')
}
}
} else {
noFrontmatterCount++
}
continue
}
const { fm, fmText, end } = parsed
let newFmText = fmText
let changed = false
if (!SKIP_CREATED && !fm.created) {
const date = getGitCreatedDate(filepath) || getFileMtime(filepath)
if (date) {
newFmText = `created: ${date}\n${newFmText}`
createdCount++
changed = true
if (DRY_RUN) console.log(` +created: ${filepath} (${date})`)
}
}
if (!SKIP_STATUS && fm.status) {
const rawStatus = fm.status.replace(/^["']|["']$/g, '').trim()
const normalized = STATUS_MAP[rawStatus]
if (normalized && normalized !== rawStatus) {
newFmText = newFmText.replace(
new RegExp(`^status:\\s*${rawStatus.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*$`, 'm'),
`status: ${normalized}`
)
statusCount++
changed = true
if (DRY_RUN) console.log(` ~status: ${filepath} (${rawStatus} → ${normalized})`)
}
}
if (changed && !DRY_RUN) {
const newContent = `---\n${newFmText}${content.slice(end)}`
writeFileSync(filepath, newContent, 'utf8')
}
}
console.log(`\n--- ${DRY_RUN ? 'DRY RUN' : 'APPLIED'} ---`)
console.log(`Notes without frontmatter (skipped): ${noFrontmatterCount}`)
console.log(`created added: ${createdCount}`)
console.log(`status normalized: ${statusCount}`)
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-07
---
# 2026-01-07
## Capture
+3
View File
@@ -1,3 +1,6 @@
---
created: 2025-09-13
---
# {{date:YYYY-MM-DD}}
## Capture
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-26
---
<claude-mem-context>
# Recent Activity
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-02-24
---
# 改进计划(基于评审意见,排除 CLAUDE-BOOTSTRAP.md 相关问题)
**计划日期**: 2026-02-03
+3
View File
@@ -1,3 +1,6 @@
---
created: 2025-09-13
---
# 📥 Inbox
Your capture zone for new ideas, quick thoughts, and unprocessed information.
+1 -1
View File
@@ -5,7 +5,7 @@ tags:
- inbox
- security
- credentials
status: needs-review
status: active
---
# 2026-03-16
+3
View File
@@ -1,3 +1,6 @@
---
created: 2025-09-13
---
# Welcome to Your AI-Powered Second Brain
This is your Inbox - a temporary landing zone for new ideas, quick captures, and daily thoughts.
@@ -1,3 +1,6 @@
---
created: 2025-09-13
---
# {{date:YYYY-MM-DD}}
## Capture
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-04-10
---
# 2026-04-03
## Capture
@@ -1,4 +1,5 @@
---
created: 2026-09-11
tags:
- 家居/智能马桶
- 使用说明
@@ -1,3 +1,6 @@
---
created: 2026-08-08
---
根据该视频(由知名 AI 战略博主 **Nate B Jones** 制作)的核心内容,以下为您整理一份详细的文字整理与架构解析。
视频主要探讨了在 OpenAI、Anthropic、Google 等巨头频繁更新、不断“杀死”创业公司和套壳产品的背景下,AI 建设者(Builders)应当如何定位自己。作者将 AI 建设者划分为三个级别,并指出了如何从被动挨打的“1级建设者”晋升为具备护城河的“3级建设者”。
+1
View File
@@ -1,4 +1,5 @@
---
created: 2026-04-10
title: zeroclaw
---
# # zeroclaw
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
global:
```
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
go-casstm
@@ -1,3 +1,6 @@
---
created: 2026-08-17
---
# Matrix 设备认证(SAS)— 知识沉淀
> 本文档是 `ha-matrix-e2e`(`custom_components/matrix_e2ee`,基于 matrix-nio 0.26.0 + vodozemac)在
@@ -1,7 +1,8 @@
---
created: 2025-09-13
title: Obsidian Agent Refactor
date: 2026-01-10
status: Active
status: active
---
# Obsidian Agent Refactor
@@ -1,4 +1,5 @@
---
created: 2026-02-26
kanban-plugin: board
---
@@ -1,8 +1,9 @@
---
created: 2026-02-26
title: 重构计划
date: 2026-02-26
based-on: "[[review-2026-02-26]]"
status: 待执行
status: draft
---
# 重构计划
@@ -1,9 +1,10 @@
---
created: 2026-02-26
title: 重构任务清单
date: 2026-02-26
based-on: "[[refactor-plan]]"
kanban-board: "[[refactor-board]]"
status: 进行中
status: active
---
# 重构任务清单
@@ -1,8 +1,9 @@
---
created: 2026-02-26
title: 代码审查报告
date: 2026-02-26
reviewer: Claude Sonnet 4.6
status: 完成
status: done
---
# 代码审查报告(2026-02-26)
@@ -1,4 +1,5 @@
---
created: 2026-02-26
title: 运行状态
updated: 2026-02-25
---
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
caastm dashboard:
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# windy-ai
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-26
---
<claude-mem-context>
# Recent Activity
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
login by wexin qrcode
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```
https://95598.csg.cn/ucs/ma/wt/center/loginByPwdAndMsg
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
api key:
```
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
mysql:
```sql
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
---
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
ewelink token:
```
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```python
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
api key:
```
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
### **什么是 Matter Thread Border Router?**
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
login with google windyboy
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
To flash the Sonoff ZBDongle-E, follow these detailed steps using the web-based flashing tool. This guide assumes you want to enable the device for use with Zigbee and potentially Thread functionalities.
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```sql
CREATE DATABASE hass;
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
Yes, **pgloader** can work with a **MySQL dump file**, but it is not the most common or optimal way to use pgloader. By default, pgloader is designed to connect directly to the MySQL or MariaDB database and migrate the schema and data to PostgreSQL in one seamless operation. However, it does have support for importing data from SQL dump files.
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
windy-esp
key
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
token:
```
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
tuya local
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
default user: homeassistant
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```
sudo doveadm pw -s BLF-CRYPT
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
ip :
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
icloud mail app password:
thunderbird
Your app-specific password is:
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# 电源
## 通用DC电源
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
config:
```
set firewall all-ping enable
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```
route "192.168.0.0 255.255.0.0"
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
ssh account
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# 狗狗加速
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
https://ausu.autos?uuid=2fb14704-2b87-4f46-a073-2b8828b5e6e9&hmac=04b55a908b662a860b203469a3fade19034a93c6fe8c26d8a9c671077950a771
@@ -1,3 +1,6 @@
---
created: 2026-01-26
---
<claude-mem-context>
# Recent Activity
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
postgresql:
dendrite/windyboy2006
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
打开http://192.168.1.1直接用超级管理员账户telecomadmin 密码nE7jA%5m登录;
@@ -1,3 +1,6 @@
---
created: 2025-09-13
---
# {{title}}
## Project Overview
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# Matrix ESS (Community) — Single‑Node Install on Debian 13 (K3s + Traefik + cert‑manager)
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
docker compose
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
docker compose
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
version: '3'
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
## dns.windy.lan
domain: dns.windy.lan
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# 🌀 从 Slave 节点恢复 PowerDNS Authoritative 主节点(5.0.0 + PostgreSQL)
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
gzzn:
410 456 544
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
````markdown
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
service key:
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
## Docker + firewalld + iptables 关系总结
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
恩山:
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
🎉 **Success!**
Your boot time improved from **39 seconds → 9 seconds** — that’s a **~77% speed increase**. 🚀
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
重要提示【小文件多的不能使用】
一年卡号:42cb7b36a5ded34
下载地址:https://wwxx.lanzouw.com/D88
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
mount point:
/mnt/tank/Downloads
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
1、下载简体中文正式版
zh-cn_windows_11_enterprise_ltsc_2024_x64_dvd_cff9cd2d.iso
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
自制精简优化Windows 10 LTSC2021简体中文版
—————————————————————————————————————————
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# {{title}}
## Project Overview
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
+3
View File
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
### Powerdns
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
# Install
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
```
version: "3.8"
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
api:
secret_WggiGblW3PayQXirTeOCrS9FTsQ5EWGWHjInmNcvJdv
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
Here is the **definitive, consolidated guide** for setting up Playwright on **Arch Linux (WSL)**.
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
变量隐藏 [[Scope and Shadowing - Rust By Example]]
@@ -1,3 +1,6 @@
---
created: 2026-01-05
---
To set up **Oh My Posh** with **Zsh** on **Debian 12**, follow these steps to install the necessary components and configure your terminal prompt.
@@ -1 +1,4 @@
---
created: 2026-01-05
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-26
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---
@@ -1,4 +1,5 @@
---
created: 2026-08-24
type: project
status: active
---

Some files were not shown because too many files have changed in this diff Show More