diff --git a/lib/lint.sh b/lib/lint.sh index 077f1e9..e38b996 100644 --- a/lib/lint.sh +++ b/lib/lint.sh @@ -6,6 +6,9 @@ # Valid values for the 'type' frontmatter field. # Must stay in sync with the type list in templates/agents-genome.md. +# Note: 'index' and 'log' are wiki-level singleton files (wiki/index.md, wiki/log.md). +# 'conflict' has no dedicated scaffold directory — it is a cross-cutting type +# that can live under any wiki/ subdirectory. VALID_TYPES=("source" "entity" "concept" "query" "conflict" "private" "index" "log") # --------------------------------------------------------------------------- @@ -121,7 +124,7 @@ check_knowledge_decay() { # Parse date — handle both GNU date (Linux) and BSD date (macOS) local updated_ts - if date --version &>/dev/null 2>&1; then + if date --version >/dev/null 2>&1; then # GNU date updated_ts=$(date -d "$last_updated" +%s 2>/dev/null) else @@ -161,7 +164,7 @@ check_broken_links() { # Extract link targets, stripping aliases: [[Link|Alias]] -> Link local links - links=$(grep -oP '\[\[\K[^\]]+' "$file" 2>/dev/null | cut -d'|' -f1) + links=$(grep -oE '\[\[[^\]]+' "$file" 2>/dev/null | sed 's/^\[\[//' | cut -d'|' -f1) for link in $links; do local target="$link"