compass-kb-validation 4.1.0__tar.gz → 4.2.1__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 (197) hide show
  1. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/PKG-INFO +45 -2
  2. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/README.md +44 -1
  3. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/__init__.py +1 -1
  4. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/ask.py +9 -1
  5. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/benchmark.py +58 -1
  6. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/check_catalog.py +7 -0
  7. compass_kb_validation-4.2.1/compass/chunk_ref.py +61 -0
  8. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/cli.py +236 -14
  9. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/config/__init__.py +135 -6
  10. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/content_fidelity.py +189 -68
  11. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/content_inspect.py +34 -8
  12. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/corpus.py +102 -4
  13. compass_kb_validation-4.2.1/compass/cross_index.py +361 -0
  14. compass_kb_validation-4.2.1/compass/findings.py +486 -0
  15. compass_kb_validation-4.2.1/compass/manifest.py +155 -0
  16. compass_kb_validation-4.2.1/compass/metadata_checks.py +416 -0
  17. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/pdf_support.py +14 -0
  18. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/pipeline/__init__.py +1 -1
  19. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/__init__.py +10 -1
  20. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/extractor.py +50 -4
  21. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/snapshot.py +11 -8
  22. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/source.py +2 -0
  23. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/vectorstore.py +63 -0
  24. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/readiness.py +66 -10
  25. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/remediation.py +15 -5
  26. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/__init__.py +758 -264
  27. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/export.py +4 -1
  28. compass_kb_validation-4.2.1/compass/report/fidelity_view.py +419 -0
  29. compass_kb_validation-4.2.1/compass/structure_checks.py +816 -0
  30. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/text_probes.py +46 -4
  31. compass_kb_validation-4.2.1/compass/triage.py +295 -0
  32. compass_kb_validation-4.2.1/compass/validators/metadata_checks.py +132 -0
  33. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/redis_chunks.py +2 -1
  34. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/registry.py +12 -1
  35. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/retrieval_quality.py +18 -3
  36. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/s3_storage.py +2 -1
  37. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass_kb_validation.egg-info/PKG-INFO +45 -2
  38. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass_kb_validation.egg-info/SOURCES.txt +15 -0
  39. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/discover_and_validate.py +160 -8
  40. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_check_catalog.py +3 -1
  41. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_drift.py +7 -0
  42. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_grounding_rollup.py +3 -1
  43. compass_kb_validation-4.2.1/tests/test_metadata_checks.py +263 -0
  44. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_redis_chunks.py +11 -3
  45. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_report_store_section.py +1 -1
  46. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_reporting.py +12 -5
  47. compass_kb_validation-4.2.1/tests/test_structure_checks.py +386 -0
  48. compass_kb_validation-4.2.1/tests/test_tooling_420.py +548 -0
  49. compass_kb_validation-4.2.1/tests/test_v420_gate.py +355 -0
  50. compass_kb_validation-4.2.1/tests/test_v420_report_truth.py +458 -0
  51. compass_kb_validation-4.2.1/tests/test_v421_report.py +41 -0
  52. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/LICENSE +0 -0
  53. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/__main__.py +0 -0
  54. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/alias.py +0 -0
  55. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/baseline.py +0 -0
  56. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/chunk_coherence.py +0 -0
  57. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/chunk_eval.py +0 -0
  58. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/chunk_integrity.py +0 -0
  59. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/citation.py +0 -0
  60. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/config_lint.py +0 -0
  61. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/corpus_health.py +0 -0
  62. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/diagnostics.py +0 -0
  63. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/diff.py +0 -0
  64. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/drift.py +0 -0
  65. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/embedding_drift.py +0 -0
  66. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/eval_enrich.py +0 -0
  67. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/eval_interop.py +0 -0
  68. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/evidence.py +0 -0
  69. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/grounding.py +0 -0
  70. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/grounding_diff.py +0 -0
  71. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/grounding_rollup.py +0 -0
  72. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/gt_lint.py +0 -0
  73. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/health.py +0 -0
  74. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/incremental.py +0 -0
  75. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/init_wizard.py +0 -0
  76. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/lineage.py +0 -0
  77. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/live_dashboard.py +0 -0
  78. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/mcp_server.py +0 -0
  79. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/models/__init__.py +0 -0
  80. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/notifications.py +0 -0
  81. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/profiler.py +0 -0
  82. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/provenance.py +0 -0
  83. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/embedding.py +0 -0
  84. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/graph.py +0 -0
  85. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/providers/storage.py +0 -0
  86. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/quality_gate.py +0 -0
  87. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/_report_css.py +0 -0
  88. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/_report_js.py +0 -0
  89. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/analysis.py +0 -0
  90. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/audit.py +0 -0
  91. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/grounding_report.py +0 -0
  92. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/report/shell.py +0 -0
  93. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/retrieval_analysis.py +0 -0
  94. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/simulate.py +0 -0
  95. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/snapshot_doctor.py +0 -0
  96. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/text_match.py +0 -0
  97. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/trend_tracker.py +0 -0
  98. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/utils/__init__.py +0 -0
  99. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/__init__.py +0 -0
  100. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/api_upload.py +0 -0
  101. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/base.py +0 -0
  102. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/base_sparql.py +0 -0
  103. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/cross_stage.py +0 -0
  104. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/graphdb_metadata.py +0 -0
  105. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass/validators/neptune_metadata.py +0 -0
  106. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass_kb_validation.egg-info/dependency_links.txt +0 -0
  107. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass_kb_validation.egg-info/entry_points.txt +0 -0
  108. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass_kb_validation.egg-info/requires.txt +0 -0
  109. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/compass_kb_validation.egg-info/top_level.txt +0 -0
  110. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/ingestion_validation/__init__.py +0 -0
  111. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/profile_kb.py +0 -0
  112. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/pyproject.toml +0 -0
  113. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/run_validation.py +0 -0
  114. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/setup.cfg +0 -0
  115. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_alias.py +0 -0
  116. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_alias_disambiguation.py +0 -0
  117. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_alias_temporal.py +0 -0
  118. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_alt_adapters.py +0 -0
  119. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_analysis_report.py +0 -0
  120. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_api_upload.py +0 -0
  121. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_ask.py +0 -0
  122. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_baseline.py +0 -0
  123. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_benchmark.py +0 -0
  124. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_calibrate_truth.py +0 -0
  125. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_chunk_eval.py +0 -0
  126. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_chunk_integrity.py +0 -0
  127. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_chunk_structure_checks.py +0 -0
  128. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_citation.py +0 -0
  129. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_citation_levels.py +0 -0
  130. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_cli.py +0 -0
  131. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_cli_commands.py +0 -0
  132. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_compat_shim.py +0 -0
  133. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_config.py +0 -0
  134. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_config_lint.py +0 -0
  135. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_content_fidelity.py +0 -0
  136. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_content_inspect.py +0 -0
  137. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_corpus.py +0 -0
  138. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_corpus_health.py +0 -0
  139. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_coverage.py +0 -0
  140. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_coverage_and_drift_config.py +0 -0
  141. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_cross_stage.py +0 -0
  142. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_diagnostics.py +0 -0
  143. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_diff.py +0 -0
  144. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_discover_cli.py +0 -0
  145. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_discovery_parallel.py +0 -0
  146. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_embedding_contract.py +0 -0
  147. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_embedding_drift.py +0 -0
  148. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_eval_enrich.py +0 -0
  149. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_eval_interop.py +0 -0
  150. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_evidence.py +0 -0
  151. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_fidelity_precision.py +0 -0
  152. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_gate.py +0 -0
  153. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_graph_transport.py +0 -0
  154. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_graph_validators.py +0 -0
  155. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_grounding.py +0 -0
  156. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_grounding_report.py +0 -0
  157. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_health.py +0 -0
  158. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_incremental.py +0 -0
  159. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_init_wizard.py +0 -0
  160. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_lineage.py +0 -0
  161. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_manifest.py +0 -0
  162. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_mcp.py +0 -0
  163. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_measurement_fixes.py +0 -0
  164. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_migration.py +0 -0
  165. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_models.py +0 -0
  166. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_multi_index.py +0 -0
  167. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_neptune_bugfixes.py +0 -0
  168. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_neptune_bugfixes2.py +0 -0
  169. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_notifications.py +0 -0
  170. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_pipeline.py +0 -0
  171. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_profiler.py +0 -0
  172. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_providers.py +0 -0
  173. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_quality_gate.py +0 -0
  174. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_readiness.py +0 -0
  175. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_registry.py +0 -0
  176. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_remediation.py +0 -0
  177. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_requirements_config.py +0 -0
  178. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_retrieval_assertions.py +0 -0
  179. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_retrieval_fields.py +0 -0
  180. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_retrieval_quality.py +0 -0
  181. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_review_hardening.py +0 -0
  182. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_run_cli.py +0 -0
  183. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_simulate.py +0 -0
  184. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_source_exclusions.py +0 -0
  185. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_source_verification.py +0 -0
  186. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_sources.py +0 -0
  187. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_storage_validator.py +0 -0
  188. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_trends.py +0 -0
  189. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_universal_concerns.py +0 -0
  190. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_utils.py +0 -0
  191. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_v402_fixes.py +0 -0
  192. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_v410_any_pipeline.py +0 -0
  193. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_v410_gate.py +0 -0
  194. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_v410_portability.py +0 -0
  195. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_v4_defect_fixes.py +0 -0
  196. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_vector_fastpath.py +0 -0
  197. {compass_kb_validation-4.1.0 → compass_kb_validation-4.2.1}/tests/test_vectorstore_filters.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compass-kb-validation
3
- Version: 4.1.0
3
+ Version: 4.2.1
4
4
  Summary: Knowledge-base readiness validation for RAG & AI agents — config-driven, deterministic pipeline integrity checks.
5
5
  Author: COMPASS
6
6
  License: MIT
@@ -343,10 +343,12 @@ eval:
343
343
  figure_regions: snapshot # snapshot | off: numbers inside figures reported apart
344
344
  figure_types: [figure, chart, image] # snapshot element types that are figures
345
345
  lost_passages_allowed: 0 # named lost passages tolerated (snapshot baseline)
346
+ figure_words: gate # gate | report: lost words inside figures gate or not
346
347
  number_format: "1,234.5" # or "1.234,5" | "1 234,5" | "1'234.5"
347
348
  source_exclusions: # nothing is excluded that is not listed here
348
349
  repeated_on_pages: 5 # headers and footers
349
- min_chars: 75 # small fragments
350
+ min_chars: 75 # small fragments (every element type)
351
+ figure_min_chars: 75 # figure elements this short, dropped by design
350
352
  patterns: ["(?i)^past performance"] # by-design notices
351
353
  page_roles: {disclaimer: "(?i)^important disclosures"}
352
354
  roles: [marginalia, logo, attestation] # read from a snapshot, so they need one
@@ -408,6 +410,44 @@ fails readiness when too few were read. `compass doctor` reads the snapshots of
408
410
  says which location and version holds the element list, and prints a `formats` entry to paste when
409
411
  the mapping is wrong.
410
412
 
413
+ A passage the extractor produced and the store lacks is a pipeline drop, and it fails `readiness`
414
+ by default (`fidelity_pipeline_drop`); text missing from the extractor too stays advisory. Table
415
+ elements are compared like any passage, image links (`![name](url)`) and URLs are ignored on every
416
+ side, and a `Source:` line inside a text element is judged as a caption.
417
+
418
+ Structure is checked against the snapshot too, under `eval.structure` (every check reports "not
419
+ checked" when its input is missing): a heading stored with its section, a table in one chunk,
420
+ reading order, every page with text covered by a chunk, the page a chunk states, every source image
421
+ represented by a figure element, and pages whose text layer has no Unicode map. The chunk box and
422
+ chunk type checks run when the index carries those fields (`chunk_box_field`, `chunk_type_field`).
423
+
424
+ Index settings that change what every check reads:
425
+
426
+ ```yaml
427
+ redis:
428
+ text_field: content # the field holding chunk text
429
+ page_base: 0 # the index counts pages from 0; every page is read 1-based
430
+ production_index: kb_merged # the index production queries; reports say when they read another
431
+ coverage: full # every sampled check reads every item (default: sampled)
432
+ triage_file: config/triage.yaml # decisions kept between runs (see below)
433
+ ```
434
+
435
+ **Triage.** `triage_file` lists decisions on findings: `{key, decision: defect | by_design | false,
436
+ reason, owner, expires}`. Every finding carries a stable id and a key (`check|index|document|chunk`,
437
+ globs allowed); `by_design` and `false` never gate, expired entries are ignored with a warning, and
438
+ `compass triage stats` reports each check's precision over the labelled entries. Findings are marked
439
+ new, still open or resolved against the previous run, and `--export-findings DIR` writes one file
440
+ per owner with index, chunk id, chunk index, page and a snippet.
441
+
442
+ **Several indexes.** `discover` lists other indexes in the same store holding the same sources, and
443
+ `compass drift --project P --index-a A --index-b B` reports, per source document, content present
444
+ in one index and missing from the other.
445
+
446
+ **Document metadata.** The opt-in `metadata_checks` step (name it in `pipeline.steps`) checks that
447
+ date fields agree with each other and with the file name, that each document type carries its
448
+ period fields, that a type sits in its folder, and that chunks were ingested after the source last
449
+ changed. Every field, pattern and map is set under `metadata_checks:`.
450
+
411
451
  ### KB readiness
412
452
 
413
453
  `compass readiness --discover D.json [--grounding G.json] [--benchmark B.json] [--drift X.json]
@@ -451,6 +491,9 @@ it changes no verdict.
451
491
  | `fidelity_value_drift` | advisory | ingestion |
452
492
  | `fidelity_source_mismatch` | risk | ingestion |
453
493
  | `fidelity_caption_detached` | risk | ingestion |
494
+ | `fidelity_extractor_gap` (source text the extractor did not produce) | advisory | ingestion |
495
+ | `fidelity_pipeline_drop` (passages the extractor produced, missing from the store) | gate | ingestion |
496
+ | `structure_findings` | advisory | ingestion |
454
497
  | `fidelity_documents_unverifiable` * (could not be compared) | risk | ingestion |
455
498
  | `fidelity_snapshot_coverage` * (below `readiness.min_snapshot_coverage`) | gate | ingestion |
456
499
  | `chunk_integrity_findings` | advisory | ingestion |
@@ -270,10 +270,12 @@ eval:
270
270
  figure_regions: snapshot # snapshot | off: numbers inside figures reported apart
271
271
  figure_types: [figure, chart, image] # snapshot element types that are figures
272
272
  lost_passages_allowed: 0 # named lost passages tolerated (snapshot baseline)
273
+ figure_words: gate # gate | report: lost words inside figures gate or not
273
274
  number_format: "1,234.5" # or "1.234,5" | "1 234,5" | "1'234.5"
274
275
  source_exclusions: # nothing is excluded that is not listed here
275
276
  repeated_on_pages: 5 # headers and footers
276
- min_chars: 75 # small fragments
277
+ min_chars: 75 # small fragments (every element type)
278
+ figure_min_chars: 75 # figure elements this short, dropped by design
277
279
  patterns: ["(?i)^past performance"] # by-design notices
278
280
  page_roles: {disclaimer: "(?i)^important disclosures"}
279
281
  roles: [marginalia, logo, attestation] # read from a snapshot, so they need one
@@ -335,6 +337,44 @@ fails readiness when too few were read. `compass doctor` reads the snapshots of
335
337
  says which location and version holds the element list, and prints a `formats` entry to paste when
336
338
  the mapping is wrong.
337
339
 
340
+ A passage the extractor produced and the store lacks is a pipeline drop, and it fails `readiness`
341
+ by default (`fidelity_pipeline_drop`); text missing from the extractor too stays advisory. Table
342
+ elements are compared like any passage, image links (`![name](url)`) and URLs are ignored on every
343
+ side, and a `Source:` line inside a text element is judged as a caption.
344
+
345
+ Structure is checked against the snapshot too, under `eval.structure` (every check reports "not
346
+ checked" when its input is missing): a heading stored with its section, a table in one chunk,
347
+ reading order, every page with text covered by a chunk, the page a chunk states, every source image
348
+ represented by a figure element, and pages whose text layer has no Unicode map. The chunk box and
349
+ chunk type checks run when the index carries those fields (`chunk_box_field`, `chunk_type_field`).
350
+
351
+ Index settings that change what every check reads:
352
+
353
+ ```yaml
354
+ redis:
355
+ text_field: content # the field holding chunk text
356
+ page_base: 0 # the index counts pages from 0; every page is read 1-based
357
+ production_index: kb_merged # the index production queries; reports say when they read another
358
+ coverage: full # every sampled check reads every item (default: sampled)
359
+ triage_file: config/triage.yaml # decisions kept between runs (see below)
360
+ ```
361
+
362
+ **Triage.** `triage_file` lists decisions on findings: `{key, decision: defect | by_design | false,
363
+ reason, owner, expires}`. Every finding carries a stable id and a key (`check|index|document|chunk`,
364
+ globs allowed); `by_design` and `false` never gate, expired entries are ignored with a warning, and
365
+ `compass triage stats` reports each check's precision over the labelled entries. Findings are marked
366
+ new, still open or resolved against the previous run, and `--export-findings DIR` writes one file
367
+ per owner with index, chunk id, chunk index, page and a snippet.
368
+
369
+ **Several indexes.** `discover` lists other indexes in the same store holding the same sources, and
370
+ `compass drift --project P --index-a A --index-b B` reports, per source document, content present
371
+ in one index and missing from the other.
372
+
373
+ **Document metadata.** The opt-in `metadata_checks` step (name it in `pipeline.steps`) checks that
374
+ date fields agree with each other and with the file name, that each document type carries its
375
+ period fields, that a type sits in its folder, and that chunks were ingested after the source last
376
+ changed. Every field, pattern and map is set under `metadata_checks:`.
377
+
338
378
  ### KB readiness
339
379
 
340
380
  `compass readiness --discover D.json [--grounding G.json] [--benchmark B.json] [--drift X.json]
@@ -378,6 +418,9 @@ it changes no verdict.
378
418
  | `fidelity_value_drift` | advisory | ingestion |
379
419
  | `fidelity_source_mismatch` | risk | ingestion |
380
420
  | `fidelity_caption_detached` | risk | ingestion |
421
+ | `fidelity_extractor_gap` (source text the extractor did not produce) | advisory | ingestion |
422
+ | `fidelity_pipeline_drop` (passages the extractor produced, missing from the store) | gate | ingestion |
423
+ | `structure_findings` | advisory | ingestion |
381
424
  | `fidelity_documents_unverifiable` * (could not be compared) | risk | ingestion |
382
425
  | `fidelity_snapshot_coverage` * (below `readiness.min_snapshot_coverage`) | gate | ingestion |
383
426
  | `chunk_integrity_findings` | advisory | ingestion |
@@ -5,4 +5,4 @@ end-to-end: API upload -> object storage -> knowledge graph -> vector store ->
5
5
  retrieval quality, plus cross-store consistency.
6
6
  """
7
7
 
8
- __version__ = "4.1.0"
8
+ __version__ = "4.2.1"
@@ -15,6 +15,7 @@ from __future__ import annotations
15
15
  import struct
16
16
  from typing import Any
17
17
 
18
+ from compass.chunk_ref import chunk_ref
18
19
  from compass.config import Settings
19
20
  from compass.providers import get_adapter
20
21
 
@@ -120,6 +121,8 @@ def ask_kb(
120
121
  "s3_key": h.get("s3_key", ""),
121
122
  "text": h.get("text", "") or "",
122
123
  "key": h.get("key", ""),
124
+ "chunk_index": next((h[f] for f in (rc.positional_field, "chunk_index", "position")
125
+ if f and h.get(f) not in (None, "")), ""),
123
126
  "meta": meta,
124
127
  })
125
128
  return {
@@ -128,6 +131,7 @@ def ask_kb(
128
131
  "model": emb_cfg.model_id,
129
132
  "dim": len(vector),
130
133
  "filters": filters or {},
134
+ "index": getattr(rc, "search_index", ""),
131
135
  "results": results,
132
136
  "total": len(results),
133
137
  }
@@ -146,7 +150,11 @@ def format_text(payload: dict, preview: int = 160) -> str:
146
150
  score = r["score"]
147
151
  score_s = f"{float(score):.4f}" if _is_number(score) else str(score)
148
152
  text = " ".join((r["text"] or "").split())
149
- lines.append(f" {r['rank']}. [score {score_s}] {r['file_name']} (chunk {r['chunk_id']})")
153
+ # Index, chunk id and chunk index together: a position alone means different text in
154
+ # another index of the same corpus.
155
+ ref = chunk_ref(payload.get("index", ""), {"key": r.get("key"),
156
+ "chunk_index": r.get("chunk_index", "")})
157
+ lines.append(f" {r['rank']}. [score {score_s}] {r['file_name']} ({ref})")
150
158
  lines.append(f" {text[:preview]}{'...' if len(text) > preview else ''}")
151
159
  if not payload["results"]:
152
160
  lines.append(" (no results - check the index has data and the embedding matches ingestion)")
@@ -311,12 +311,57 @@ def _identities(retrieved: list, content: dict, min_containment: float) -> list[
311
311
  return out
312
312
 
313
313
 
314
+ _LENGTH_RATIO = 2.5 # median ground-truth chunk this many times longer or shorter: another index
315
+
316
+
317
+ def eval_index_match(cases: list[dict], cfg: Any, index_chunks: list[dict], *,
318
+ by_content: bool = False) -> dict:
319
+ """Whether the eval's ground truth can be found in this index at all.
320
+
321
+ An eval captured from one index and scored against another reports recall near 0, which
322
+ reads as a retrieval failure. It is not one: the ground-truth chunks name fields this index
323
+ does not have, or were cut to a different size. Checked from the eval's chunks and a sample
324
+ of the index, before any score is read.
325
+
326
+ Returns ``{"matches": bool | None, "reasons": [...]}``; None when it could not be judged.
327
+ """
328
+ from statistics import median
329
+
330
+ from compass.eval_interop import as_chunks, get_path
331
+
332
+ if not index_chunks:
333
+ return {"matches": None, "reasons": ["the index returned no chunks to compare with"]}
334
+ doc_field = getattr(cfg, "gt_chunk_doc_field", "document_title")
335
+ page_field = getattr(cfg, "gt_chunk_page_field", "page_start")
336
+ text_field = getattr(cfg, "gt_chunk_text_field", "text") or "text"
337
+ truth: list[dict] = []
338
+ for case in cases:
339
+ found = get_path(case, getattr(cfg, "gt_chunks_path", "context.chunks"))
340
+ truth += as_chunks(found if found is not None else case.get("chunks"), text_field)
341
+ if not truth:
342
+ return {"matches": None, "reasons": ["the eval carries no ground-truth chunks"]}
343
+ reasons: list[str] = []
344
+ index_fields = {k for c in index_chunks for k, v in c.items() if v not in (None, "")}
345
+ needed = [doc_field] if by_content else [doc_field, page_field]
346
+ for name in needed:
347
+ if any(c.get(name) not in (None, "") for c in truth) and name not in index_fields:
348
+ reasons.append(f"ground-truth chunks are identified by '{name}', which no sampled "
349
+ "chunk of this index carries")
350
+ truth_len = median(len(str(c.get(text_field) or c.get("text") or "")) for c in truth)
351
+ index_len = median(len(str(c.get("text") or "")) for c in index_chunks)
352
+ if truth_len and index_len and not (1 / _LENGTH_RATIO <= truth_len / index_len <= _LENGTH_RATIO):
353
+ reasons.append(f"ground-truth chunks are {truth_len:.0f} characters long at the median, "
354
+ f"this index's {index_len:.0f}: the eval was captured from an index "
355
+ "chunked differently")
356
+ return {"matches": not reasons, "reasons": reasons}
357
+
358
+
314
359
  # --------------------------------------------------------------------------- #
315
360
  # Benchmark run
316
361
  # --------------------------------------------------------------------------- #
317
362
  def benchmark(settings: Any, cases: list[dict], strategies: list[Strategy], *,
318
363
  retrieve: Any = None, use_case_filters: bool = True,
319
- match_mode: str = "") -> dict:
364
+ match_mode: str = "", index_sample: Optional[list] = None) -> dict:
320
365
  """Score every strategy over every case. ``retrieve`` is injectable for testing.
321
366
 
322
367
  ``use_case_filters=False`` measures raw vector search over the whole corpus, which is a
@@ -398,6 +443,17 @@ def benchmark(settings: Any, cases: list[dict], strategies: list[Strategy], *,
398
443
  def rank(row: dict) -> tuple:
399
444
  return (row.get("ndcg") or 0, row.get("recall") or 0)
400
445
 
446
+ if index_sample is None and retrieve is None:
447
+ try:
448
+ from compass.providers import get_adapter
449
+
450
+ store = get_adapter("vectorstore", settings.redis.provider, config=settings.redis)
451
+ index_sample = store.sample_chunks(50)
452
+ except Exception: # noqa: BLE001 - the comparison is advisory; scores stand without it
453
+ index_sample = []
454
+ match = (eval_index_match([row[0] for row in usable], settings.eval, index_sample,
455
+ by_content=by_content)
456
+ if index_sample is not None else {"matches": None, "reasons": ["not checked"]})
401
457
  winner = max(scored, key=rank, default=None)
402
458
  # An exact tie has no winner. Naming the first-listed strategy would credit config order.
403
459
  if winner is not None and sum(1 for s in scored if rank(s) == rank(winner)) > 1:
@@ -409,6 +465,7 @@ def benchmark(settings: Any, cases: list[dict], strategies: list[Strategy], *,
409
465
  "strategies": per_strategy,
410
466
  "winner": winner["strategy"] if winner else "",
411
467
  "per_query": per_query,
468
+ "eval_index_match": match,
412
469
  "filter_mode": ("disabled" if not use_case_filters else
413
470
  "none-recorded" if not filtered else
414
471
  "per-case" if filtered == len(usable) else "partial"),
@@ -495,6 +495,12 @@ _TEXT: dict[str, dict[str, tuple[str, str, str]]] = {
495
495
  "or the store holds another document's text under this id.",
496
496
  "Check eval.fidelity.text_field and eval.citation_source_key_fields, then the "
497
497
  "document's chunks."),
498
+ "extractor_gap": (
499
+ "Whether the extractor's output holds all of the source's text.",
500
+ "Text in the source is missing from the extractor's output; the store holds all the "
501
+ "extractor produced, so any loss is before the pipeline.",
502
+ "Compare with a stronger eval.source_extractor first: a weak text layer reads the same "
503
+ "way. Then check the extractor's settings for the missed regions."),
498
504
  "caption_detached": (
499
505
  "Whether each caption or source note is stored in its figure's chunk or the next one.",
500
506
  "A reader retrieving the figure gets it without its source or caption, and the "
@@ -553,6 +559,7 @@ _FIDELITY_TITLES = {
553
559
  "value_drift": ("Value drift", "warn"),
554
560
  "source_mismatch": ("Source mismatch", "warn"),
555
561
  "caption_detached": ("Caption detached from its figure", "warn"),
562
+ "extractor_gap": ("Source text missing from the extractor's output", "info"),
556
563
  "unverifiable": ("Unverifiable document or page", "info"),
557
564
  "wrong_page": ("Chunk on the wrong page", "warn"),
558
565
  "altered": ("Chunk altered", "warn"),
@@ -0,0 +1,61 @@
1
+ """One unambiguous way to name a chunk: index, chunk id and chunk index, always together.
2
+
3
+ "chunk_22" in one report and "chunk_22" in another meant different text, because the two
4
+ reports read different indexes of the same corpus and each counted its own chunks. A chunk
5
+ reference that names only a position, or only a key, is ambiguous as soon as a corpus lives in
6
+ more than one index. Every new console line and export names all three.
7
+
8
+ Pure and deterministic; never raises.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from typing import Any, Mapping, Optional
14
+
15
+ #: Fields read for the chunk id when none is named, first non-empty wins.
16
+ ID_FIELDS = ("key", "chunk_id", "id", "_id")
17
+ #: Fields read for the chunk's position within its document, first present wins.
18
+ POSITION_FIELDS = ("chunk_index", "position", "seq", "chunk_position", "chunk_number", "index")
19
+
20
+
21
+ def _first(chunk: Mapping, names: Any) -> Any:
22
+ for name in ([names] if isinstance(names, str) else list(names or ())):
23
+ value = chunk.get(name) if name else None
24
+ if value not in (None, ""):
25
+ return value
26
+ return None
27
+
28
+
29
+ def chunk_parts(index: str, chunk: Any, fields: Optional[Mapping[str, Any]] = None) -> dict:
30
+ """``{"index", "chunk_id", "chunk_index"}`` for one chunk; a part that is unknown is "".
31
+
32
+ Args:
33
+ index: The index (collection) the chunk was read from.
34
+ chunk: The chunk dict, or a bare id string.
35
+ fields: Optional ``{"id": name or names, "position": name or names}`` overriding the
36
+ default field lists, e.g. ``{"position": settings.redis.positional_field}``.
37
+ """
38
+ fields = dict(fields or {})
39
+ if not isinstance(chunk, Mapping):
40
+ return {"index": str(index or ""), "chunk_id": "" if chunk is None else str(chunk),
41
+ "chunk_index": ""}
42
+ id_names = [n for n in ([fields.get("id")] if isinstance(fields.get("id"), str)
43
+ else list(fields.get("id") or ())) if n] + list(ID_FIELDS)
44
+ pos_names = [n for n in ([fields.get("position")] if isinstance(fields.get("position"), str)
45
+ else list(fields.get("position") or ())) if n] + list(POSITION_FIELDS)
46
+ cid, pos = _first(chunk, id_names), _first(chunk, pos_names)
47
+ return {"index": str(index or ""), "chunk_id": "" if cid is None else str(cid),
48
+ "chunk_index": "" if pos is None else str(pos)}
49
+
50
+
51
+ def chunk_ref(index: str, chunk: Any, fields: Optional[Mapping[str, Any]] = None) -> str:
52
+ """``index=<index> chunk_id=<id> chunk_index=<n>``: the three always printed together.
53
+
54
+ An unknown part prints as ``?`` rather than being dropped, so a reader can see what the
55
+ reference does not establish.
56
+ """
57
+ parts = chunk_parts(index, chunk, fields)
58
+ return " ".join(f"{name}={parts[name] or '?'}" for name in ("index", "chunk_id", "chunk_index"))
59
+
60
+
61
+ __all__ = ["ID_FIELDS", "POSITION_FIELDS", "chunk_parts", "chunk_ref"]