Skip to content

fix(docs): auto-discover API classes, fix FastPlot rename drift#169

Merged
HanSur94 merged 1 commit into
mainfrom
claude/dreamy-matsumoto-decfdd
May 29, 2026
Merged

fix(docs): auto-discover API classes, fix FastPlot rename drift#169
HanSur94 merged 1 commit into
mainfrom
claude/dreamy-matsumoto-decfdd

Conversation

@HanSur94
Copy link
Copy Markdown
Owner

What & why

scripts/generate_api_docs.py built the wiki API reference from hand-maintained class lists that had bitrotted — they named classes that no longer exist (Sensor, ThresholdRule, EventDetector, FastSenseFigure) after the Tag/FastPlot refactors. Separately, the project's FastSense → FastPlot rename left _Sidebar.md pointing at a frozen orphan (API-Reference:-FastPlot.md) while the generator refreshed an unlinked API-Reference:-FastSense.md.

Changes

  • Auto-discovery, not hand lists. Completeness now comes entirely from scanning each library directory. The per-page lists became short ordering anchors — a stale anchor is silently skipped, so it can never drop or duplicate a real class. Immune to class renames going forward.
  • FastPlot rename alignment. The main API page is now emitted as API-Reference:-FastPlot.md, matching the sidebar/brand.
  • Self-cleaning orphans. prune_stale_api_pages() removes any API-Reference: page carrying this generator's banner that it no longer produces (auto-pruned the orphaned API-Reference:-FastSense.md). Manual pages like Themes (no banner) and generate_wiki.py-owned pages (different banner) are untouched.
  • Inverse-drift warning when a scanned library has classdefs but no page mapping.
  • CLAUDE.md: corrected stale anthropic/ANTHROPIC_API_KEYopenai/OPENROUTER_API_KEY (the wiki generator calls OpenRouter).

Verification

Ran python3 scripts/generate_api_docs.py (exit 0):

  • Sensors page now documents the real Tag → SensorTag → MonitorTag → … family; zero phantom headings.
  • API-Reference:-FastSense.md auto-pruned; Themes.md untouched.
  • Re-running is idempotent.

Note: merging triggers sync-wiki.yml (mirrors wiki/ to the FastSense.wiki repo) and wiki-links.yml, as intended.

🤖 Generated with Claude Code

generate_api_docs.py no longer relies on hand-maintained class lists,
which had bitrotted with phantom classes (Sensor, ThresholdRule,
EventDetector, FastSenseFigure) after the Tag/FastPlot refactors.
Completeness now comes from directory discovery; the per-page lists are
ordering-only anchors that cannot drop or duplicate a real class.

- Rename the main API page FastSense -> FastPlot to match _Sidebar.md and
  the project brand; the run auto-prunes the now-orphaned FastSense page
- Add prune_stale_api_pages(): safely removes API-Reference pages bearing
  this generator's banner that it no longer produces (manual pages and
  generate_wiki.py-owned pages are untouched)
- Warn when a scanned library has classdefs but no page mapping
- CLAUDE.md: correct stale anthropic/ANTHROPIC_API_KEY references to
  openai/OPENROUTER_API_KEY (generate_wiki.py calls the OpenRouter API)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HanSur94 HanSur94 merged commit c80c932 into main May 29, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant