Two KB build fixes on telep-mainframe. (1) build_content.py auto-discovered every dir under manuals-src/docs — including *.bak* backup dirs — and served ~1646 stale pages live. (2) FSM diagram images restored to 20 kick-fix/tsb legend pages by rendering the source PDFs, because the crops were never captured on ingest. Content root ~/knowledgebase/manuals-src/docs.

1. Backup dirs leaked into the site

Content-tree backup dirs must be excluded from discovery

build_content.py discovered ALL directories under manuals-src/docs, including backups like kick-fix.bak-linkrewrite and other *.bak* dirs. Result: ~1646 stale pages (of 4566 total) were served on the LIVE site — duplicate/outdated content polluting nav and search.

Fix

Add a list_manuals() helper to build_content.py that excludes any directory name containing .bak, and route discovery through it instead of a raw glob of manuals-src/docs.

Lesson

When you keep backup copies inside the content tree (the session’s own convention: *.bak-orphanfix, kick-fix.bak-linkrewrite, etc.), the site builder’s directory auto-discovery will happily serve them. Any content-tree walker must filter .bak (or backups must live outside the content root).

2. TSB diagram images restored

For Agents

20 kick-fix/tsb legend pages were missing their FSM diagram images — the image crops were never captured during ingest. Restored by rendering the source PDFs with pdftoppm to regenerate the diagram images for those pages.

This complements the wiring-gallery native-res crop work in 2026-08-06-kb-wiring-gallery-native-res-fix-and-astro-caching — both are cases where an ingest step dropped image data that had to be re-derived from source.