feat(daemon-beta t2): template 代裝——embed v1.18.0 快照(36檔)/冪等不覆寫/daemon 啟動自動鋪/template-install 子命令;scan 加 SkipDirNames 防 system-dev 與 CLAUDE.md 被當知識掃
- 測試 3 支新增全綠(首鋪/冪等護用戶檔/掃描跳 template 產物——第三支先紅抓到 CLAUDE.md 洩入再修綠) - CLI 實跑:新鋪 36 檔→重跑 0 新檔(冪等證據)
This commit is contained in:
@@ -60,6 +60,9 @@ type ScanOptions struct {
|
||||
MaxRemovedRatio float64
|
||||
// SkipPaths:絕對路徑黑名單(如 manifest 檔自己住在 root 底下時)。
|
||||
SkipPaths map[string]bool
|
||||
// SkipDirNames:目錄名黑名單(任一層命中整棵跳過)。daemon-beta task 2:
|
||||
// template 代裝後 `system-dev/`(wiki 產物區)不得被當成原稿掃進 ingest。
|
||||
SkipDirNames map[string]bool
|
||||
}
|
||||
|
||||
const DefaultMaxRemovedRatio = 0.4
|
||||
@@ -108,6 +111,9 @@ func Scan(root string, m *Manifest, opts ScanOptions) (*TriggerPayload, error) {
|
||||
if p != root && strings.HasPrefix(name, ".") {
|
||||
return filepath.SkipDir // 隱藏目錄(.git、.obsidian…)整棵跳過
|
||||
}
|
||||
if p != root && opts.SkipDirNames[name] {
|
||||
return filepath.SkipDir // 名單目錄(system-dev…)整棵跳過
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(name, ".") {
|
||||
|
||||
Reference in New Issue
Block a user