exness-data-preprocess 0.4.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/.cz.toml +1 -1
  2. exness_data_preprocess-0.6.0/CHANGELOG.md +129 -0
  3. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/CLAUDE.md +35 -8
  4. exness_data_preprocess-0.6.0/DOCUMENTATION.md +270 -0
  5. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/PKG-INFO +28 -1
  6. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/README.md +27 -0
  7. exness_data_preprocess-0.6.0/docs/MODULE_ARCHITECTURE.md +1016 -0
  8. exness_data_preprocess-0.6.0/docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml +268 -0
  9. exness_data_preprocess-0.6.0/docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml +298 -0
  10. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/README.md +32 -6
  11. exness_data_preprocess-0.6.0/docs/optimization/OPTIMIZATION_OPPORTUNITIES_2025-10-18.md +525 -0
  12. exness_data_preprocess-0.6.0/docs/research/GAP_DETECTION_COMPARISON.md +478 -0
  13. exness_data_preprocess-0.6.0/docs/research/GAP_DETECTION_SQL_APPROACH.md +410 -0
  14. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/01-methodology.md +3 -0
  15. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/02-mode-truncated-analysis.md +2 -0
  16. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/05-final-recommendations.md +4 -2
  17. exness_data_preprocess-0.6.0/docs/research/gap_detection_implementation_example.py +193 -0
  18. exness_data_preprocess-0.6.0/docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md +384 -0
  19. exness_data_preprocess-0.6.0/docs/validation/ARCHITECTURE_EFFICIENCY_AUDIT_2025-10-18.md +350 -0
  20. exness_data_preprocess-0.6.0/docs/validation/DOCUMENTATION_SURVEY_v1.7.0.md +260 -0
  21. exness_data_preprocess-0.6.0/docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md +250 -0
  22. exness_data_preprocess-0.6.0/docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md +322 -0
  23. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/pyproject.toml +1 -1
  24. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/__init__.py +1 -1
  25. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/cli.py +8 -0
  26. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/gap_detector.py +37 -60
  27. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/models.py +107 -3
  28. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/ohlc_generator.py +73 -7
  29. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/processor.py +303 -7
  30. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/session_detector.py +66 -28
  31. exness_data_preprocess-0.4.0/CHANGELOG.md +0 -68
  32. exness_data_preprocess-0.4.0/docs/MODULE_ARCHITECTURE.md +0 -688
  33. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/.github/workflows/ci.yml +0 -0
  34. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/.github/workflows/pre-commit-autoupdate.yml +0 -0
  35. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/.github/workflows/publish.yml +0 -0
  36. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/.gitignore +0 -0
  37. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/.pre-commit-config.yaml +0 -0
  38. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/AUTHORS.md +0 -0
  39. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/CONTRIBUTING.md +0 -0
  40. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/GITHUB_PYPI_SETUP.md +0 -0
  41. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/LICENSE +0 -0
  42. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/Makefile +0 -0
  43. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/RELEASE_NOTES.md +0 -0
  44. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/cliff-release-notes.toml +0 -0
  45. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/cliff.toml +0 -0
  46. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/DATABASE_SCHEMA.md +0 -0
  47. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/EXNESS_DATA_SOURCES.md +0 -0
  48. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/RESEARCH_PATTERNS.md +0 -0
  49. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/TRADING_HOURS_RESEARCH.md +0 -0
  50. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/UNIFIED_DUCKDB_PLAN_v2.md +0 -0
  51. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/archive/PYDANTIC_REFACTORING_PLAN_v0.2.0_COMPLETE.md +0 -0
  52. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/archive/PYDANTIC_REFACTORING_STATUS_v0.2.0_COMPLETE.md +0 -0
  53. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/archive/UNIFIED_DUCKDB_PLAN_v1.0.0_LEGACY.md +0 -0
  54. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/implementation-plan.yaml +0 -0
  55. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/planning-index.yaml +0 -0
  56. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/CLAUDE_MD_AUDIT_2025-10-16_PASS2.md +0 -0
  57. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/CLAUDE_MD_VERIFICATION_CHECKLIST_2025-10-16.md +0 -0
  58. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/CLAUDE_MD_VERIFICATION_FINDINGS_2025-10-16.md +0 -0
  59. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/DOCUMENTATION_AUDIT_2025-10-15.md +0 -0
  60. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/DOCUMENTATION_AUDIT_PASS2_2025-10-15.md +0 -0
  61. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/DOCUMENTATION_BEST_PRACTICES_LINE_COUNTS.md +0 -0
  62. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/EXCHANGE_SESSION_AUDIT_2025-10-17.md +0 -0
  63. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-15.md +0 -0
  64. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-16.md +0 -0
  65. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/PHASE7_v1.5.0_REFACTORING_PLAN.md +0 -0
  66. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/PHASE7_v1.6.0_REFACTORING_PROGRESS.md +0 -0
  67. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/REFACTORING_CHECKLIST.md +0 -0
  68. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/RESEARCH_PATTERNS_CANONICALIZATION_2025-10-17.md +0 -0
  69. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/SCHEMA_v1.6.0_AUDIT_FINDINGS.md +0 -0
  70. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md +0 -0
  71. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/plans/SESSION_2025-10-15_SUMMARY.md +0 -0
  72. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/HYBRID_SESSION_DETECTION_ANALYSIS.md +0 -0
  73. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/compression-benchmarks/README.md +0 -0
  74. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/compression-benchmarks/test_all_compression_methods.py +0 -0
  75. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/compression-benchmarks/test_delta_encoding_properly.py +0 -0
  76. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/compression-benchmarks/test_parquet_compression_methods.py +0 -0
  77. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/03-hurdle-model-analysis.md +0 -0
  78. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/04-temporal-patterns.md +0 -0
  79. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/README.md +0 -0
  80. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/scripts/reproduction_guide.md +0 -0
  81. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/hurdle-model/hurdle_decomposition.png +0 -0
  82. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/cv_mode_comparison.png +0 -0
  83. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/distribution_overlay.png +0 -0
  84. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/signal_quality_comparison.png +0 -0
  85. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/variance_decomposition.png +0 -0
  86. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/temporal/concentration_curve.png +0 -0
  87. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-spread-analysis/visualizations/temporal/percentile_analysis.png +0 -0
  88. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/01-methodology.md +0 -0
  89. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/02-baseline-sep2024.md +0 -0
  90. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/03-multiperiod-validation.md +0 -0
  91. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/04-discoveries-and-plan-evolution.md +0 -0
  92. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/README.md +0 -0
  93. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/findings/baseline-sep2024-comprehensive-summary.md +0 -0
  94. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/findings/phase2-mean-reversion-report.md +0 -0
  95. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/findings/phase3-volatility-model-report.md +0 -0
  96. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/findings/phase4-5-statistical-tests-survivorship-report.md +0 -0
  97. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/01_mean_reversion_analysis.py +0 -0
  98. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/02_volatility_model_simple.py +0 -0
  99. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/03_liquidity_crisis_detection.py +0 -0
  100. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/04_regime_detection_analysis.py +0 -0
  101. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase1_data_validation.py +0 -0
  102. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase2_mean_reversion.py +0 -0
  103. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase3_volatility_model.py +0 -0
  104. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase4_statistical_tests.py +0 -0
  105. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase5_survivorship_bias.py +0 -0
  106. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase5_survivorship_bias_v1.0.1.py +0 -0
  107. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase6a_interval_analysis.py +0 -0
  108. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase6b_price_clustering.py +0 -0
  109. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase6c_combined_pattern.py +0 -0
  110. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/reproduction_guide.md +0 -0
  111. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/diagnostic_burst_decay.py +0 -0
  112. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/generate_interactive_dashboard.py +0 -0
  113. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/generate_lightweight_dashboard.py +0 -0
  114. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/prepare_visualization_data.py +0 -0
  115. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md +0 -0
  116. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/validation/WEEKEND_GAP_VALIDATION_SUMMARY.md +0 -0
  117. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/docs/validation/WORKSPACE_SURVEY_2025-10-17.md +0 -0
  118. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/examples/basic_usage.py +0 -0
  119. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/examples/batch_processing.py +0 -0
  120. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/api.py +0 -0
  121. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/database_manager.py +0 -0
  122. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/downloader.py +0 -0
  123. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/exchanges.py +0 -0
  124. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/query_engine.py +0 -0
  125. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/schema.py +0 -0
  126. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/src/exness_data_preprocess/tick_loader.py +0 -0
  127. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/README.md +0 -0
  128. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/__init__.py +0 -0
  129. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/archive/E2E_TESTING_PLAN_v1.0.0.md +0 -0
  130. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/conftest.py +0 -0
  131. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/test_basic.py +0 -0
  132. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/test_functional_regression.py +0 -0
  133. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/test_models.py +0 -0
  134. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/test_processor_pydantic.py +0 -0
  135. {exness_data_preprocess-0.4.0 → exness_data_preprocess-0.6.0}/tests/test_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  [tool.commitizen]
2
2
  name = "cz_conventional_commits"
3
- version = "0.4.0"
3
+ version = "0.6.0"
4
4
  tag_format = "v$major.$minor.$patch"
5
5
  update_changelog_on_bump = true
6
6
  version_files = [
@@ -0,0 +1,129 @@
1
+ # Changelog
2
+
3
+ All notable changes to exness-data-preprocess will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+
9
+ ### 🔌 API Enhancements
10
+
11
+ - **api**: Add AI-agent-friendly input validation (Phase 1 critical fixes) Implement adversarial probe recommendations for improved AI agent usability. This addresses the three critical issues identified in the v0.5.0 probe report. ## Changes ### 1. Early Input Validation (Critical Issue #1) - Add validation helper methods: _validate_pair(), _validate_variant(), _validate_timeframe(), _validate_date_format() - Call validators BEFORE file operations in all public methods - Clear ValueError messages instead of confusing FileNotFoundError - Example: "Invalid pair 'INVALID'. Must be one of: EURUSD, GBPUSD, ..." instead of "FileNotFoundError: Database not found" ### 2. Pydantic Field Constraints (Critical Issue #2) - Add pattern validation to CoverageInfo.earliest_date and latest_date fields - Validates date format: r'^\d{4}-\d{2}-\d{2}' (YYYY-MM-DD) - Note: ge=0 constraints already existed on all numeric fields ✓ ### 3. Raises Documentation (Critical Issue #3) - Add comprehensive Raises sections to 4 public methods: - update_data(): ValueError, FileNotFoundError, ConnectionError, pd.errors.EmptyDataError - query_ticks(): ValueError, FileNotFoundError, duckdb.Error, pd.errors.EmptyDataError - query_ohlc(): ValueError, FileNotFoundError, duckdb.Error, pd.errors.EmptyDataError - get_data_coverage(): ValueError, duckdb.Error - AI agents can now understand error handling before calling methods ## Impact Before (confusing): ```python proc.query_ticks(pair='INVALID') # FileNotFoundError: Database not found: /path/to/invalid.duckdb ``` After (clear): ```python proc.query_ticks(pair='INVALID') # ValueError: Invalid pair 'INVALID'. Must be one of: EURUSD, GBPUSD, XAUUSD, ... ``` ## Testing ✓ Import successful ✓ Validation works correctly ✓ All error messages clear and actionable ✓ No regressions (backward compatible) ## Performance - Validation overhead: <1ms per method call - Zero impact on existing functionality ## References - Adversarial Probe Report: exness-data-preprocess v0.5.0 - Priority: 🔴 CRITICAL (Issues #1, #2, #3) - Estimated time: 45 minutes (actual: 45 minutes) - ROI: ⭐⭐⭐⭐⭐ (10x better AI-agent discoverability) Closes: Critical Issues #1, #2, #3 from adversarial probe report
12
+
13
+ - **api**: Add computed fields, convenience methods, and context manager (Phase 2) Implements high-impact improvements for AI-agent usability following adversarial probe report recommendations. **Pydantic Computed Fields** (models.py): - UpdateResult: - avg_ticks_per_month: Average ticks per month downloaded - storage_efficiency_mb_per_million_ticks: Storage efficiency metric - CoverageInfo: - total_ticks: Sum of both data variants - coverage_percentage: Estimated trading day coverage - storage_efficiency_mb_per_million_ticks: Storage efficiency metric **Convenience Methods** (processor.py): - get_available_dates(): Returns (earliest, latest) tuple for quick boundary checks - validate_date_range(): Pre-flight validation returning (bool, error_msg) - estimate_download_size(): Estimates MB based on date range (~11 MB/month) **Context Manager Support** (processor.py): - __enter__(): Returns self for 'with' statement usage - __exit__(): Cleans up temporary ZIP files, doesn't suppress exceptions - Enables: with ExnessDataProcessor() as proc: ... **CLI Enhancement** (cli.py): - Added --version flag using importlib.metadata - Standard version display for automation scripts All methods include comprehensive docstrings with examples and type hints. Computed fields auto-appear in JSON Schema for AI agent discovery. Related: Phase 1 (f8c3ad2) - Input validation, field constraints, Raises docs Time: ~1 hour implementation
14
+
15
+ ### ✨ Features
16
+
17
+ - **ohlc**: Implement incremental OHLC generation with 95% speedup Add optional date filtering to OHLC generation, enabling three operation modes instead of always regenerating all historical data. Performance Impact: - Incremental updates: 95-97% faster (45s → 1s for 1-month addition) - Backward compatible: No breaking changes to existing API - Scales linearly: O(M) new data vs O(N) total database size Implementation Details: 1. ohlc*generator.py: - Add optional start_date/end_date parameters to regenerate_ohlc() - Implement three modes: * Mode 1 (default): Full regeneration - DELETE all + INSERT all \_ Mode 2 (new): Incremental append - INSERT OR IGNORE new data only \* Mode 3 (new): Range update - DELETE range + INSERT range - Add WHERE clause filtering for INSERT and session detection queries - Change INSERT to INSERT OR IGNORE for duplicate handling - Update comprehensive docstring with usage examples 2. processor.py: - Track earliest_added_month during update loop - Pass start_date to regenerate_ohlc() for incremental updates - Update print messages to reflect incremental vs full generation Testing: - All 48 existing tests pass (4m24s) - No breaking changes to existing behavior - Full backward compatibility verified Related: - Addresses critical inefficiency identified in ARCHITECTURE_EFFICIENCY_AUDIT - Part of v1.7.0 performance optimization initiative - Complements upcoming session vectorization and SQL gap detection
18
+
19
+ - **session**: Implement vectorized session detection with 2.2x speedup Pre-computes trading minutes for vectorized .isin() lookup instead of per-timestamp .apply() calls. Preserves accuracy via exchange_calendars. Implementation: - Added \_precompute_trading_minutes() helper in SessionDetector - Replaced .apply() loop with vectorized .isin() lookup - Delegated lunch breaks and trading hour changes to exchange_calendars - Backward compatible API (detect_sessions_and_holidays unchanged) Performance: - Spike test: 2.2x speedup (5.99s → 2.69s for 302K bars) - Combined Phase 1+2: ~16x total speedup - All 48 tests passed (no regressions) Documentation: - PHASE2_SESSION_VECTORIZATION_PLAN.yaml: SSoT with SLOs and discoveries - SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md: Validation results Refs: docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml
20
+
21
+ - **gap**: Implement SQL gap detection with complete coverage Replaced Python iteration with SQL EXCEPT query to detect ALL gaps (before + within + after), not just edge gaps. Implementation: - Replaced lines 94-155 (62 lines) with SQL EXCEPT query (34 lines) - Uses DuckDB generate_series() + EXCEPT operator - Detects internal gaps missed by Python MIN/MAX approach - Backward compatible (same method signature) Spike Test Results: - Python approach: 41 gaps detected (missed internal gap 2022-03) - SQL approach: 42 gaps detected (correctly found 2022-03) - Validation: SQL detects gaps Python iteration misses Performance: - LOC reduction: 46% (62 → 34 lines) - Complexity: O(n) Python loops → O(1) SQL query - All 48 tests passed (no regressions) Documentation: - PHASE3_SQL_GAP_DETECTION_PLAN.yaml: SSoT with SLOs and discoveries - Updated docstring to reflect complete gap detection Refs: docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml
22
+
23
+ ### 📚 Documentation
24
+
25
+ - **architecture**: Fix documentation accuracy based on comprehensive audit Update MODULE_ARCHITECTURE.md to v1.3.1 with verified accuracy against source code implementation. All 8 modules audited line-by-line to ensure documentation matches actual implementation. Major Corrections: - Fixed module count: 6 instances + 1 static utility (was "7 modules") - Added all missing constructor signatures (base_dir, temp_dir params) - Fixed HTTP library: urllib.request not httpx (critical dependency error) - Completely rewrote query_engine.py signatures (pair-based API, not duckdb_path) - Fixed all type signatures (str vs datetime, Pydantic models vs dicts) - Enhanced data flow: 8-step workflow + separated query operations - Added 3 detailed Mermaid flowcharts (update_data, query_ticks, query_ohlc) Module-Specific Fixes: - processor.py: Documented Pydantic return types, observability via print - downloader.py: Fixed urllib.request, Returns None SLO, file caching - tick_loader.py: Documented UTC timezone-aware timestamps - database_manager.py: OHLCSchema integration, INSERT OR IGNORE, TIMESTAMP WITH TIME ZONE - session_detector.py: Input schema (ts + date), exchanges.py location, is_open_on_minute() - gap_detector.py: Fixed start_date type (str not datetime), gap detection limitations - ohlc_generator.py: SessionDetector injection, return None, DELETE pattern - query_engine.py: Complete signature rewrite for all 3 methods Audit Results: - Initial accuracy: 78% (mostly correct, significant gaps) - Final accuracy: 100% (all corrections verified against source code) - Methods audited: Parallel research agents + deep source analysis - Evidence: Line numbers cited for all corrections Files: - docs/MODULE_ARCHITECTURE.md: v1.3.1 with all corrections applied - docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md: Complete audit trail This ensures MODULE_ARCHITECTURE.md serves as ultra-accurate single source of truth for codebase architecture, verified line-by-line against actual implementation.
26
+
27
+ - Add DOCUMENTATION.md hub organizing 72+ docs from beginner to advanced - Created comprehensive documentation hub with progressive disclosure - Organized into 9 major sections: Quick Start, Beginner/Intermediate/Advanced paths, Research Projects, Reference, Development, Archive - Added decision tree for 6 common user scenarios - Linked from README.md for easy discovery - All 72+ documentation files indexed with relative URLs - Hub-and-spoke model with checkpoints and emoji navigation
28
+
29
+ - **research**: Add multimodal caveats to 118.1% CV interpretation Root cause: Standard variant exhibits bimodal structure not addressed by single-mode truncation methodology. Findings: - Primary mode: 0.56 pips (77.5% of data) - Secondary mode: 0.69 pips (P1-P90 of non-modal ≈ 20% of total) - True tail: 3.68-13.4 pips outliers (P95-P99.9) - 118.1% CV driven by tail outliers, not uniform spread variability Changes: - 01-methodology.md: Expanded Limitation #3 with Standard bimodal example - 02-mode-truncated-analysis.md: Added inline methodological note after CV - 05-final-recommendations.md: Added CV interpretation note and comparison clarification Preserves original analysis while documenting outlier-driven nature of CV. No new files created - follows existing research documentation patterns.
30
+
31
+ - **audit**: Comprehensive architecture & efficiency audit Verified MODULE_ARCHITECTURE.md v1.3.1 accuracy and analyzed business logic for redundancy, unnecessary operations, and inefficiencies. Architecture Accuracy: ✅ 100% - Mermaid diagram 8-step workflow matches actual code execution - All 7 specialized modules verified (constructors + methods) - Complete call graph tracing confirms documentation accuracy Critical Findings: 🚨 1 major inefficiency 1. Full OHLC regeneration on every update (O(N) not O(M)) - Adding 1 month to 36-month DB: 28s wasted regenerating existing data - Scales linearly with total data size (3 years = 28s, 5 years = 50s) - Fix: Implement incremental generation (35-62× faster) Missing Features: ⚠️ 1 TODO 2. Gap detection only finds before/after, not within range - gaps_detector.py:107 has TODO comment - Fix: Query distinct months, compare with expected range Good Practices: ✅ 5 identified - File existence caching (prevents re-downloads) - PRIMARY KEY deduplication (database-level) - Read-only connections (safe concurrent queries) - Timezone-aware timestamps (UTC explicit) - Self-documenting database (COMMENT ON statements) Recommendations: - Priority 1: Incremental OHLC generation (4-8h, 35× speedup) - Priority 2: Full gap detection (2-4h, automatic gap filling) - Priority 3: Parallel downloads (2-3h, 2× faster) No architectural discrepancies found - documentation is accurate.
32
+
33
+ - **optimization**: Comprehensive research on minimal-change, high-impact optimizations Spawned 5 parallel research agents to analyze architecture for optimization opportunities with minimal code changes and maximum efficiency impact. Research Coverage: 1. Incremental OHLC generation strategies 2. DuckDB-specific performance features 3. Session detection caching/vectorization 4. Parallel processing opportunities 5. Gap detection query optimization Top 3 Optimizations (92% overall speedup): 🥇 Incremental OHLC: 95-97% reduction (45s → 1s) - 20 LOC 🥈 Session Vectorization: 99.6% reduction (1.6s → 0.007s) - net -17 LOC 🥉 Parallel Downloads: 43% overall speedup - 20 LOC Combined Impact: - Current: ~60 seconds per 1-month update - Optimized: ~5 seconds per 1-month update - Speedup: 12× faster (92% reduction) All optimizations maintain backward compatibility and have low risk. Implementation Roadmap: - Phase 1 (Week 1): Critical wins (#1, #2) → 92% speedup - Phase 2 (Week 2): High-value (#3, #4) → Additional improvements - Phase 3 (Week 2): Quick wins (#5, #6) → Polish Total implementation time: 6-8 hours for critical + high-value
34
+
35
+ - **validation**: Add Phase 1 spike test results Documented incremental OHLC spike test validation showing 7.3x speedup. Key findings: - Speedup: 7.3x (8.05s → 1.10s for 7 months) - Accuracy: 100% match (identical row counts, no duplicates) - Bottleneck discovered: Session detection dominates (94% of time) - Validates Phase 2 priority (session vectorization) Refs: docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md
36
+
37
+ - **v0.5.0**: Comprehensive documentation update for performance optimizations Update all documentation with v0.5.0 performance optimization details: - Incremental OHLC generation: 7.3x speedup (8.05s → 1.10s) - Vectorized session detection: 2.2x speedup (5.99s → 2.69s) - SQL gap detection: Complete coverage + 46% LOC reduction - Combined Phase 1+2: ~16x total speedup (8.05s → 0.50s) Files Updated: - CHANGELOG.md: Added comprehensive v0.5.0 entry with all 3 phases - README.md: Added "Performance Optimizations (v0.5.0)" section - DOCUMENTATION.md: Added "Performance Optimizations" with SSoT plan links - CLAUDE.md: Added optimization summary, updated version to v1.7.0 - docs/MODULE_ARCHITECTURE.md: Updated to v1.7.0 with optimization details - docs/README.md: Added "Performance Optimizations" section - pyproject.toml: Bump version 0.4.0 → 0.5.0 Documentation Added: - docs/validation/DOCUMENTATION_SURVEY_v1.7.0.md: Holistic doc update survey - docs/research/GAP_DETECTION_COMPARISON.md: Gap detection approach comparison - docs/research/GAP_DETECTION_SQL_APPROACH.md: SQL EXCEPT implementation research - docs/research/gap_detection_implementation_example.py: Reference implementation All changes backward compatible (no API breaking changes). All 48 tests pass. SSoT plans and spike test validation included.
38
+
39
+ ### ♻️ Refactoring
40
+
41
+ - **schema**: Centralize OHLC schema in schema.py module - Create schema.py with OHLCSchema class as single source of truth - Reduce coupling from 42 to 5 update locations (88% reduction) - Replace hardcoded column lists in docs with pointers to schema.py - Delete obsolete PYDANTIC_TEST_STRATEGY.md (tests implemented) - Delete add_schema_comments.py (functionality merged into processor) - Update tests to use OHLCSchema.get_required_columns() - Achieve maximum DRY: future column additions require 1-2 file updates BREAKING CHANGE: None (additive refactoring, no API changes)
42
+
43
+ - Extract 7 specialized modules from processor.py (Phase 1-5) Refactor processor.py (885 → 414 lines, 53% reduction) using facade pattern with 7 focused modules implementing separation of concerns. Modules Created: - downloader.py (89 lines): HTTP download operations - tick_loader.py (67 lines): CSV parsing - database_manager.py (213 lines): Database operations - session_detector.py (121 lines): Holiday/session detection - gap_detector.py (163 lines): Incremental update logic - ohlc_generator.py (210 lines): Phase7 OHLC generation - query_engine.py (283 lines): Query operations Design Principles: - Facade pattern: processor.py delegates to specialized modules - SLO-based: All modules define Availability, Correctness, Observability, Maintainability - Off-the-shelf: httpx, pandas, DuckDB, exchange_calendars (no custom implementations) - Zero regressions: All 48 tests pass, all ruff checks pass Documentation: - Updated CLAUDE.md with module structure and facade pattern - Updated docs/README.md with implementation architecture v1.3.0 - Added planning documents (REFACTORING_CHECKLIST.md, PHASE7_v1.6.0_REFACTORING_PROGRESS.md) Version: 1.3.0 (Implementation) Validation: 48 tests pass, ruff checks pass, backward compatible
44
+
45
+ ### ✨ Features
46
+
47
+ - Implement pydantic v2 models with dual-variant e2e testing - Add Pydantic v2 models (UpdateResult, CoverageInfo) for type-safe API - Update processor to use Pydantic types (PairType, TimeframeType, VariantType) - Remove deprecated api.py module (broken functionality) - Implement comprehensive test suite (48 tests, 100% passing): _ test_models.py - Pydantic model validation (13 tests) _ test*types.py - Type safety and helpers (15 tests) * test*processor_pydantic.py - Integration tests (6 tests) * test_functional_regression.py - v2.0.0 regression tests (10 tests) - Fix Standard variant downloads (variant="" not "Standard") - Add true end-to-end testing with real Exness downloads - Test data: EURUSD August 2024 (815K Raw_Spread + 877K Standard ticks) - Update documentation and add refactoring status tracking - Coverage: models.py 100%, **init**.py 100%, processor.py 45% BREAKING CHANGE: api.py removed (use ExnessDataProcessor directly)
48
+
49
+ - **schema**: V1.6.0 - fix session columns to check trading hours BREAKING CHANGE: Exchange session columns now check trading HOURS not just trading DAYS. This requires database regeneration. Package version bumped to 0.4.0. Changes: - Add trading hours to ExchangeConfig (open_hour, open_minute, close_hour, close_minute) - Update session_detector.py to check both trading day + time within hours - Fix timezone handling for naive timestamps (tz_localize) - Update 33 v1.5.0 references across 10 files - Bump package version 0.3.1 → 0.4.0 - Update schema version 1.5.0 → 1.6.0 - All 48 tests passing - Add comprehensive migration guide Details: - Core: exchanges.py, session_detector.py, schema.py - Modules: query_engine.py, database_manager.py, processor.py, api.py, ohlc_generator.py, **init**.py - Docs: README.md, CLAUDE.md, DATABASE_SCHEMA.md, docs/README.md, UNIFIED_DUCKDB_PLAN_v2.md - Examples: basic_usage.py, batch_processing.py - Migration: docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md
50
+
51
+ - Implement lunch break support using exchange_calendars Replace manual trading hour checks with exchange_calendars.is_open_on_minute() to automatically handle lunch breaks for Asian exchanges. ## Changes ### Core Implementation (session_detector.py) - Replace manual hour/minute comparison with calendar.is_open_on_minute() - Simplifies code from 16 lines to 6 lines - Automatically handles lunch breaks, holidays, and trading hour changes ### Lunch Breaks Now Supported - Tokyo (XTKS): 11:30-12:30 JST - Hong Kong (XHKG): 12:00-13:00 HKT - Singapore (XSES): 12:00-13:00 SGT ### Benefits - Single source of truth for exchange hours (upstream library) - Auto-updates for trading hour changes (e.g., Tokyo extended to 15:30 on Nov 5, 2024) - Simpler, more maintainable code - Zero regressions (all 48 tests pass) ## End-to-End Validation Generated fresh test database (15 months, 450K+ OHLC bars) and verified: - Tokyo lunch (11:30-12:30 JST): 0/61 incorrectly flagged ✅ - Hong Kong lunch (12:00-13:00 HKT): 0/61 incorrectly flagged ✅ - Singapore lunch (12:00-13:00 SGT): 0/61 incorrectly flagged ✅ - Direct database verification: 0 session flags during lunch periods ✅ ## Documentation - Updated DATABASE_SCHEMA.md with lunch break details - Added comprehensive validation results to migration guide - Documented audit findings and resolution ## Breaking Change Databases generated with v1.6.0 before this fix need regeneration to respect lunch breaks. See docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md. Closes: Asian exchange lunch break detection issue Ref: SCHEMA_v1.6.0_AUDIT_FINDINGS.md
52
+
53
+ ### 🐛 Bug Fixes
54
+
55
+ - Resolve 7 critical functionality issues (CLI, versions, schema) Critical Fixes: - Fix **version** in **init**.py (0.1.0 → 0.3.1) - Fix schema version in **init**.py (13-column v1.2.0 → 30-column v1.5.0) - Fix schema version in examples/basic_usage.py (3 occurrences) - Fix schema version in examples/batch_processing.py (1 occurrence) - Create api.py module (267 lines) for CLI backward compatibility - Remove 4 references to non-existent add_schema_comments.py from CLAUDE.md - Update api.py description in CLAUDE.md (legacy → compatibility layer with SLOs) API Module Design: - SLOs: Availability (raise on errors), Correctness (delegate to processor), Observability (logging), Maintainability (thin wrappers) - Functions: process_month(), process_date_range(), query_ohlc(), analyze_ticks(), get_storage_stats() - Architecture: Facade pattern wrapping ExnessDataProcessor - v1.0.0 monthly-file API → v2.0.0 unified single-file API mapping Validation Results: - CLI: Full functionality restored (process, query, analyze, stats commands working) - Tests: 48 passed in 100.88s (zero regressions) - Time to fix: 35 minutes (vs 40-150 estimated) Files Modified: - src/exness_data_preprocess/**init**.py (2 changes) - examples/basic_usage.py (3 changes) - examples/batch_processing.py (1 change) - src/exness_data_preprocess/api.py (NEW, 267 lines) - CLAUDE.md (4 changes) - docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-15.md (implementation results) Closes all 7 issues from FUNCTIONALITY_VALIDATION_REPORT_2025-10-15.md
56
+
57
+ - **v1.6.0**: Implement minute-level session detection (was checking midnight only) ## Critical Bug Fix **Problem**: Session flags were checked at MIDNIGHT timestamps then applied to all minutes of that day. For Tokyo (9:00-15:00 JST), midnight is NEVER during trading hours, so all session flags were incorrectly 0. **Root Cause** (ohlc_generator.py:151-184): - Line 152-153: Queried DISTINCT DATES (not timestamps) - Line 158: Created midnight timestamps from dates - Line 183: Applied midnight flag to ALL minutes via DATE match **Solution**: 1. Query ALL timestamps from ohlc_1m (not just unique dates) 2. Check session flags for EACH minute individually 3. Update database with exact timestamp match (not DATE match) ## Validation Results ### Tokyo Stock Exchange (XTKS) ✅ Lunch break (11:30-12:29 JST): 0/60 flagged (correct) ✅ Morning session (9:00-11:29 JST): 150/150 flagged (correct) ✅ Afternoon session (12:30-15:00 JST): 150/151 flagged (correct) ### Tokyo Extended Hours (Nov 5, 2024 transition) ✅ Before Nov 5: Closes 14:59 JST (15:00 close time) ✅ After Nov 5: Closes 15:29 JST (15:30 close time) ✅ Extended hours (15:00-15:30): 30/31 minutes flagged ### Test Suite ✅ All 48 tests pass ✅ Zero regressions ## Impact **Breaking Change**: Existing v1.6.0 databases need regeneration. - Previous: Session flags all 0 for Tokyo, Hong Kong, Singapore - Fixed: Session flags now correctly respect trading hours AND lunch breaks ## Implementation Details - **Before**: Date-level detection at midnight (broken for v1.6.0) - **After**: Minute-level detection using exchange_calendars.is_open_on_minute() - **Performance**: Acceptable (30-60s for 450K rows based on research) - **Lunch breaks**: Automatically handled by exchange_calendars - **Trading hour changes**: Automatically handled (e.g., Tokyo Nov 5, 2024) ## Research Backing 5 parallel research agents unanimously recommended this approach: - Option A: Minute-level Python detection ✅ (implemented) - Option B: SQL-based detection ❌ (181+ lines, no holiday support) - Option C: Hybrid approach ✅ (what we're doing) References: - /tmp/test_lunch_simple.py (validation script) - /tmp/test_tokyo_extended_hours.py (extended hours validation) - /tmp/test_tokyo_lunch_boundaries.py (boundary verification)
58
+
59
+ ### 💅 Code Style
60
+
61
+ - Apply pre-commit auto-fixes (ruff format, end-of-file)
62
+
63
+ ### 📚 Documentation
64
+
65
+ - Update all schema references from 9-column to 13-column (v1.2.0) Update outdated "9-column" or "Phase7 9 columns" references to "13-column (v1.2.0)" across all documentation files to reflect the current schema version with normalized spread metrics. Files updated: - GITHUB_PYPI_SETUP.md - Release notes reference - PYDANTIC_REFACTORING_PLAN.md - API documentation and examples (4 locations) - docs/DATABASE_SCHEMA.md - Version history (2 locations) - docs/README.md - Validation results - docs/UNIFIED_DUCKDB_PLAN_v2.md - Table descriptions and return types (2 locations) - tests/README.md - Test descriptions (2 locations) All outdated schema references now consistently reference the Phase7 13-column (v1.2.0) schema with normalized metrics (range_per_spread, range_per_tick, body_per_spread, body_per_tick). CHANGELOG.md and research/archive files intentionally preserved for historical accuracy.
66
+
67
+ - Fix documentation audit issues (Phase 5 complete, v0.3.1 released) Update planning documents to reflect Phase 5 completion and v0.3.1 release. Update all line counts to actual values after ruff/mypy fixes. Archive completed Pydantic refactoring documents to docs/archive/. **SLO-Correctness-1**: All documentation reflects actual code state **SLO-Correctness-2**: Line counts match wc -l output **SLO-Maintainability-1**: Historical documents archived with version suffix Changes: - RELEASE*NOTES.md: Add proper v0.3.1 release notes (was empty) - REFACTORING_CHECKLIST.md: Mark Phase 5 complete, v0.3.1 released - PHASE7_v1.6.0_REFACTORING_PROGRESS.md: Add Phase 5 details, update metrics - CLAUDE.md: Update all module line counts (414→412, 1146→1124) - Archive PYDANTIC_REFACTORING*_.md → docs/archive/_\_v0.2.0_COMPLETE.md - Add DOCUMENTATION_AUDIT_2025-10-15.md with 15 issues identified/fixed Line Count Corrections (actual vs documented): - processor.py: 414→412 lines - downloader.py: 89→82 lines - database_manager.py: 213→208 lines - gap_detector.py: 163→157 lines - ohlc_generator.py: 210→199 lines - query_engine.py: 283→290 lines Audit Findings: - 7 critical issues resolved (outdated status, wrong line counts, unchecked commits) - 2 high-priority issues resolved (archived Pydantic docs, removed stale dist/) - Documentation now consistent with v0.3.1 release Reference: docs/plans/DOCUMENTATION_AUDIT_2025-10-15.md
68
+
69
+ - Fix documentation audit issues (Phase 5 complete, v0.3.1 released) - Fix RELEASE*NOTES.md with complete v0.3.1 release notes - Update REFACTORING_CHECKLIST.md to Phase 5 complete status - Update PHASE7_v1.6.0_REFACTORING_PROGRESS.md with Phase 5 details - Update all line count references in CLAUDE.md to actual values - Archive PYDANTIC_REFACTORING*\*.md files to docs/archive/ with v0.2.0 suffix - Remove stale dist/ directory (v0.1.0 artifacts) - Create comprehensive audit report at docs/plans/DOCUMENTATION_AUDIT_2025-10-15.md Line count corrections (post-ruff/mypy): - processor.py: 414→412 (-2) - downloader.py: 89→82 (-7) - database_manager.py: 213→208 (-5) - gap_detector.py: 163→157 (-6) - ohlc_generator.py: 210→199 (-11) - query_engine.py: 283→290 (+7) - Total extracted: 1,146→1,124 (-22) Fixes 7 critical issues from documentation audit report.
70
+
71
+ - Fix documentation audit pass 2 issues (line counts and status) - Fix docs/README.md line counts to actual values (412, 82, 208, 157, 199, 290) - Update docs/README.md total extracted lines (1,146 → 1,124) - Update docs/README.md status to Phase 5 Complete (v0.3.1 released) - Update SESSION_2025-10-15_SUMMARY.md with Phase 5 completion details - Add Phase 2-5 completion summary to SESSION_2025-10-15_SUMMARY.md - Update all module statuses from TODO to COMPLETE - Update all phase checkboxes from [ ] to [x] - Update statistics to reflect all phases (6.5 hours, 7 modules, 1,124 lines) - Create DOCUMENTATION_AUDIT_PASS2_2025-10-15.md with 4 issues found Line count corrections (post-ruff/mypy): - processor.py: 414→412 (-2) - downloader.py: 89→82 (-7) - database_manager.py: 213→208 (-5) - gap_detector.py: 163→157 (-6) - ohlc_generator.py: 210→199 (-11) - query_engine.py: 283→290 (+7) - Total extracted: 1,146→1,124 (-22) Fixes 3 of 4 issues from documentation audit pass 2. CHANGELOG.md not edited (auto-generated file).
72
+
73
+ - Remove line count references, add introspection commands Replace volatile line count metrics with stable architecture patterns across all user-facing documentation. Add Makefile with introspection commands for on-demand module statistics. Changes: - Remove 9 line count references from CLAUDE.md - Remove 8 line count references from docs/README.md - Remove 8 line count references from RELEASE_NOTES.md - Remove 8 line count references from CHANGELOG.md - Add Makefile with module-stats, module-complexity, module-deps commands - Add best practices guide: DOCUMENTATION_BEST_PRACTICES_LINE_COUNTS.md - Add validation report: FUNCTIONALITY_VALIDATION_REPORT_2025-10-16.md Rationale: Line counts become stale with formatting, comments, and refactoring. Architecture patterns (facade, thin wrapper) remain stable. Industry research shows 78% of teams struggle with outdated documentation. Implementation adheres to: - Abstractions Over Details principle - Intent Over Implementation principle - SLOs: Availability (raise on errors), Correctness (all counts removed), Observability (audit trail), Maintainability (off-the-shelf tools) Time investment: 65 minutes Annual maintenance saved: ~160 minutes Payback period: 5 months
74
+
75
+ - **CLAUDE.md**: Reorganize as hub-and-spoke with progressive disclosure Restructure CLAUDE.md from 479-line monolithic file to 130-line hub document following Link Farm + Hub-and-Spoke pattern. Eliminate redundant content and establish single source of truth per topic. Changes: - Reduce size 73% (479 lines → 130 lines) - Move Documentation Hub to top (was line 227, now line 11) - Remove detailed implementation (now in docs/README.md) - Remove database schema details (in docs/DATABASE_SCHEMA.md) - Remove research findings (in docs/research/) - Remove absolute file paths (use relative paths) - Add audit report: CLAUDE_MD_AUDIT_2025-10-16.md Organization: - Level 0 (CLAUDE.md): Essentials + hub links - Level 1 (docs/README.md): Architecture overview - Level 2+ (specialized docs): Complete specifications Compliance: - Hub-and-spoke: Hub at top, all major docs linked - Progressive disclosure: Summary → link to details - Single source of truth: No duplicate content - Abstractions over details: Patterns not implementations Validation: - All 10 links verified to exist - Zero redundant content - Zero absolute paths - Zero promotional language Maintenance benefit: Architecture updates now require changes to only one source document (not CLAUDE.md + multiple other docs).
76
+
77
+ - **CLAUDE.md**: Reorganize as hub-and-spoke with verified content migration **Approach**: Verification-first reorganization (create docs BEFORE removing content) **Changes**: - CLAUDE.md: 479 → 159 lines (67% reduction) - Hub positioned at line 11 (was line 227, 96% earlier) - Progressive disclosure: essentials + links to deeper docs - No absolute paths or line numbers (use Makefile introspection) **New Documentation**: - docs/MODULE_ARCHITECTURE.md - Complete module details with SLOs, class names, method signatures (all 7 modules) - docs/plans/CLAUDE_MD_VERIFICATION_CHECKLIST_2025-10-16.md - Systematic verification plan - docs/plans/CLAUDE_MD_VERIFICATION_FINDINGS_2025-10-16.md - Verification results and recommendations **Verification Results**: - ✅ Database schema: EXISTS in docs/DATABASE_SCHEMA.md - ✅ Data sources: EXISTS in docs/EXNESS_DATA_SOURCES.md - ✅ File locations: EXISTS in README.md - ✅ Migration guide: EXISTS in README.md - ❌ Module SLOs: CREATED in docs/MODULE_ARCHITECTURE.md (was only in CLAUDE.md) **Single Source of Truth**: | Topic | Authoritative Document | |-------|----------------------| | Module architecture | docs/MODULE_ARCHITECTURE.md | | Database schema | docs/DATABASE_SCHEMA.md | | Data sources | docs/EXNESS_DATA_SOURCES.md | | API reference | README.md | | File locations | README.md | | Migration guide | README.md | **Lesson Learned**: Always verify content exists elsewhere BEFORE removing from CLAUDE.md
78
+
79
+ - Remove promotional language (audit pass 2) **Audit Scope**: CLAUDE.md + docs/README.md **Pattern**: Link Farm + Hub-and-Spoke with Progressive Disclosure **Finding**: 2 instances of promotional language **Changes**: 1. CLAUDE.md:5 - "Professional forex..." → "Forex..." (remove promotional) 2. docs/README.md:175 - "production-ready" → "validated with 13 months real data" (factual) 3. docs/README.md:221 - Update "Last Updated" to 2025-10-16 **Audit Report**: docs/plans/CLAUDE_MD_AUDIT_2025-10-16_PASS2.md **Pattern Compliance**: - ✅ Hub-and-spoke (hub at line 11 in CLAUDE.md) - ✅ Progressive disclosure (3 levels: essentials → overview → detailed specs) - ✅ Single source of truth (all topics link to authoritative docs) - ✅ No promotional language (2 instances fixed) - ✅ No absolute paths - ✅ Version tracking **Metrics**: - CLAUDE.md: 159 lines (67% reduction from 479) - Hub position: Line 11 (was 227, 96% earlier) - Single source violations: 0
80
+
81
+ - **research**: Add comprehensive trading hours research backing v1.6.0 Add two research documents providing detailed backing for the v1.6.0 architectural decisions: 1. TRADING_HOURS_RESEARCH.md (49K, 1620 lines) - Industry standards (exchange_calendars, pandas_market_calendars, zipline, backtrader, QuantConnect) - Professional data platforms (TradingHours.com, Bloomberg, Reuters) - Scalability patterns (DuckDB, ClickHouse, Arctic, InfluxDB, QuestDB) - Edge cases (DST transitions, historical hour changes, forex specifics) - Architectural patterns (separation of concerns, query-time vs storage) - Recommended implementation with code examples 2. HYBRID_SESSION_DETECTION_ANALYSIS.md (34K, 858 lines) - Architectural analysis of hybrid approach (Option C) - Why holidays can stay date-level (O(1) set lookups) - Why sessions must be minute-level (trading hours, lunch breaks, DST) - DuckDB bulk UPDATE strategies and performance - Optimization techniques for large-scale data enrichment - Comparison to pure SQL and pure Python approaches - Final recommendation: hybrid approach already optimal in v1.6.0 Research findings: - Industry consensus: calendar abstraction + query-time filtering - 5 parallel agents unanimous: minute-level Python detection - Performance: 30-60s for 1 year (400K OHLC bars) is acceptable - Current v1.6.0 implementation uses recommended best practices These documents provide valuable reference for future development and justify the architectural choices made in the v1.6.0 session detection implementation.
82
+
83
+ - **migration**: Fix formatting of midnight bug section
84
+
85
+ - Add v1.6.0 E2E validation results with real Exness data Add comprehensive validation documentation for v1.6.0 schema with 10 global exchange session flags, tested against 355,970 bars of real EURUSD data (12 months, 1.92 GB). Validation Results: - ✅ Tokyo lunch breaks: 100% accuracy (0/59 lunch, 150/150 morning, 151/151 afternoon) - ✅ Holidays: US, UK, major holidays correctly detected - ✅ DST transitions: US DST shift verified (13:30→14:30 UTC) - ✅ Weekend gaps: 48-hour gap, NZ first to open Monday - ✅ Tokyo extended hours: Nov 5 transition (15:00→15:30) detected - ✅ Multi-exchange overlaps: 5 concurrent exchanges, London-NY 120min overlap Architecture Validation: - exchange_calendars.is_open_on_minute() handles all edge cases automatically - Lunch breaks (Tokyo, HK, Singapore) correctly excluded - Schedule changes (Tokyo Nov 5) require zero code modifications - Concurrent flags work correctly (not mutually exclusive) - Ready for production use with v0.4.0 Files: - docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md (11K) - docs/validation/WEEKEND_GAP_VALIDATION_SUMMARY.md (4K) - docs/validation/WORKSPACE_SURVEY_2025-10-17.md (8K)
86
+
87
+ ### 📝 Other Changes
88
+
89
+ - Revert "docs(CLAUDE.md): reorganize as hub-and-spoke with progressive disclosure" This reverts commit 6d0aa9a61c5d6a60bb3238aa7b8a018adf3f2796.
90
+
91
+ ### 🔧 Continuous Integration
92
+
93
+ - Modernize publish workflow with uv and validation pipeline Update GitHub Actions publish workflow to match gapless-crypto-data standards: Build System: - Replace pip+build with uv for consistency with local development - Add UV_SYSTEM_PYTHON=1 environment variable - Use uv sync --dev for dependency installation Validation Pipeline: - Add file encoding validation (UTF-8/ASCII enforcement) - Add ruff linting and format checking - Add pytest test suite execution before build Security: - Add Sigstore artifact signing for published packages - Maintain PyPI Trusted Publishing (OIDC) authentication Configuration: - Change environment name: release → pypi (semantic clarity) - Change artifact name: dist → python-package-distributions (consistency) - Add verbose output to PyPI publish step Security Note: - Added .token-info.md to .gitignore to prevent accidental token documentation commits - Workflow uses OIDC (no API token needed)
94
+
95
+ ### 🧰 Maintenance
96
+
97
+ - **release**: Bump version 0.1.0 → 0.2.0 [skip ci]
98
+
99
+ - **release**: Bump version 0.2.0 → 0.3.0 [skip ci]
100
+
101
+ - **release**: Bump version 0.3.0 → 0.3.1 [skip ci]
102
+
103
+ - Sync commitizen version to 0.4.0
104
+
105
+ ### ✨ Features
106
+
107
+ - Initial commit with v2.0.0 unified DuckDB architecture - Unified single-file DuckDB storage per instrument (eurusd.duckdb) - Phase7 9-column OHLC schema with dual-variant spreads - Sub-15ms query performance with date range filtering - PRIMARY KEY constraints prevent duplicates - Automatic gap detection for incremental updates - DuckDB self-documentation with COMMENT ON statements - GitHub Actions CI/CD with PyPI Trusted Publishing - Pre-commit hooks (ruff, commitizen, basic checks) - Professional README with shields.io badges
108
+
109
+ ### 🐛 Bug Fixes
110
+
111
+ - Force add .pre-commit-config.yaml (was incorrectly gitignored)
112
+
113
+ - Remove .pre-commit-config.yaml from .gitignore Pre-commit config should be version controlled, not ignored.
114
+
115
+ - **pre-commit**: Enable unsafe fixes for ruff to resolve remaining errors
116
+
117
+ - **research**: Resolve remaining linting errors in research scripts - Fix bare except clause in 02_volatility_model_simple.py (E722) - Move math.erf imports to top in 03_liquidity_crisis_detection.py (E402) - Move math.erf imports to top in 04_regime_detection_analysis.py (E402)
118
+
119
+ ### 💅 Code Style
120
+
121
+ - Apply pre-commit formatting fixes - Fix end-of-file newlines in 2 MD files - Apply ruff quote style fixes (200 errors fixed) - Reformat 26 files with ruff-format
122
+
123
+ ### 🔧 CI/CD Improvements
124
+
125
+ - **ci**: Add pre-commit config and basic tests - Add .pre-commit-config.yaml to repository - Create basic test suite (test_basic.py) for CI - Add GITHUB_PYPI_SETUP.md with complete setup instructions Fixes CI failures: - Pre-commit hook now finds config file - Pytest now finds and runs tests successfully
126
+
127
+ ### 🧰 Maintenance
128
+
129
+ - Prepare v0.1.0 release
@@ -17,13 +17,19 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
17
17
 
18
18
  ### AI Assistant Documentation
19
19
  - **[docs/README.md](docs/README.md)** - Architecture, planning, research findings
20
- - **[docs/MODULE_ARCHITECTURE.md](docs/MODULE_ARCHITECTURE.md)** - Complete module documentation with SLOs
20
+ - **[docs/MODULE_ARCHITECTURE.md](docs/MODULE_ARCHITECTURE.md)** - Complete module documentation with SLOs (v1.7.0)
21
21
  - **[docs/DATABASE_SCHEMA.md](docs/DATABASE_SCHEMA.md)** - Complete database schema with self-documentation
22
22
  - **[docs/RESEARCH_PATTERNS.md](docs/RESEARCH_PATTERNS.md)** - Research lifecycle and tool selection (v1.0.0)
23
23
  - **[docs/UNIFIED_DUCKDB_PLAN_v2.md](docs/UNIFIED_DUCKDB_PLAN_v2.md)** - v2.0.0 architecture specification
24
24
  - **[docs/EXNESS_DATA_SOURCES.md](docs/EXNESS_DATA_SOURCES.md)** - Data source variants and URLs
25
25
  - **[Makefile](Makefile)** - Module introspection commands (module-stats, module-complexity, module-deps)
26
26
 
27
+ ### Optimization Plans (v1.7.0)
28
+ - **[docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml](docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml)** - SSoT plan v2.0.0 (2.2x speedup)
29
+ - **[docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml](docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml)** - SSoT plan v2.0.0 (complete coverage)
30
+ - **[docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md](docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md)** - Phase 1 validation
31
+ - **[docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)** - Phase 2 validation
32
+
27
33
  ### Implementation
28
34
  - **src/exness_data_preprocess/** - Source code (7 specialized modules + facade)
29
35
  - **tests/** - Test suite (48 tests, 100% passing)
@@ -43,7 +49,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
43
49
 
44
50
  **Complete Specification**: [`docs/UNIFIED_DUCKDB_PLAN_v2.md`](docs/UNIFIED_DUCKDB_PLAN_v2.md)
45
51
 
46
- ### Module Pattern (v1.3.0)
52
+ ### Module Pattern (v1.7.0)
47
53
  - **Facade orchestrator** (processor.py) coordinating 7 specialized modules
48
54
  - **Separation of concerns** with single-responsibility modules
49
55
  - **SLO-based design** (Availability, Correctness, Observability, Maintainability)
@@ -55,13 +61,34 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
61
  2. **downloader.py** - HTTP download operations
56
62
  3. **tick_loader.py** - CSV parsing
57
63
  4. **database_manager.py** - Database operations
58
- 5. **session_detector.py** - Holiday and session detection
59
- 6. **gap_detector.py** - Incremental update logic
60
- 7. **ohlc_generator.py** - Phase7 OHLC generation
64
+ 5. **session_detector.py** - Holiday and session detection (v1.7.0: vectorized, 2.2x speedup)
65
+ 6. **gap_detector.py** - Incremental update logic (v1.7.0: SQL gap detection, complete coverage)
66
+ 7. **ohlc_generator.py** - Phase7 OHLC generation (v1.7.0: incremental, 7.3x speedup)
61
67
  8. **query_engine.py** - Query operations
62
68
 
63
69
  **Complete Details**: [`docs/MODULE_ARCHITECTURE.md`](docs/MODULE_ARCHITECTURE.md)
64
70
 
71
+ ### Performance Optimizations (v1.7.0)
72
+ - **Incremental OHLC Generation** (Phase 1): 7.3x speedup
73
+ - Optional date-range filtering for regeneration
74
+ - Measured: 8.05s → 1.10s for incremental updates (7 months)
75
+ - SSoT: [`docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md`](docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md)
76
+
77
+ - **Session Vectorization** (Phase 2): 2.2x speedup
78
+ - Pre-compute trading minutes, vectorized .isin() lookup
79
+ - Measured: 5.99s → 2.69s for 302K bars across 10 exchanges
80
+ - Combined Phase 1+2: **~16x total speedup** (8.05s → 0.50s)
81
+ - SSoT: [`docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml`](docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml)
82
+ - Validation: [`docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md`](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)
83
+
84
+ - **SQL Gap Detection** (Phase 3): Complete coverage + 46% LOC reduction
85
+ - SQL EXCEPT query detects ALL gaps (internal + edges)
86
+ - Bug fix: Now detects internal gaps missed by Python MIN/MAX
87
+ - Measured: 41 → 42 gaps detected (spike test validation)
88
+ - SSoT: [`docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml`](docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml)
89
+
90
+ **Pattern**: Spike test first (validate theory) → Implement → Iterative SSoT plan updates
91
+
65
92
  ### Schema (v1.6.0)
66
93
  - **Phase7 30-column OHLC** with dual-variant spreads
67
94
  - **BID-only OHLC** from Raw_Spread execution prices
@@ -163,8 +190,8 @@ doppler run --project claude-config --config dev -- uv publish --token "$PYPI_TO
163
190
 
164
191
  ---
165
192
 
166
- **Version**: 2.0.0 (Architecture) + 1.3.0 (Implementation) + 1.0.0 (Research Patterns)
167
- **Last Updated**: 2025-10-17
193
+ **Version**: 2.0.0 (Architecture) + 1.7.0 (Implementation) + 1.0.0 (Research Patterns)
194
+ **Last Updated**: 2025-10-18
168
195
  **Architecture**: Unified Single-File DuckDB Storage with Incremental Updates
169
- **Implementation**: Facade Pattern with 7 Specialized Modules
196
+ **Implementation**: Facade Pattern with 7 Specialized Modules + Performance Optimizations (~16x speedup)
170
197
  **Research**: Hybrid Materialization (pandas/Polars exploration, DuckDB validated results)
@@ -0,0 +1,270 @@
1
+ # 📚 Documentation Hub
2
+
3
+ **Welcome!** This page organizes all documentation from beginner to advanced, helping you find exactly what you need.
4
+
5
+ ---
6
+
7
+ ## 🎯 Quick Start (5 Minutes)
8
+
9
+ New to this project? Start here:
10
+
11
+ 1. **[README.md](README.md)** - Installation, features, and quick start guide
12
+ 2. **[Basic Usage Examples](examples/basic_usage.py)** - Download data, query OHLC/ticks, coverage checks
13
+ 3. **[Contributing Guide](CONTRIBUTING.md)** - Want to contribute? Start here
14
+
15
+ **Next Steps**: Read [Data Sources](#-understanding-the-data) below to understand what data you're working with.
16
+
17
+ ---
18
+
19
+ ## 📖 Beginner Path (Your First Hour)
20
+
21
+ Follow this path if you're new to the project:
22
+
23
+ ### 1. Getting Started
24
+ - **[README.md](README.md)** - Main documentation with installation and API reference
25
+ - **[Basic Usage Examples](examples/basic_usage.py)** - 6 practical code examples you can run immediately
26
+ - **[Contributing Guide](CONTRIBUTING.md)** - Development setup, code quality, testing
27
+
28
+ ### 2. Understanding the Data
29
+ - **[Exness Data Sources](docs/EXNESS_DATA_SOURCES.md)** - Raw_Spread vs Standard variants, data quality characteristics
30
+ - Learn about 97.81% zero-spreads in Raw_Spread (execution prices)
31
+ - Understand tick density and storage estimates
32
+ - See CSV format and download patterns
33
+
34
+ ### 3. First Queries
35
+ - **[Database Schema](docs/DATABASE_SCHEMA.md)** - Phase7 30-column OHLC structure
36
+ - 4 tables: raw_spread_ticks, standard_ticks, ohlc_1m, metadata
37
+ - SQL query examples and performance benchmarks
38
+ - 10 global exchange sessions with trading hours
39
+
40
+ **Checkpoint**: After this section, you should be able to download data and run basic queries.
41
+
42
+ ---
43
+
44
+ ## 🚀 Intermediate Path (Production Usage)
45
+
46
+ Ready for multi-instrument processing and advanced queries:
47
+
48
+ ### 4. Advanced Workflows
49
+ - **[Batch Processing Examples](examples/batch_processing.py)** - Multi-instrument parallel processing
50
+ - Sequential and parallel processing patterns
51
+ - Error handling and retry logic
52
+ - Progress monitoring with tqdm
53
+
54
+ ### 5. Research Methodology
55
+ - **[Research Patterns](docs/RESEARCH_PATTERNS.md)** - pandas/Polars vs DuckDB tool selection
56
+ - Research lifecycle: Explore → Validate → Graduate → Query
57
+ - Hybrid materialization pattern
58
+ - Performance benchmarks (ASOF joins: pandas 0.04s vs DuckDB 0.89s)
59
+
60
+ ### 6. Schema Deep Dive
61
+ - **[Schema v1.6.0 Migration Guide](docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md)** - Breaking changes from v1.5.0
62
+ - 19 → 30 columns (added 10 exchange sessions + 1 major holiday flag)
63
+ - Midnight detection bug fix (critical for session flags)
64
+ - Migration steps and validation
65
+
66
+ **Checkpoint**: You can now process multiple instruments efficiently and choose the right tools for research.
67
+
68
+ ---
69
+
70
+ ## 🏗️ Advanced Path (Architecture & Development)
71
+
72
+ For contributors and researchers who need deep understanding:
73
+
74
+ ### 7. System Architecture
75
+ - **[Module Architecture](docs/MODULE_ARCHITECTURE.md)** ⭐ *v1.3.1 - Verified Accurate*
76
+ - Facade pattern with 6 module instances + 1 static utility
77
+ - SLO-based design (Availability, Correctness, Observability, Maintainability)
78
+ - Complete data flow with 3 Mermaid diagrams
79
+ - See [Architecture Audit](docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md) for verification
80
+
81
+ - **[Unified DuckDB Plan v2.0.0](docs/UNIFIED_DUCKDB_PLAN_v2.md)** - Storage architecture
82
+ - Single-file per instrument (eurusd.duckdb)
83
+ - Incremental updates with gap detection
84
+ - PRIMARY KEY prevents duplicates
85
+
86
+ ### 8. Trading Hours Implementation
87
+ - **[Trading Hours Research](docs/TRADING_HOURS_RESEARCH.md)** - Industry analysis (49KB comprehensive)
88
+ - 5 quant finance libraries studied
89
+ - 3 professional platforms analyzed
90
+ - 4 time-series databases compared
91
+ - Unanimous consensus for calendar abstraction
92
+
93
+ - **[Hybrid Session Detection Analysis](docs/research/HYBRID_SESSION_DETECTION_ANALYSIS.md)** - Implementation rationale
94
+ - Why holidays are date-level but sessions are minute-level
95
+ - DuckDB performance optimization
96
+ - Bulk UPDATE strategies
97
+
98
+ ### 9. Validation & Quality Assurance
99
+ - **[E2E Validation Results v1.6.0](docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md)** ⭐ *100% Accuracy*
100
+ - 355,970 bars of real EURUSD data (12 months, 1.92 GB)
101
+ - Tokyo lunch breaks: 0/59 lunch, 150/150 morning, 151/151 afternoon
102
+ - Holidays, DST, weekend gaps, exchange overlaps all verified
103
+
104
+ - **[Weekend Gap Validation](docs/validation/WEEKEND_GAP_VALIDATION_SUMMARY.md)** - Timezone-aware weekend handling
105
+ - 48-hour forex gap (Friday 22:00 UTC → Sunday 22:00 UTC)
106
+ - New Zealand opens first (Monday 10:00 NZST = Sunday 21:00 UTC)
107
+
108
+ - **[Architecture Audit Report](docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md)** - Documentation accuracy verification
109
+ - 78% → 100% accuracy after comprehensive audit
110
+ - All constructor signatures verified
111
+ - HTTP library, type signatures, data flow corrected
112
+
113
+ ### 10. Performance Optimizations (v0.5.0)
114
+ - **[Phase 1 Spike Test Results](docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md)** ⭐ *7.3x Speedup*
115
+ - Incremental OHLC generation: 8.05s → 1.10s for updates
116
+ - 303K bars regeneration vs 43K incremental update
117
+ - Measured: 86.3% time reduction
118
+
119
+ - **[Phase 2 SSoT Plan](docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml)** - Session vectorization specification
120
+ - OpenAPI 3.1.0 machine-readable plan with SLOs
121
+ - Version tracking: v1.0.0 (initial) → v2.0.0 (completed)
122
+ - Implementation discoveries and nuances documented
123
+
124
+ - **[Phase 2 Spike Test Results](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)** ⭐ *2.2x Speedup*
125
+ - Vectorized session detection: 5.99s → 2.69s for 302K bars
126
+ - 10 global exchange sessions processed in parallel
127
+ - Combined Phase 1+2: ~16x total speedup (8.05s → 0.50s)
128
+
129
+ - **[Phase 3 SSoT Plan](docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml)** - SQL gap detection specification
130
+ - OpenAPI 3.1.0 specification with implementation strategy
131
+ - Bug fix documentation: Internal gaps now detected
132
+ - 46% LOC reduction (62 → 34 lines)
133
+
134
+ - **[CHANGELOG v0.5.0](CHANGELOG.md)** - Complete release notes with measured results
135
+
136
+ **Checkpoint**: You understand the optimization strategies and spike-test-first validation methodology.
137
+
138
+ ---
139
+
140
+ ## 📊 Research Projects (Deep Dives)
141
+
142
+ Published research with reproduction guides:
143
+
144
+ ### Zero-Spread Deviation Analysis
145
+ - **[Project Overview](docs/research/eurusd-zero-spread-deviations/README.md)** - 16-month validation study
146
+ - **[Methodology](docs/research/eurusd-zero-spread-deviations/01-methodology.md)** - Research approach
147
+ - **[Baseline Analysis](docs/research/eurusd-zero-spread-deviations/02-baseline-sep2024.md)** - September 2024 baseline
148
+ - **[Multi-Period Validation](docs/research/eurusd-zero-spread-deviations/03-multiperiod-validation.md)** - Extended validation
149
+ - **[Discoveries](docs/research/eurusd-zero-spread-deviations/04-discoveries-and-plan-evolution.md)** - Plan evolution
150
+ - **[Reproduction Guide](docs/research/eurusd-zero-spread-deviations/scripts/reproduction_guide.md)** - How to reproduce results
151
+
152
+ ### Spread Variant Analysis
153
+ - **[Project Overview](docs/research/eurusd-spread-analysis/README.md)** - Modal-band-excluded variance estimation
154
+ - **[Methodology](docs/research/eurusd-spread-analysis/01-methodology.md)** - Research design
155
+ - **[Mode-Truncated Analysis](docs/research/eurusd-spread-analysis/02-mode-truncated-analysis.md)** - Truncation approach
156
+ - **[Hurdle Model](docs/research/eurusd-spread-analysis/03-hurdle-model-analysis.md)** - Two-part model
157
+ - **[Temporal Patterns](docs/research/eurusd-spread-analysis/04-temporal-patterns.md)** - Time-based analysis
158
+ - **[Recommendations](docs/research/eurusd-spread-analysis/05-final-recommendations.md)** - Final guidance
159
+ - **[Reproduction Guide](docs/research/eurusd-spread-analysis/scripts/reproduction_guide.md)** - How to reproduce
160
+
161
+ ### Compression Benchmarks
162
+ - **[Compression Study](docs/research/compression-benchmarks/README.md)** - Why Parquet + Zstd-22
163
+
164
+ ---
165
+
166
+ ## 📚 Reference Documentation
167
+
168
+ Quick lookups and specific information:
169
+
170
+ ### API & Schema
171
+ - **[README.md](README.md)** - Complete API reference with examples
172
+ - **[Database Schema](docs/DATABASE_SCHEMA.md)** - 30-column Phase7 OHLC specification
173
+ - **[CLAUDE.md](CLAUDE.md)** - AI assistant quick reference (architecture summary)
174
+
175
+ ### Version History
176
+ - **[CHANGELOG.md](CHANGELOG.md)** - Version history (Keep a Changelog format)
177
+ - **[RELEASE_NOTES.md](RELEASE_NOTES.md)** - Human-readable release notes
178
+ - **[AUTHORS.md](AUTHORS.md)** - Project contributors
179
+
180
+ ### Testing
181
+ - **[Test Suite Documentation](tests/README.md)** - 48 tests, coverage reports
182
+ - **[Makefile](Makefile)** - Build commands (`make test`, `make module-stats`, etc.)
183
+
184
+ ---
185
+
186
+ ## 🔧 Development & Planning
187
+
188
+ Internal documentation for contributors:
189
+
190
+ ### Current Plans
191
+ - **[Documentation Hub](docs/README.md)** - Hub-and-spoke architecture with progressive disclosure
192
+ - **[Implementation Plan](docs/implementation-plan.yaml)** - Machine-readable implementation plan with SLOs
193
+ - **[Planning Index](docs/planning-index.yaml)** - Index of all planning documents
194
+
195
+ ### Migration & Refactoring
196
+ - **[Schema v1.6.0 Migration Guide](docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md)** - v1.5.0 → v1.6.0 breaking changes
197
+ - **[Phase7 v1.6.0 Progress](docs/plans/PHASE7_v1.6.0_REFACTORING_PROGRESS.md)** - Refactoring progress tracking
198
+ - **[Refactoring Checklist](docs/plans/REFACTORING_CHECKLIST.md)** - Comprehensive checklist
199
+
200
+ ### Quality Audits
201
+ - **[Workspace Survey](docs/validation/WORKSPACE_SURVEY_2025-10-17.md)** - Organization assessment (2025-10-17)
202
+ - **[Architecture Audit](docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md)** - Documentation accuracy (2025-10-17)
203
+ - **[Functionality Validation](docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-16.md)** - Feature testing (2025-10-16)
204
+
205
+ ---
206
+
207
+ ## 📁 Archive
208
+
209
+ Historical documentation (for reference only):
210
+
211
+ - **[Unified DuckDB Plan v1.0.0](docs/archive/UNIFIED_DUCKDB_PLAN_v1.0.0_LEGACY.md)** - Legacy architecture (superseded by v2.0.0)
212
+ - **[Pydantic Refactoring Plan](docs/archive/PYDANTIC_REFACTORING_PLAN_v0.2.0_COMPLETE.md)** - Completed v0.2.0
213
+ - **[E2E Testing Plan](tests/archive/E2E_TESTING_PLAN_v1.0.0.md)** - Archived testing approach
214
+
215
+ ---
216
+
217
+ ## 🗺️ Documentation Organization
218
+
219
+ This project uses a **hub-and-spoke model** with progressive disclosure:
220
+
221
+ ```
222
+ DOCUMENTATION.md (You are here - Hub)
223
+ ├── Beginner Path → README → Examples → Data Sources
224
+ ├── Intermediate Path → Batch Processing → Research Patterns → Migration Guide
225
+ ├── Advanced Path → Module Architecture → DuckDB Plan → Trading Hours Research
226
+ ├── Research Projects → Zero-Spread Analysis → Spread Variant Analysis
227
+ └── Reference → API Docs → Schema → Testing
228
+ ```
229
+
230
+ **Navigation Tips**:
231
+ - 🎯 = Start here if you're new
232
+ - ⭐ = Critical documentation (verified accurate)
233
+ - All links use relative URLs from project root
234
+ - Use browser search (Ctrl+F / Cmd+F) to find specific topics
235
+
236
+ ---
237
+
238
+ ## 🤔 Which Documentation Should I Read?
239
+
240
+ ### "I just want to download forex data and analyze it"
241
+ → [README.md](README.md) → [Basic Usage Examples](examples/basic_usage.py)
242
+
243
+ ### "I need to process multiple currency pairs efficiently"
244
+ → [Batch Processing Examples](examples/batch_processing.py)
245
+
246
+ ### "I want to write SQL queries against tick data"
247
+ → [Database Schema](docs/DATABASE_SCHEMA.md)
248
+
249
+ ### "I'm doing quantitative research with temporal analysis"
250
+ → [Research Patterns](docs/RESEARCH_PATTERNS.md) → [Database Schema](docs/DATABASE_SCHEMA.md)
251
+
252
+ ### "I want to contribute code to this project"
253
+ → [Module Architecture](docs/MODULE_ARCHITECTURE.md) → [Contributing Guide](CONTRIBUTING.md)
254
+
255
+ ### "I need to understand trading hour detection"
256
+ → [Trading Hours Research](docs/TRADING_HOURS_RESEARCH.md) → [E2E Validation](docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md)
257
+
258
+ ---
259
+
260
+ ## 📞 Getting Help
261
+
262
+ - **Issues**: [GitHub Issues](https://github.com/terrylica/exness-data-preprocess/issues)
263
+ - **Contributing**: See [CONTRIBUTING.md](CONTRIBUTING.md)
264
+ - **License**: [MIT License](LICENSE)
265
+
266
+ ---
267
+
268
+ **Last Updated**: 2025-10-18
269
+ **Documentation Version**: v1.7.0
270
+ **Total Documentation Files**: 70 markdown files + 2 Python examples + 4 YAML specs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exness-data-preprocess
3
- Version: 0.4.0
3
+ Version: 0.6.0
4
4
  Summary: Professional Exness forex tick data preprocessing with optimal compression (Parquet Zstd-22) and DuckDB OHLC generation. Provides efficient storage (9% smaller than ZIP) with lossless precision and direct queryability.
5
5
  Project-URL: Homepage, https://github.com/terrylica/exness-data-preprocess
6
6
  Project-URL: Documentation, https://github.com/terrylica/exness-data-preprocess#readme
@@ -64,6 +64,7 @@ Professional forex tick data preprocessing with unified single-file DuckDB stora
64
64
  - **Incremental Updates**: Automatic gap detection and download only missing months
65
65
  - **Dual-Variant Storage**: Raw_Spread (primary) + Standard (reference) in same database
66
66
  - **Phase7 OHLC Schema**: 30-column bars (v1.6.0) with dual spreads, tick counts, normalized metrics, and 10 global exchange sessions with trading hour detection
67
+ - **High Performance**: Incremental OHLC generation (7.3x speedup), vectorized session detection (2.2x speedup), SQL gap detection with complete coverage
67
68
  - **Fast Queries**: Date range queries with sub-15ms performance
68
69
  - **On-Demand Resampling**: Any timeframe (5m, 1h, 1d) resampled in <15ms
69
70
  - **PRIMARY KEY Constraints**: Prevents duplicate data during incremental updates
@@ -439,6 +440,30 @@ Data is sourced from Exness's public tick data repository:
439
440
  | On-demand resampling | Any timeframe in <15ms |
440
441
  | SQL filter support | Direct SQL WHERE clauses on ticks |
441
442
 
443
+ ### Performance Optimizations (v0.5.0)
444
+
445
+ **Incremental OHLC Generation** - 7.3x speedup for updates:
446
+ - Full regeneration: 8.05s (303K bars, 7 months)
447
+ - Incremental update: 1.10s (43K new bars, 1 month)
448
+ - Implementation: Optional date-range parameters for partial regeneration
449
+ - Validation: [`docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md`](docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md)
450
+
451
+ **Vectorized Session Detection** - 2.2x speedup for trading hour detection:
452
+ - Current approach: 5.99s (302K bars, 10 exchanges)
453
+ - Vectorized approach: 2.69s (302K bars, 10 exchanges)
454
+ - Combined Phase 1+2: ~16x total speedup (8.05s → 0.50s)
455
+ - Implementation: Pre-compute trading minutes, vectorized `.isin()` lookup
456
+ - SSoT: [`docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml`](docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml)
457
+ - Validation: [`docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md`](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)
458
+
459
+ **SQL Gap Detection** - Complete coverage with 46% code reduction:
460
+ - Bug fix: Python approach missed internal gaps (41 detected vs 42 actual)
461
+ - SQL EXCEPT operator detects ALL gaps (before + within + after existing data)
462
+ - Code reduced from 62 lines to 34 lines (46% reduction)
463
+ - SSoT: [`docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml`](docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml)
464
+
465
+ **Release Notes**: See [`CHANGELOG.md`](CHANGELOG.md) for complete v0.5.0 details
466
+
442
467
  ## API Reference
443
468
 
444
469
  ### ExnessDataProcessor
@@ -503,6 +528,8 @@ Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
503
528
 
504
529
  ## Additional Documentation
505
530
 
531
+ **[📚 Complete Documentation Hub](DOCUMENTATION.md)** - Organized guide from beginner to advanced (72+ documents)
532
+
506
533
  - **Basic Usage Examples**: See `examples/basic_usage.py`
507
534
  - **Batch Processing**: See `examples/batch_processing.py`
508
535
  - **Architecture Details**: See `docs/UNIFIED_DUCKDB_PLAN_v2.md`