Skip to content

Conversation

@alex-feel
Copy link
Owner

No description provided.

Implements environment-driven metadata field indexing configuration with four synchronization modes for handling index mismatches at server startup.

This feature allows users to customize which metadata fields are indexed via METADATA_INDEXED_FIELDS environment variable with optional type hints (string, integer, boolean, float, array, object). The METADATA_INDEX_SYNC_MODE variable controls how index mismatches are handled: strict (fail), auto (sync), warn (log), or additive (default, add missing only).

Key changes:
- New METADATA_INDEXED_FIELDS env var for configuring indexed fields with type hints
- New METADATA_INDEX_SYNC_MODE env var with four modes: strict, auto, warn, additive
- Backend-aware index management supporting both SQLite and PostgreSQL
- Updated default indexed fields: status, agent_name, task_name, project, report_type, references, technologies
- GIN index support for array/object fields in PostgreSQL (skipped in SQLite)
- Schema updates reflecting new indexed field defaults
Adds 38 tests covering all aspects of the configurable metadata field indexing feature including settings parsing, SQL generation, index detection, index creation/deletion, and all four sync modes.

Test coverage includes:
- Settings field parsing with type hints validation
- SQLite and PostgreSQL SQL generation for different field types
- Existing index detection excluding composite and GIN indexes
- Index creation with backend-specific handling
- All four sync modes: strict, auto, warn, additive
- Integration tests for server startup behavior
- Updated database test expectations for new default indexes
Updates all documentation to reflect the new configurable metadata field indexing feature including environment variables, backend differences, and indexed field defaults.

Documentation updates include:
- CLAUDE.md: Added metadata indexing settings and backend comparison table
- README.md: Added metadata indexing configuration section
- docs/metadata-addition-updating-and-filtering.md: Comprehensive guide with new indexed fields, environment variables, and backend differences
- docs/api-reference.md: Updated performance notes with configurable indexing
- docs/deployment/docker.md: Added metadata indexing environment variables table
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  app
  server.py 758, 842-858, 887-891, 904-909, 930-935, 973, 1012, 1312-1331, 1344-1349, 1372-1377, 1389-1395
  settings.py
Project Total  

This report was generated by python-coverage-comment-action

@alex-feel alex-feel merged commit e1ca259 into main Jan 6, 2026
6 checks passed
@alex-feel alex-feel deleted the alex-feel-dev branch January 6, 2026 20:32
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.

2 participants