Adds the last two deterministic Stage 1 checks and wires them into
scripts/librarian.sh:
- librarian_check_stale_plans.py: per docs/plans/*.md, uses
`git log -1 --format=%cs` to get the last commit date and flags
plans untouched in 60+ days. Plans should be either active or
archived; long silence is drift.
- librarian_check_memory_drift.py: validates the user-memory dir
(~/.claude/projects/<slug>/memory). Each MEMORY.md index line
must point at a real file with frontmatter (name, description,
type ∈ {user, feedback, project, reference}); no orphaned memory
files. Memory dir is derived from repo root for portability.
Both run clean against current state.
Stage 1 declared complete. Promotable-archive and duplicate-prose
detection are moved to Stage 2 in the plan because both need LLM
judgment to avoid false positives — not pattern matching.
Next concrete step is the open Stage 1 finding from yesterday:
docs/performance.md at 914 lines, due for a split into sub-topic
notes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
49 lines
1.1 KiB
Bash
Executable File
49 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run all librarian Stage 1 checks. Exit code is non-zero if any check
|
|
# failed; each check still runs even if a previous one failed, so users
|
|
# see every finding in one pass.
|
|
|
|
set -uo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
overall=0
|
|
|
|
echo "→ Markdown link integrity (lychee)"
|
|
if ! uv run python scripts/librarian_check_links.py; then
|
|
overall=1
|
|
fi
|
|
echo
|
|
|
|
echo "→ Code citations (file:line refs in inline code)"
|
|
if ! uv run python scripts/librarian_check_citations.py; then
|
|
overall=1
|
|
fi
|
|
echo
|
|
|
|
echo "→ File size (500-line soft cap from AGENTS.md)"
|
|
if ! uv run python scripts/librarian_check_oversize.py; then
|
|
overall=1
|
|
fi
|
|
echo
|
|
|
|
echo "→ Stale plans (no commit in 60 days)"
|
|
if ! uv run python scripts/librarian_check_stale_plans.py; then
|
|
overall=1
|
|
fi
|
|
echo
|
|
|
|
echo "→ MEMORY.md drift (index vs frontmatter)"
|
|
if ! uv run python scripts/librarian_check_memory_drift.py; then
|
|
overall=1
|
|
fi
|
|
echo
|
|
|
|
if [ "$overall" -eq 0 ]; then
|
|
echo "All Stage 1 checks passed."
|
|
else
|
|
echo "One or more Stage 1 checks failed (see above)."
|
|
fi
|
|
|
|
exit "$overall"
|