perf: eliminate 20MB feat HTML bloat, unify index loading, and pure tree striping #54

Merged
clanker merged 1 commit from perf/consolidate-and-fix-bloat into main 2026-09-02 17:32:36 +00:00
Member

Overview

  • Fix Feat HTML Bloat (12.85 MB eliminated): Fixed build_feats container lookup bug in scripts/core/sphere_engine.py that was capturing entire Wikidot tab containers into individual feat cards.
  • Card Sanity Check: Added check #2 to scripts/audit.py to detect leaked tab markup and enforce 100KB sanity bounds.
  • Prune Dead Shims: Removed legacy wrapper scripts parse_all_combat_spheres.py, parse_all_magic_spheres.py, and parse_all_skill_spheres.py.
  • Unified Search & Preview Index Loader: Created src/utils/searchIndex.ts with in-flight deduplication and memory cache. Both useLinkPreview.ts, CommandPalette.tsx, and NotebookPage share a single fetch of /search-index.json, saving 5.4 MB per session.
  • Pure Notebook Row Striping & O(1) Lookups: Replaced mutating render ref in NotebookPage with a pure visibleIndexMap, and added byHash map for O(1) item resolution.
  • Documentation: Fully overhauled .agent with current scripts, architecture, audit checks, and lessons learned.
### Overview - **Fix Feat HTML Bloat (12.85 MB eliminated)**: Fixed `build_feats` container lookup bug in `scripts/core/sphere_engine.py` that was capturing entire Wikidot tab containers into individual feat cards. - **Card Sanity Check**: Added check #2 to `scripts/audit.py` to detect leaked tab markup and enforce 100KB sanity bounds. - **Prune Dead Shims**: Removed legacy wrapper scripts `parse_all_combat_spheres.py`, `parse_all_magic_spheres.py`, and `parse_all_skill_spheres.py`. - **Unified Search & Preview Index Loader**: Created `src/utils/searchIndex.ts` with in-flight deduplication and memory cache. Both `useLinkPreview.ts`, `CommandPalette.tsx`, and `NotebookPage` share a single fetch of `/search-index.json`, saving 5.4 MB per session. - **Pure Notebook Row Striping & O(1) Lookups**: Replaced mutating render ref in `NotebookPage` with a pure `visibleIndexMap`, and added `byHash` map for O(1) item resolution. - **Documentation**: Fully overhauled `.agent` with current scripts, architecture, audit checks, and lessons learned.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Home/Spheres4Dummies!54
No description provided.