Migrated app.js and components.js to TypeScript. Extracted inline scripts from base.html to cardHover.ts and cardImages.ts modules for better maintainability and code reuse.
The similarity cache build was failing because parse_theme_tags() was checking isinstance(tags, list) but Parquet files return numpy.ndarray objects. This caused all cards to be flagged as having no theme tags, resulting in an empty cache.
Changed to use hasattr(__len__) check instead, which works for both lists and numpy arrays.
- Add ensure_theme_tags_list() utility to builder_utils for simpler numpy array handling
- Update phase3_creatures.py: 6 locations now use bu.ensure_theme_tags_list()
- Update phase4_spells.py: 9 locations now use bu.ensure_theme_tags_list()
- Update tagger.py: 2 locations use hasattr/list() for numpy compatibility
- Update extract_themes.py: 2 locations use hasattr/list() for numpy compatibility
- Fix build-similarity-cache.yml verification script to handle numpy arrays
- Enhance workflow debug output to show complete row data
Parquet files return numpy.ndarray objects for array columns, not Python lists.
The M4 migration added numpy support to canonical parse_theme_tags() in builder_utils,
but many parts of the codebase still used isinstance(list) checks that fail with arrays.
This commit systematically replaces all 19 instances with proper numpy array handling.
Fixes GitHub Actions workflow 'RuntimeError: No theme tags found' and verification failures.
- Fix KeyError in generate_theme_catalog.py: use isCommander column correctly
- DataFrame.get() doesn't work like dict.get() - use column name directly
- Enhanced debug step to print full row data for better diagnostics
- Copy card_files/ to /.defaults/card_files/ during build
- Entrypoint checks for baked-in cache before downloading
- Fallback to GitHub download if not present in image
- Reduces startup time and bandwidth usage
- Create/use orphan branch 'similarity-cache-data' for cache distribution
- Add age check to dockerhub-publish: only rebuild if cache >7 days old
- Use git add -f to force-add cache files (keeps .gitignore clean)
- Weekly scheduled builds will keep cache fresh automatically
This avoids rebuilding cache on every Docker publish while ensuring
cache is always reasonably fresh (<7 days old).
Added .gitignore exceptions for:
- card_files/similarity_cache.parquet
- card_files/similarity_cache_metadata.json
These files need to be committed to the similarity-cache-data branch
for distribution with Docker builds.
Changed from non-existent code.web.services.card_loader to correct
code.file_setup.card_aggregator.CardAggregator module.
Fixes ModuleNotFoundError in build-similarity-cache workflow.