phlo-api 0.18.0__tar.gz → 0.19.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 (194) hide show
  1. {phlo_api-0.18.0 → phlo_api-0.19.0}/PKG-INFO +11 -5
  2. phlo_api-0.19.0/README.md +169 -0
  3. {phlo_api-0.18.0 → phlo_api-0.19.0}/pyproject.toml +8 -5
  4. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/Dockerfile +37 -20
  5. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/authentication.py +3 -41
  6. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/authorization.py +33 -330
  7. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/continuity.py +84 -63
  8. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/operation_controls.py +152 -48
  9. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1.py +57 -35
  10. phlo_api-0.19.0/src/phlo_api/api/v1_action_availability.py +245 -0
  11. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_admin_identity.py +89 -2
  12. phlo_api-0.19.0/src/phlo_api/api/v1_asset_insights.py +690 -0
  13. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_assets.py +238 -22
  14. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_audit_proposals.py +6 -13
  15. phlo_api-0.19.0/src/phlo_api/api/v1_authoring.py +46 -0
  16. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_branch_workflows.py +103 -23
  17. phlo_api-0.19.0/src/phlo_api/api/v1_data_products.py +483 -0
  18. phlo_api-0.19.0/src/phlo_api/api/v1_extensions.py +98 -0
  19. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_jobs.py +74 -71
  20. phlo_api-0.19.0/src/phlo_api/api/v1_loads.py +324 -0
  21. phlo_api-0.19.0/src/phlo_api/api/v1_metrics.py +583 -0
  22. phlo_api-0.19.0/src/phlo_api/api/v1_operations.py +140 -0
  23. phlo_api-0.19.0/src/phlo_api/api/v1_packages.py +273 -0
  24. phlo_api-0.19.0/src/phlo_api/api/v1_pages.py +58 -0
  25. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_query.py +13 -12
  26. phlo_api-0.19.0/src/phlo_api/api/v1_query_sql.py +86 -0
  27. phlo_api-0.19.0/src/phlo_api/api/v1_readiness.py +226 -0
  28. phlo_api-0.19.0/src/phlo_api/api/v1_search.py +114 -0
  29. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_staging.py +51 -22
  30. phlo_api-0.19.0/src/phlo_api/api/v1_transform_editor.py +1122 -0
  31. phlo_api-0.19.0/src/phlo_api/api/v1_upload_ingestion.py +840 -0
  32. phlo_api-0.19.0/src/phlo_api/api/v1_uploads.py +663 -0
  33. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_wap.py +55 -70
  34. phlo_api-0.19.0/src/phlo_api/branch_schema_comparison.py +62 -0
  35. phlo_api-0.19.0/src/phlo_api/candidate_runtime.py +398 -0
  36. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/entrypoint.sh +17 -16
  37. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/errors.py +8 -0
  38. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/incidents.py +4 -0
  39. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/main.py +34 -4
  40. phlo_api-0.19.0/src/phlo_api/migrations.py +113 -0
  41. phlo_api-0.19.0/src/phlo_api/notifications.py +219 -0
  42. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/dagster.py +2 -0
  43. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/extensions.py +6 -1
  44. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory.py +2 -74
  45. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_durable_state.py +51 -14
  46. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_models.py +4 -81
  47. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_operation_journal.py +1 -12
  48. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_saved_queries.py +1 -12
  49. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_workflow_wizard.py +6 -0
  50. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/package_install.py +58 -35
  51. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/run_report.py +1 -0
  52. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/settings.py +2 -1
  53. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/v1_preview.py +206 -24
  54. phlo_api-0.19.0/src/phlo_api/preview_preflight.py +23 -0
  55. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/security_manifest.py +218 -8
  56. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/service.yaml +54 -3
  57. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/settings.py +22 -0
  58. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/sql/001_incidents.sql +8 -8
  59. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/sql/002_query_usage.sql +1 -1
  60. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/sql/003_incident_query_parity.sql +2 -2
  61. phlo_api-0.19.0/src/phlo_api/sql/004_configurable_environments.sql +18 -0
  62. phlo_api-0.19.0/src/phlo_api/sql/004_notification_read_state.sql +11 -0
  63. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/usage.py +3 -2
  64. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/v1_contract.py +5 -20
  65. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api.egg-info/PKG-INFO +11 -5
  66. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api.egg-info/SOURCES.txt +40 -0
  67. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api.egg-info/requires.txt +13 -4
  68. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_api_settings.py +1 -0
  69. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_asset_operations.py +52 -0
  70. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_asset_read_parity.py +3 -2
  71. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_authentication_api.py +52 -46
  72. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_authoring_api.py +36 -17
  73. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_authorization_api.py +51 -123
  74. phlo_api-0.19.0/tests/test_branch_schema_comparison.py +86 -0
  75. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_branch_schema_resolution.py +6 -0
  76. phlo_api-0.19.0/tests/test_candidate_runtime.py +244 -0
  77. phlo_api-0.19.0/tests/test_continuity_api.py +1083 -0
  78. phlo_api-0.19.0/tests/test_cors.py +30 -0
  79. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_dataset_cutover_parity.py +5 -1
  80. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_dataset_overlay_retirement.py +27 -0
  81. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_governance_settings.py +21 -12
  82. phlo_api-0.19.0/tests/test_identity_authority_postgres.py +174 -0
  83. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_incident_query_parity.py +20 -9
  84. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_incidents_postgres.py +137 -1
  85. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_integration_api.py +28 -91
  86. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_loki_api.py +15 -33
  87. phlo_api-0.19.0/tests/test_notifications.py +187 -0
  88. phlo_api-0.19.0/tests/test_notifications_postgres.py +165 -0
  89. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_actions.py +9 -1
  90. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_api.py +88 -132
  91. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_capabilities.py +22 -6
  92. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_operation_journal.py +73 -4
  93. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_package_install.py +23 -27
  94. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_read_models.py +5 -5
  95. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_workflow_wizard.py +29 -1
  96. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_operation_controls.py +220 -10
  97. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_operation_controls_postgres.py +206 -5
  98. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_operational_observations.py +6 -4
  99. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_pagination.py +1 -0
  100. phlo_api-0.19.0/tests/test_preview_provision_integration.py +537 -0
  101. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_require_scope.py +7 -3
  102. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_route_inventory.py +58 -11
  103. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_run_report_postgres_recovery.py +34 -6
  104. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_security_manifest.py +34 -1
  105. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_service_correlation_runtime.py +18 -0
  106. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_service_url_resolution.py +12 -3
  107. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_trino_defaults.py +6 -2
  108. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_usage.py +4 -1
  109. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_usage_trino_integration.py +3 -2
  110. phlo_api-0.19.0/tests/test_v1_action_availability.py +204 -0
  111. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_admin_identity.py +130 -0
  112. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_api.py +128 -8
  113. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_asset_row_count.py +3 -2
  114. phlo_api-0.19.0/tests/test_v1_branch_nessie_contract.py +113 -0
  115. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_branch_workflows.py +199 -3
  116. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_contract.py +67 -1
  117. phlo_api-0.19.0/tests/test_v1_data_products.py +622 -0
  118. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_git_review.py +44 -24
  119. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_jobs_read.py +111 -46
  120. phlo_api-0.19.0/tests/test_v1_loads.py +282 -0
  121. phlo_api-0.19.0/tests/test_v1_metrics.py +762 -0
  122. phlo_api-0.19.0/tests/test_v1_observatory_reads.py +677 -0
  123. phlo_api-0.19.0/tests/test_v1_package_install.py +183 -0
  124. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_preview.py +107 -0
  125. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_query_api.py +26 -3
  126. phlo_api-0.19.0/tests/test_v1_query_sql.py +105 -0
  127. phlo_api-0.19.0/tests/test_v1_readiness.py +194 -0
  128. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_staging.py +77 -11
  129. phlo_api-0.19.0/tests/test_v1_transform.py +278 -0
  130. phlo_api-0.19.0/tests/test_v1_transform_editor.py +719 -0
  131. phlo_api-0.19.0/tests/test_v1_upload_ingestion.py +1164 -0
  132. phlo_api-0.19.0/tests/test_v1_uploads.py +519 -0
  133. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_wap.py +232 -4
  134. phlo_api-0.19.0/tests/test_windows_api_imports.py +34 -0
  135. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_workflow_wizard_boundaries.py +21 -0
  136. phlo_api-0.18.0/README.md +0 -76
  137. phlo_api-0.18.0/src/phlo_api/api/v1_query_sql.py +0 -46
  138. phlo_api-0.18.0/tests/test_continuity_api.py +0 -639
  139. phlo_api-0.18.0/tests/test_cors.py +0 -39
  140. phlo_api-0.18.0/tests/test_identity_authority_postgres.py +0 -79
  141. phlo_api-0.18.0/tests/test_v1_query_sql.py +0 -52
  142. {phlo_api-0.18.0 → phlo_api-0.19.0}/setup.cfg +0 -0
  143. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/__init__.py +0 -0
  144. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/__init__.py +0 -0
  145. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/asset_preview_filters.py +0 -0
  146. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/authoring.py +0 -0
  147. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/maintenance.py +0 -0
  148. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/observability.py +0 -0
  149. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_admin_audit.py +0 -0
  150. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_datasets.py +0 -0
  151. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/api/v1_git_review.py +0 -0
  152. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/branch_schema_resolution.py +0 -0
  153. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/__init__.py +0 -0
  154. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/_loki_regex_worker.py +0 -0
  155. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/contributing.py +0 -0
  156. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/extension_settings.py +0 -0
  157. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/http_client.py +0 -0
  158. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/lineage.py +0 -0
  159. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/loki.py +0 -0
  160. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_actions.py +0 -0
  161. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_cache.py +3 -3
  162. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_capabilities.py +0 -0
  163. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_metadata.py +0 -0
  164. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_runs.py +0 -0
  165. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_search.py +0 -0
  166. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/observatory_services.py +0 -0
  167. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/orchestrator_operations.py +0 -0
  168. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/run_action_contract.py +0 -0
  169. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/service_payloads.py +0 -0
  170. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/observatory_api/trino.py +0 -0
  171. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/pagination.py +0 -0
  172. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/plugin.py +0 -0
  173. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/regulated_surface_adapter.py +0 -0
  174. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api/run_evidence.py +0 -0
  175. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api.egg-info/dependency_links.txt +0 -0
  176. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api.egg-info/entry_points.txt +0 -0
  177. {phlo_api-0.18.0 → phlo_api-0.19.0}/src/phlo_api.egg-info/top_level.txt +0 -0
  178. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_api_backend_endpoints.py +0 -0
  179. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_api_import_boundaries.py +0 -0
  180. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_auth_helper_meta.py +0 -0
  181. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_error_envelope.py +0 -0
  182. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_incident_signed_resolution_postgres.py +0 -0
  183. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_lineage_api.py +0 -0
  184. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_maintenance_api.py +0 -0
  185. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_no_fork_multiprocessing.py +0 -0
  186. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observability_api.py +0 -0
  187. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_legacy_api.py +0 -0
  188. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_run_action_contract.py +0 -0
  189. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_observatory_surfaces.py +0 -0
  190. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_security_manifest_action_dispatch.py +0 -0
  191. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_trino_query_bound.py +0 -0
  192. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_trino_sql.py +0 -0
  193. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_admin_audit.py +0 -0
  194. {phlo_api-0.18.0 → phlo_api-0.19.0}/tests/test_v1_audit_parity.py +0 -0
@@ -1,18 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: phlo-api
3
- Version: 0.18.0
3
+ Version: 0.19.0
4
4
  Summary: Phlo API - Backend service exposing Phlo internals to Observatory
5
5
  Author-email: Phlo Team <team@phlo.dev>
6
6
  License: MIT
7
7
  Requires-Python: >=3.12
8
8
  Description-Content-Type: text/plain
9
- Requires-Dist: phlo<0.19,>=0.18.0
9
+ Requires-Dist: phlo<0.20,>=0.19.0
10
10
  Requires-Dist: fastapi<0.137,>=0.127.0
11
11
  Requires-Dist: httpx>=0.28.1
12
12
  Requires-Dist: anyio>=4.14.2
13
13
  Requires-Dist: psycopg2-binary>=2.9.11
14
- Requires-Dist: phlo-pandera<0.17,>=0.16.1
15
- Requires-Dist: phlo-postgres<0.18,>=0.17.0
14
+ Requires-Dist: phlo-pandera<0.18,>=0.17.0
15
+ Requires-Dist: phlo-postgres<0.19,>=0.18.0
16
16
  Requires-Dist: pydantic>=2.0
17
17
  Requires-Dist: pyyaml>=6.0.1
18
18
  Requires-Dist: sqlglot<31,>=30.2.1
@@ -22,9 +22,15 @@ Requires-Dist: phlo-dagster>=0.3.2; extra == "dagster"
22
22
  Provides-Extra: dev
23
23
  Requires-Dist: pytest>=7.0; extra == "dev"
24
24
  Requires-Dist: ruff>=0.1.0; extra == "dev"
25
+ Provides-Extra: dlt
26
+ Requires-Dist: phlo-dlt<0.19,>=0.18.0; extra == "dlt"
25
27
  Provides-Extra: iceberg
26
- Requires-Dist: phlo-iceberg<0.18,>=0.17.0; extra == "iceberg"
28
+ Requires-Dist: phlo-iceberg<0.19,>=0.18.0; extra == "iceberg"
27
29
  Provides-Extra: lineage
28
30
  Requires-Dist: phlo-lineage>=0.1.0; extra == "lineage"
31
+ Provides-Extra: transform
32
+ Requires-Dist: phlo-transform<0.3,>=0.2.0; extra == "transform"
33
+ Provides-Extra: trino
34
+ Requires-Dist: phlo-trino<0.19,>=0.18.0; extra == "trino"
29
35
 
30
36
  Phlo API backend for Observatory.
@@ -0,0 +1,169 @@
1
+ # phlo-api
2
+
3
+ Backend API service for Phlo Observatory.
4
+
5
+ ## Description
6
+
7
+ FastAPI-based backend service exposing Phlo internals to the Observatory UI. Provides endpoints for lineage, quality checks, assets, and metadata.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install phlo-api
13
+ # or
14
+ phlo plugin install api
15
+ ```
16
+
17
+ ## Configuration
18
+
19
+ | Variable | Default | Description |
20
+ | --------------- | --------- | --------------- |
21
+ | `PHLO_API_PORT` | `4000` | API server port |
22
+ | `HOST` | `0.0.0.0` | API server host |
23
+ | `PHLO_AUTHORIZATION_BACKEND` | unset | Authorization backend capability name |
24
+ | `PHLO_AUTHORIZATION_MODE` | `required` in production, `optional` otherwise | Guard behavior when no authorization backend exists |
25
+
26
+ `PHLO_AUTHORIZATION_MODE=optional` leaves guarded routes reachable until an
27
+ authorization backend is configured. `PHLO_AUTHORIZATION_MODE=required` makes
28
+ guarded routes fail closed with HTTP `503` when no backend is available.
29
+
30
+ Production (`PHLO_ENVIRONMENT=production`, `prod`, `staging`, or `regulated`,
31
+ or any regulated deployment) defaults to `required` and fails startup if you
32
+ explicitly configure `optional`. Development stays opt-in unless you set the
33
+ mode explicitly or enable regulated mode. Production requires an
34
+ authentication provider and an authorization backend; the preflight report
35
+ (`phlo services preflight --production`) verifies the locally inspectable part
36
+ of that contract.
37
+
38
+ You can also declare these settings in `phlo.yaml` via `api.authorization` or
39
+ `services.phlo-api.authorization`.
40
+
41
+ ## Auto-Configuration
42
+
43
+ This package is **fully auto-configured**:
44
+
45
+ | Feature | How It Works |
46
+ | --------------------- | ------------------------------------------------------- |
47
+ | **Metrics Labels** | Exposes Prometheus metrics at `/metrics` |
48
+ | **Service Discovery** | Automatically scraped by Prometheus |
49
+ | **Health Check** | Provides `/health` endpoint for container orchestration |
50
+
51
+ ## Usage
52
+
53
+ ```bash
54
+ # Start the API service
55
+ phlo services start --service phlo-api
56
+
57
+ # For local source development, initialize dev mode first.
58
+ phlo services init --dev --phlo-source /path/to/phlo
59
+ phlo services start --service phlo-api
60
+ ```
61
+
62
+ ## Endpoints
63
+
64
+ - **API Base**: `http://localhost:4000`
65
+ - **Health**: `http://localhost:4000/health`
66
+ - **Metrics**: `http://localhost:4000/metrics`
67
+ - **OpenAPI Docs**: `http://localhost:4000/docs`
68
+
69
+ ## API Routes
70
+
71
+ | Route | Description |
72
+ | --------------- | ------------------------- |
73
+ | `/api/lineage` | Data lineage queries |
74
+ | `/api/quality` | Quality check results |
75
+ | `/api/assets` | Dagster asset information |
76
+ | `/api/branches` | Nessie branch management |
77
+
78
+ ## Retained CSV candidate lifecycle
79
+
80
+ `GET /api/v1/uploads/csv?env=<environment>` lists the current actor's retained
81
+ uploads with their original filename, checksum, and timestamps. The optional
82
+ `include_archived=true` also returns archived uploads. Other actors' uploads
83
+ are not visible.
84
+
85
+ `POST /api/v1/uploads/csv/{upload_id}/archive?env=<environment>` accepts
86
+ `{"archived": true, "reason": "Superseded review"}`. Use `false` to restore the
87
+ upload. Archiving preserves the upload bytes, review recipe, generated source,
88
+ candidate receipt, run evidence, and mutation fences. It neither reclaims
89
+ disk space nor resets retained-byte and global collection limits. Archived
90
+ uploads cannot change review, prepare a destination, plan, or load.
91
+
92
+ The candidate endpoints below use the same upload path and environment:
93
+
94
+ - `GET .../candidate/review` returns immutable evidence and a stale marker.
95
+ A changed base prevents release eligibility but permits a bounded preview
96
+ when the exact candidate hash and snapshot still verify. Candidate drift
97
+ or unavailable providers suppress rows rather than hiding the receipt.
98
+ - `POST .../candidate/reconcile` verifies the confirmed Dagster run, immutable
99
+ plan identity, table snapshot, and reviewed row count before recording a
100
+ loaded result. It never launches a run or retries a write. Without an exact
101
+ run receipt, an uncertain launch remains unresolved. A partially prepared
102
+ catalog can recover only from a complete recorded binding with no later
103
+ branch writes. Reconciliation never adopts an unrecorded catalog.
104
+ - `GET .../candidate/handoff` exports the attested contract and workflow files
105
+ with checksums and candidate evidence. The generated files remain
106
+ candidate-specific until a source review adapts and commits them. Existing
107
+ branch checks, trial merge, and signed merge remain separate authorised POST
108
+ operations. Export does not publish source or promote candidate data.
109
+
110
+ ## Explicit payload reclamation
111
+
112
+ Reclamation is irreversible and separate from archive. It requires an archived
113
+ record, write authorisation, `confirmed: true`, a non-blank `reason`, and the
114
+ current version, checksum, or revision digest. Provider tables, candidate
115
+ branches, catalogues, release records, and operation claims are not deleted.
116
+
117
+ All paths below have the `/api/v1` prefix and require `env`:
118
+
119
+ | POST path | Required precondition | Local content reclaimed |
120
+ | --- | --- | --- |
121
+ | `/metric-models/{model_id}/reclaim` | `expected_version` | Full draft definition |
122
+ | `/data-products/{product_id}/reclaim` | `expected_version` | Full draft definition |
123
+ | `/uploads/csv/{upload_id}/reclaim` | `expected_checksum` | Raw retained CSV bytes |
124
+ | `/transform/models/{model_id}/drafts/{draft_id}/{revision}/reclaim` | `expected_revision_digest` | Copied workspace inputs |
125
+ | `/transform/models/{model_id}/drafts/{draft_id}/{revision}/executions/{execution_id}/reclaim` | `expected_revision_digest` | Local execution workspace |
126
+
127
+ Metric and product definitions become compact permanent tombstones. Their IDs
128
+ cannot be reused, and later definition reads, exports, or restores return 410.
129
+ Reclamation frees one full-definition slot, not the retained identity evidence.
130
+ CSV and native metadata remain available, but reclaimed payloads cannot be
131
+ restored. Retained reports, checksums, SQL handoff evidence, and audit records
132
+ remain. Completed cleanup frees the corresponding payload quota. Interrupted
133
+ cleanup stays fenced until an explicit confirmed retry completes it.
134
+
135
+ Pending or unknown mutations block reclamation. The operation-store guard
136
+ holds the claim lock through local disposal, so a new claim cannot race the
137
+ safety check. Unknown persisted metadata also blocks disposal rather than
138
+ silently discarding a future fence or reference.
139
+
140
+ When `audit.retention_years` is configured, explicit reclamation also preserves
141
+ supporting payloads for that minimum period. Definition changes reset their
142
+ retention age. CSV and native payloads must satisfy the minimum from both
143
+ creation and their latest archival timestamp, so recent supporting activity
144
+ cannot rely on an old creation date. Audit records and tombstones do not expire
145
+ when payloads become eligible. An unset minimum does not bypass archive,
146
+ identity, authorisation, or unresolved-mutation checks.
147
+
148
+ ## Load observation pagination
149
+
150
+ `GET /api/v1/loads?env=<environment>&limit=100` returns authorised private CSV
151
+ observations followed by ingestion runs. `limit` defaults to 100 and accepts
152
+ values from 1 to 300. The response includes `next_cursor`; passing that value
153
+ as `after` continues the inventory. A cursor belongs to the actor, environment,
154
+ Dagster location, and configured reference that created it.
155
+
156
+ CSV observations use descending receipt identity. Ingestion runs follow
157
+ Dagster's creation order, with assets ordered by ID within each run. This is
158
+ not a global ordering by load completion time. The continuation preserves a
159
+ partially returned run so runs with many assets do not lose observations.
160
+
161
+ Each request scans at most 100 provider runs. An empty page can still have a
162
+ `next_cursor` when unrelated or denied runs consume that scan. The inventory
163
+ is live, not a frozen snapshot. Refreshing includes new observations before
164
+ the current cursor. Observatory's filters and JSON export apply to loaded
165
+ observations, not pages that have not been fetched.
166
+
167
+ Pagination does not expand the underlying evidence. Asset materialisation
168
+ row-count history covers the last seven days. An ingestion run is not a
169
+ per-file receipt, and an unknown CSV receipt timestamp remains unknown.
@@ -7,13 +7,13 @@ requires = [
7
7
 
8
8
  [project]
9
9
  dependencies = [
10
- "phlo>=0.18.0,<0.19",
10
+ "phlo>=0.19.0,<0.20",
11
11
  "fastapi>=0.127.0,<0.137",
12
12
  "httpx>=0.28.1",
13
13
  "anyio>=4.14.2",
14
14
  "psycopg2-binary>=2.9.11",
15
- "phlo-pandera>=0.16.1,<0.17",
16
- "phlo-postgres>=0.17.0,<0.18",
15
+ "phlo-pandera>=0.17.0,<0.18",
16
+ "phlo-postgres>=0.18.0,<0.19",
17
17
  "pydantic>=2.0",
18
18
  "pyyaml>=6.0.1",
19
19
  "sqlglot>=30.2.1,<31",
@@ -22,7 +22,7 @@ dependencies = [
22
22
  description = "Phlo API - Backend service exposing Phlo internals to Observatory"
23
23
  name = "phlo-api"
24
24
  requires-python = ">=3.12"
25
- version = "0.18.0"
25
+ version = "0.19.0"
26
26
 
27
27
  [[project.authors]]
28
28
  email = "team@phlo.dev"
@@ -40,8 +40,11 @@ dev = [
40
40
  "pytest>=7.0",
41
41
  "ruff>=0.1.0",
42
42
  ]
43
- iceberg = ["phlo-iceberg>=0.17.0,<0.18"]
43
+ dlt = ["phlo-dlt>=0.18.0,<0.19"]
44
+ iceberg = ["phlo-iceberg>=0.18.0,<0.19"]
44
45
  lineage = ["phlo-lineage>=0.1.0"]
46
+ transform = ["phlo-transform>=0.2.0,<0.3"]
47
+ trino = ["phlo-trino>=0.18.0,<0.19"]
45
48
 
46
49
  [project.readme]
47
50
  content-type = "text/plain"
@@ -1,35 +1,47 @@
1
- FROM python:3.12-alpine@sha256:1b668429b3511ab407d8e00648891631b0b1a4d7e15e3ca70f38ab5b91ad4ab4 AS phlo-build-context
1
+ # Native transform releases target GNU libc, matching the Dagster runtime.
2
+ FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 AS phlo-build-context
2
3
 
3
4
  WORKDIR /opt/phlo-build-context
4
5
 
6
+ ARG PHLO_TRANSFORM_BINARY=
7
+ ARG PHLO_TRANSFORM_SHA256=
8
+
5
9
  COPY . .
6
10
  RUN set -eux; \
7
11
  if [ -f entrypoint.sh ]; then entrypoint=entrypoint.sh; else entrypoint=phlo-api/entrypoint.sh; fi; \
8
12
  install -m 0755 "$entrypoint" /opt/phlo-build-context/phlo-api-entrypoint.sh; \
9
- mkdir -p /opt/phlo-build-context/wheelhouse
13
+ mkdir -p /opt/phlo-build-context/wheelhouse /opt/phlo-native; \
14
+ if [ -n "$PHLO_TRANSFORM_BINARY" ]; then \
15
+ test -n "$PHLO_TRANSFORM_SHA256"; \
16
+ printf '%s %s\n' "$PHLO_TRANSFORM_SHA256" "$PHLO_TRANSFORM_BINARY" > /tmp/phlo-transform.sha256; \
17
+ sha256sum -c /tmp/phlo-transform.sha256; \
18
+ install -m 0755 "$PHLO_TRANSFORM_BINARY" /opt/phlo-native/phlo-transform; \
19
+ fi
10
20
 
11
- FROM python:3.12-alpine@sha256:1b668429b3511ab407d8e00648891631b0b1a4d7e15e3ca70f38ab5b91ad4ab4 AS runtime
21
+ FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 AS runtime
12
22
 
13
23
  WORKDIR /app
14
24
 
15
25
  ARG PHLO_VERSION=
16
26
  ARG PHLO_API_VERSION=
17
27
  ARG PHLO_WHEELHOUSE=
28
+ ARG PHLO_API_EXTRAS=
29
+
30
+ ENV PHLO_API_EXTRAS=${PHLO_API_EXTRAS}
18
31
 
19
- # Alpine packages stay unpinned: the branch archive drops superseded versions,
20
- # so an exact version becomes a hard build failure for consumers running
21
- # `phlo services start --build` weeks after the phlo release. `apk upgrade`
22
- # below resolves the current branch versions even with a digest-pinned base.
23
- # hadolint ignore=DL3018
24
- RUN apk upgrade --no-cache \
25
- && apk add --no-cache ca-certificates \
26
- && apk add --no-cache --virtual .build-deps \
27
- gcc \
28
- musl-dev \
32
+ RUN python -c 'import os; extras = set(filter(None, os.environ["PHLO_API_EXTRAS"].split(","))); unknown = extras - {"dagster", "dlt", "iceberg", "lineage", "transform", "trino"}; assert not unknown, f"Unsupported API provider extras: {sorted(unknown)}"'
33
+
34
+ # Match the existing GNU-native provider runtime rather than relying on musl shims.
35
+ # Apply Debian fixes even when the digest-pinned base predates them.
36
+ # hadolint ignore=DL3008
37
+ RUN apt-get update \
38
+ && apt-get upgrade --no-install-recommends --yes \
39
+ && apt-get install -y --no-install-recommends ca-certificates gcc libc6-dev \
40
+ && rm -rf /var/lib/apt/lists/* \
29
41
  && pip install --no-cache-dir \
30
42
  "setuptools==83.0.0" \
31
43
  "wheel==0.47.0" \
32
- "uv==0.12.5"
44
+ "uv==0.13.4"
33
45
 
34
46
  COPY --from=phlo-build-context /opt/phlo-build-context/wheelhouse /opt/phlo-wheelhouse
35
47
 
@@ -40,7 +52,8 @@ RUN set -eux; \
40
52
  PHLO_REQUIREMENT="phlo"; \
41
53
  if [ -n "$PHLO_VERSION" ]; then PHLO_REQUIREMENT="phlo==$PHLO_VERSION"; fi; \
42
54
  PHLO_API_REQUIREMENT="phlo-api"; \
43
- if [ -n "$PHLO_API_VERSION" ]; then PHLO_API_REQUIREMENT="phlo-api==$PHLO_API_VERSION"; fi; \
55
+ if [ -n "${PHLO_API_EXTRAS:-}" ]; then PHLO_API_REQUIREMENT="phlo-api[$PHLO_API_EXTRAS]"; fi; \
56
+ if [ -n "$PHLO_API_VERSION" ]; then PHLO_API_REQUIREMENT="$PHLO_API_REQUIREMENT==$PHLO_API_VERSION"; fi; \
44
57
  if [ -n "$PHLO_WHEELHOUSE" ]; then \
45
58
  test -d /opt/phlo-wheelhouse; \
46
59
  uv pip install --system --no-index --no-deps --reinstall --find-links /opt/phlo-wheelhouse "$PHLO_REQUIREMENT" "$PHLO_API_REQUIREMENT"; \
@@ -55,16 +68,20 @@ RUN set -eux; \
55
68
  uv pip install --system --no-deps phlo; \
56
69
  python -c 'import importlib.metadata as md; print("\n".join(r.split(";", 1)[0].strip() for r in (md.metadata("phlo").get_all("Requires-Dist") or []) if " @ " in r))' > /tmp/phlo-url-requirements.txt; \
57
70
  uv pip install --system --requirement /tmp/phlo-url-requirements.txt phlo "$PHLO_API_REQUIREMENT"; \
58
- fi; \
59
- apk del .build-deps
71
+ fi
60
72
 
61
73
  # Do not retain uv's downloaded archives in the runtime image; they are not needed to run Phlo.
62
- RUN rm -rf /root/.cache/uv
74
+ RUN apt-get purge -y --auto-remove gcc libc6-dev \
75
+ && rm -rf /var/lib/apt/lists/* /root/.cache/uv
63
76
 
64
77
  COPY --from=phlo-build-context /opt/phlo-build-context/phlo-api-entrypoint.sh /usr/local/bin/phlo-api-entrypoint.sh
78
+ COPY --from=phlo-build-context /opt/phlo-native/ /usr/local/bin/
79
+
80
+ # Reject an unusable approved binary in the final runtime, not on the first save.
81
+ RUN if [ -f /usr/local/bin/phlo-transform ]; then phlo-transform --version; fi
65
82
 
66
- RUN addgroup -S phlo \
67
- && adduser -S -G phlo -h /app -H phlo \
83
+ RUN groupadd --system phlo \
84
+ && useradd --system --gid phlo --home-dir /app --no-create-home phlo \
68
85
  && chown -R phlo:phlo /app
69
86
 
70
87
  USER phlo
@@ -32,21 +32,18 @@ Example:
32
32
 
33
33
  from __future__ import annotations
34
34
 
35
- from typing import Any
36
-
37
35
  from fastapi import HTTPException, Request
38
-
39
36
  from phlo.capabilities import (
40
- AuthPrincipal,
41
- AuthResult,
42
37
  AuthenticatedSession,
43
38
  AuthenticationProvider,
39
+ AuthPrincipal,
40
+ AuthResult,
44
41
  RequestContext,
45
42
  list_capabilities,
46
43
  resolve_capability,
47
44
  )
48
- from phlo.infrastructure.config import get_configured_authentication_provider_name
49
45
  from phlo.config.process import get_process_settings
46
+ from phlo.infrastructure.config import get_configured_authentication_provider_name
50
47
  from phlo.logging import get_logger
51
48
  from phlo.security.oidc_identity import OIDCVerificationUnavailable
52
49
 
@@ -275,38 +272,3 @@ def require_principal(request: Request) -> AuthPrincipal:
275
272
 
276
273
  request.state[_AUTH_PRINCIPAL_CACHE_KEY] = result.principal
277
274
  return result.principal
278
-
279
-
280
- def optional_authenticate(request: Request) -> AuthPrincipal | None:
281
- """Attempt to authenticate a request, returning None if not authenticated.
282
-
283
- Unlike require_principal, this does not raise on failure.
284
- """
285
- provider = get_authentication_provider()
286
- if provider is None:
287
- return None
288
-
289
- try:
290
- result = provider.authenticate(create_request_context(request))
291
- except OIDCVerificationUnavailable as exc:
292
- raise HTTPException(
293
- status_code=503,
294
- detail={"error": "service_unavailable", "reason": "oidc_verification_unavailable"},
295
- ) from exc
296
-
297
- if result.authenticated and result.principal is not None:
298
- return result.principal
299
-
300
- return None
301
-
302
-
303
- def get_capabilities_metadata() -> dict[str, Any]:
304
- """Get metadata about available authentication capabilities."""
305
- available_providers = list_capabilities("authentication_provider")
306
- current_provider = get_process_settings().phlo_authentication_provider
307
-
308
- return {
309
- "available_providers": available_providers,
310
- "current_provider": current_provider,
311
- "environment_variable": _AUTHENTICATION_PROVIDER_ENV,
312
- }