Add librarian Stage 1 oversize check

Third Stage 1 piece: scripts/librarian_check_oversize.py walks
non-archive markdown files and flags any over the 500-line soft cap
declared in AGENTS.md. Wired into scripts/librarian.sh.

Caught one real finding on first run: docs/performance.md at 914
lines. Splitting it into sub-topic notes is a separate cleanup task
— surfaced for the user, not auto-applied.

Updates docs/plans/librarian.md Progress + sets the next concrete
step to a stale-plan checker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-07 23:31:37 +09:00
co-authored by Claude Opus 4.7
parent 0b363b5031
commit 5a1b944931
3 changed files with 109 additions and 5 deletions
+11 -5
View File
@@ -134,6 +134,13 @@ operator applies the patch.
- ✅ Stage 1 orchestrator: `scripts/librarian.sh`. Runs every Stage 1
check in order, aggregates exit code, prints findings inline. Single
entry point for users and (future) cron.
- ✅ AGENTS.md mentions `scripts/librarian.sh` as the doc-lint entry
point in "Notes For Future Agents" (commit `0b363b5`).
- ✅ Stage 1, piece 3: `scripts/librarian_check_oversize.py`. Flags
any non-archive markdown file over the 500-line soft cap declared
in AGENTS.md. Caught one real finding on first run:
`docs/performance.md` at 914 lines — split into sub-topics deferred
as a separate task.
## Stage 1 Remaining Checks
@@ -142,11 +149,10 @@ operator applies the patch.
judgment is the open question).
- MEMORY.md drift (index lines vs target file `description:` frontmatter).
- Duplicate prose (high-overlap pairs across archive vs research).
- Oversize files (>500-line soft cap from AGENTS.md).
## Next Concrete Step
Mention `scripts/librarian.sh` in AGENTS.md so agents and humans know
it exists as the canonical Stage 1 entry point. After that, pick one
of the remaining checks above to add as the next checker (oversize
files is the cheapest; stale plans is the most useful).
Stale plan check (`scripts/librarian_check_stale_plans.py`). Walks
`docs/plans/*.md` and flags files whose mtime is older than N days
AND whose path hasn't appeared in `git log` over the same window.
This catches plans that drift out of mind without being archived.