29 Commits
Author SHA1 Message Date
Ewald 55df9045f3 fix(scripts): fix mypy union-attr on ml/mol list match narrowing 2026-05-26 13:09:50 +02:00
Ewald 7e4dd98215 refactor(scripts): reduce _md_to_html CC 29->20 (extract helpers) 2026-05-26 13:08:00 +02:00
Ewald 85a82f130a test: migrate ui/tests from .mjs to .ts
- Rename 132 *.vitest.mjs -> *.vitest.ts
- Rename vitest.setup.mjs -> vitest.setup.ts
- Rename helpers/vitestEnvironment.mjs -> vitestEnvironment.ts
- Delete settings_store.test.mjs (Node test runner, superseded by .vitest.ts)
- Fix .mjs imports in vitest.setup.ts and grid_loader_adaptive_paging.vitest.ts

Config updates:
- vitest.config.mjs: setupFiles, include, coverage.include -> .ts
- tsconfig.test.json: new dedicated config for test files (strict:false)
- knip.json: update project pattern for tests
- package.json: add typecheck:tests script (audit-only)
2026-05-26 13:04:05 +02:00
Ewald a78f4572c8 Align frontend layout with ComfyUI conventions 2026-05-26 10:42:22 +02:00
Ewald a363a77a6b feat(db): Phase C tag normalization — v18/v19 migrations, normalized FTS, readers v2, stop-write, drop legacy columns
- m018_fts_from_normalized_tags: replace FTS triggers to read from asset_tags+tags
  instead of the legacy JSON asset_metadata.tags column
- m019_drop_legacy_tag_columns: remove asset_metadata.tags and tags_text via
  create-copy-swap; includes invariant check (aborts if legacy tags not backfilled)
- registry.py: MIGRATIONS = [M017, M018, M019]
- schema_fts.py / schema_sql.py: FTS helpers and baseline triggers rewritten to
  source from normalized tables with asset_tags guard
- TagsRepository: normalized read path (get_tags_for_asset, list_assets_with_tag,
  search_assets_by_tags) + sync_from_legacy_row repair helper
- Readers v2: searcher, result_hydrator, metadata_helpers, updater, rating_tags_service,
  rename_service, stacks/service, duplicates/service migrated to asset_tags/tags JOIN
- Stop-Write: writes no longer update asset_metadata.tags / tags_text
- sqlite_facade: ahas_table helper; sqlite_recovery updated
- deps.py: TagsRepository wired into service container
- scripts/tag_drift_doctor.py: detects assets with legacy tags not backfilled
- ADR 0009, ARCHITECTURE_MAP, RATINGS_TAGS_COLLECTIONS, adr/README updated
- Tests: test_drop_legacy_tag_columns (2), test_fts_from_normalized (6),
  test_tags_dual_write, test_tags_normalized_readers + regression fixes across
  test_rating_tags_import, test_index_metadata_helpers, test_index_searcher,
  test_asset_updater, test_deps, test_schema_heal
- Full suite: 1687 passed, 2 skipped, 2 pre-existing failures (test_health_routes)
2026-05-22 15:00:27 +02:00
MajoorWaldiandMajoorWaldi 91f10d7fd7 Fix 7 failing CI tests: re-export missing symbols, normalize backslashes, fix bare except regex
Agent-Logs-Url: https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/sessions/52900078-9382-4414-a5dd-05cf4224bbee

Co-authored-by: MajoorWaldi <129623145+MajoorWaldi@users.noreply.github.com>
2026-04-11 18:52:45 +00:00
Ewald f56d6284da fix: MFV popup dark theme, gen info panel, reset zoom + popout polish
- FloatingViewer.impl.js: add missing _resetMfvZoom() method (was called
  from floatingViewerLoader/Mode but never defined on the class)
- viewerShell.js: return genInfoTitle + genInfoTitleLeft from createViewerStageShell
- ViewerRuntime.js: destructure genInfoTitle + genInfoTitleLeft (were undefined
  => gen info body was never populated)
- floatingViewerPopout.js: inject document.documentElement.style.cssText as
  :root{...} in popup head so ComfyUI CSS vars are available; set body
  background to #0d0d0d; remove broken history.replaceState (Chrome blocks
  it from about:blank)
- __init__.py: remove unused FailureSeverity/StageStatus imports
2026-04-11 19:06:23 +02:00
Ewald a2053d0cba refactor(v2): plan V2 complet — splits JS, tests frontend, durcissement securite
Chantier F - Typage Python
- ruff S101 déplacé en per-file-ignores (pyproject.toml)
- pyrightconfig.json : mode standard confirmé

Chantier G - Assertions & bare-except
- 16 blocs except documentés dans config.py
- --cov-branch activé, seuil coverage 60→68%

Chantier H - Cache settings
- Stratégie documentée dans settings.py
- _resolve_index_dir() logguée dans config.py

Chantier I - Split gros fichiers JS
- client.js 1509L → client.js 406L + clientAuth.js + clientOps.js + fetchUtils.js
- toolbar.js 927L → toolbar.js 458L + toolbarActions.js + toolbarControls.js
- FloatingViewer.js → FloatingViewer.impl.js + floatingViewer*(8 modules)
- Viewer_impl.js → ViewerRuntime.js + viewerShell.js + viewerThemeStyles.js + viewerOverlayDismiss.js
- model3dRenderer.js → model3dRenderer.impl.js + model3dCore.js + model3dLoaders.js + model3dSupport.js
- dialogs.js → dialogs.js + DialogTemplates.js

Chantier J - Tests frontend (Phases 1-2)
- use_drag_drop.vitest.mjs : 5 tests
- use_grid_state.vitest.mjs : 18 tests
- security_client_headers, security_deep_merge, security_runtime_state, runtime_store, dialog_templates
- Total: 80 fichiers test / 350 tests vitest

Chantier K - Pinia migration
- runtimeState.js entièrement migré vers Pinia
- getOptionalRuntimeStore.js + runtimeEnrichmentState.js ajoutés

Chantier L - Durcissement sécurité
- tests/security/test_rate_limit.py : 8 tests rate-limit (state machine complète)
- clientAuth.js : docstring sessionStorage security boundary
- three.js 0.183.2 audité : 0 CVE (Snyk)

Chantier M - Simplification config
- deps.py, tool_detect.py, utils.py nettoyés

docs: PLAN_REFACTO_V2_LONG_TERME.md ajouté et clôturé
.gitignore: coverage/ ajouté
2026-04-11 09:38:41 +02:00
Ewald 462ca8d9ff fix(backend): enhance type checking and error handling
- Improve type checking for generation_time_ms value in searcher.py
- Refactor PromptServer import and usage in service.py
- Add safe error message handler for base exceptions in search_impl.py
2026-04-10 11:48:53 +02:00
Ewald 85a351e8cf Fix local hook execution 2026-04-10 11:15:43 +02:00
Ewald 1982b3ab3c Add local and CI quality gates 2026-04-10 11:05:27 +02:00
MajoorWaldi 5c17eb83d4 Refactor hybrid search and vector search handlers for improved query filtering and asset management
- Added `_build_asset_filter_query` and `_query_allowed_asset_ids` functions to streamline asset filtering in hybrid search.
- Enhanced `_filter_semantic_hits` to utilize new asset filtering methods.
- Refactored vector search functions to improve K-means clustering logic and asset filtering.
- Introduced helper functions for parsing and validating query filters in `query_sanitizer.py`.
- Improved viewer context resolution in `viewer.py` with better error handling and path validation.
- Updated schema healing tests to use helper functions for column validation.
- Enhanced test coverage for vector indexing and filesystem entries.
- Added new test images for filesystem entry tests.
2026-03-29 15:33:59 +02:00
MajoorWaldi 0124a8f6d5 feat: enhance asset management with job finalization logic, improve coverage thresholds, and update documentation for AI/vector features 2026-03-28 15:35:28 +01:00
MajoorWaldi dc72be0139 feat: enhance JS testing and linting setup
- Added coverage reporting for Vitest with configuration in vitest.config.mjs
- Updated package.json to include new scripts for JS coverage, linting, and formatting
- Modified run_quality_gate.py to allow skipping ESLint and Prettier checks
- Introduced .prettierrc for consistent code formatting
- Created .prettierignore to exclude specific files and directories from formatting
2026-03-28 14:14:28 +01:00
MajoorWaldi a32df649ec feat: Enhance path handling in vector database resolution for cross-platform compatibility 2026-03-28 13:37:58 +01:00
MajoorWaldi 4411c72e4e Refactor test imports and clean up unused code across multiple test files
- Removed unnecessary imports from various test files to improve readability and maintainability.
- Added new settings for the Generated Feed display in the settingsFeed.js file.
- Introduced a new configuration file for Pyright type checking.
2026-03-28 13:26:28 +01:00
MajoorWaldi cb171e826d feat: Add runtime bootstrap helpers and search request normalization
- Introduced runtime bootstrap helpers in `mjr_am_backend.features.runtime` for dependency initialization.
- Implemented `apply_startup_settings` to handle various startup configurations.
- Added search request normalization helpers in `mjr_am_backend.features.search` including `SearchRequestContext` and `parse_search_request` for better query handling.
- Created audit logging helpers in `mjr_am_backend.routes.core.audit_log` for state-changing route handlers.
- Developed a quality gate script in `scripts/run_quality_gate.py` to enforce code quality checks.
- Added comprehensive tests for audit routes, scan consistency, vendor routes, and code quality metrics.
2026-03-26 20:42:51 +01:00
MajoorWaldi 5573f3d4be fix(plugin-system): handle error cases and improve type hints in various modules 2026-03-17 00:18:02 +01:00
MajoorWaldi 29e5059c4d feat(ai): enhance asset alignment, captioning and tagging
- Add AI alignment score display to asset metadata
- Implement image description fallback for non-workflow image assets
- Improve AI captioning UI and UX
- Optimize AI tagging suggestions with bootstrap generation
- Refactor collections controller to support AI toggling
- Enhance error handling and retry logic for asset indexing
2026-03-05 02:21:13 +01:00
MajoorWaldi 83c2d19327 Add audit, hybrid search, and vector search functionalities
- Implemented library audit route to surface assets based on completeness and quality scores.
- Created hybrid search route combining FTS and semantic search with inline filter parsing.
- Developed vector search routes for semantic search, find-similar, and alignment score retrieval.
- Added auto-clustering utility for grouping assets by visual similarity using K-Means.
- Enhanced vector search capabilities with support for AI auto-tags and clustering suggestions.
2026-03-02 14:03:31 +01:00
MajoorWaldi 75261d636c Add comprehensive tests for SQLite facade, metadata extractors, and security helpers
- Introduced unit tests for SQLite facade helpers, including schema validation, query building, and async operations.
- Added integration tests for basic SQLite queries and transaction handling.
- Implemented additional tests for metadata extraction functions, focusing on dimension handling, EXIF data, and video metadata.
- Created tests for security core helpers, covering environment variable checks, IP validation, and CSRF protection.
- Included compatibility tests for route exports to ensure proper functionality.
2026-02-26 07:01:43 +01:00
Your Name 934f10b58a Refactor imports and improve type hints across multiple modules
- Organized and grouped import statements for better readability in health.py, metadata.py, releases.py, scan.py, search.py, version.py, viewer.py, and registry.py.
- Updated type hints to use the new union syntax (e.g., str | None) for better clarity in scan.py, settings.py, tool_detect.py, and result.py.
- Enhanced the handling of optional types in various functions to ensure more robust type checking.
- Removed unnecessary blank lines and improved formatting for consistency.
- Adjusted the logic in several test files to ensure compatibility with the updated import structure and type hints. (See <attachments> above for file contents. You may not need to search or read the file again.)
2026-02-20 19:13:15 +01:00
Your Name f38ab4209e Save changes 2026-02-19 22:44:26 +01:00
Ewald 00ee7806f7 feat: Add tool detection helpers for ExifTool and FFprobe
- Implemented caching for tool availability and versions.
- Added functions to check for ExifTool and FFprobe availability.
- Included version satisfaction checks against minimum required versions.
- Created utility functions for parsing boolean and float values from environment variables.
- Introduced shared utilities for error message sanitization and logging with emoji indicators.
- Established a Result pattern for error handling without exceptions.
- Added scan throttling helpers to manage background scans efficiently.
- Implemented time utilities for timestamps and performance measurement.
- Defined shared types, enums, and constants for consistent error handling and file classification.
- Created version management utilities to retrieve version information from pyproject.toml.
- Developed installation script for runtime dependencies.
- Added tests for ExifTool batch processing and various configuration scenarios.
- Implemented tests for version route aliases and runtime output root configuration.
2026-02-12 17:55:28 +01:00
Ewald 4ed61dd0e7 feat: Enhance metadata enrichment and audio handling
- Implemented a pause mechanism for enrichment processes in search routes to improve performance and user experience.
- Added new toast notifications for metadata enrichment completion and database restore events.
- Updated internationalization (i18n) files to include new toast messages for enrichment and database operations.
- Refactored drag-and-drop functionality to support audio files alongside video files, including new utility functions for audio path detection.
- Improved grid view loading overlays and asset handling to prevent stale data issues during updates.
- Added tests for audio metadata extraction and prompt graph preservation to ensure robustness in audio processing features.
- Updated requirements to include static analysis tools for better code quality.
2026-02-11 09:44:00 +01:00
Ewald c1b1c92576 Untrack restored files and ignore them (AGENTS, ROADMAP, VERSION, eslint.config.js) 2026-02-10 11:11:53 +01:00
Your Name f8898e964c Release 2.2.2: i18n support + viewer/minimap improvements 2026-01-30 03:37:28 +01:00
Your Name 8ed51fbf39 make assets manager docs, license, and code improvements 2026-01-24 19:28:33 +01:00
Your Name 2e4c1d2457 Added viewer feature and database maintenance handler 2026-01-22 02:12:22 +01:00