x4d-devkit 0.60.0__tar.gz → 0.61.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 (183) hide show
  1. {x4d_devkit-0.60.0/x4d_devkit.egg-info → x4d_devkit-0.61.0}/PKG-INFO +1 -1
  2. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/pyproject.toml +1 -1
  3. x4d_devkit-0.61.0/tests/test_contracts.py +161 -0
  4. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_sdk_api.py +1 -1
  5. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/cli.py +68 -0
  6. x4d_devkit-0.61.0/x4d_devkit/contracts.py +186 -0
  7. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0/x4d_devkit.egg-info}/PKG-INFO +1 -1
  8. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit.egg-info/SOURCES.txt +2 -0
  9. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/LICENSE +0 -0
  10. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/README.md +0 -0
  11. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/setup.cfg +0 -0
  12. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_accounts.py +0 -0
  13. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_annotation_contract.py +0 -0
  14. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_annotation_document_hash.py +0 -0
  15. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_annotation_reference.py +0 -0
  16. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_assets_client.py +0 -0
  17. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_boundary.py +0 -0
  18. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_box.py +0 -0
  19. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_build_info.py +0 -0
  20. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_category_audit.py +0 -0
  21. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_clean_basemap.py +0 -0
  22. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_clean_basemap_client.py +0 -0
  23. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_cli_auth.py +0 -0
  24. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_client_json_contract.py +0 -0
  25. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_client_projects.py +0 -0
  26. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_clip_archives.py +0 -0
  27. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_contract_validation.py +0 -0
  28. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_coordinate_frames.py +0 -0
  29. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_current_state.py +0 -0
  30. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_current_state_identity_consumers_example.py +0 -0
  31. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_dataset_contract.py +0 -0
  32. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_dataset_identity.py +0 -0
  33. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_detection_eval.py +0 -0
  34. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_evaluate.py +0 -0
  35. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_export_bundle.py +0 -0
  36. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_clip.py +0 -0
  37. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_conditional_rules.py +0 -0
  38. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_enum_set.py +0 -0
  39. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_export.py +0 -0
  40. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_external_predictions.py +0 -0
  41. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_geometry.py +0 -0
  42. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_groups.py +0 -0
  43. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_polygon.py +0 -0
  44. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_preannotation.py +0 -0
  45. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_reference.py +0 -0
  46. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_review.py +0 -0
  47. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_schema_migration.py +0 -0
  48. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_schema_registry_client.py +0 -0
  49. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_schema_upgrade.py +0 -0
  50. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_source.py +0 -0
  51. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_image_work_session.py +0 -0
  52. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_inference_input.py +0 -0
  53. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_inference_schemas.py +0 -0
  54. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_inference_service.py +0 -0
  55. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_label_schemas.py +0 -0
  56. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_lidar_materialization.py +0 -0
  57. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_loader.py +0 -0
  58. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_matching.py +0 -0
  59. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_metrics.py +0 -0
  60. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_models.py +0 -0
  61. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_parse_equivalence.py +0 -0
  62. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_platform_pose.py +0 -0
  63. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_preannotation_client.py +0 -0
  64. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_project_discovery.py +0 -0
  65. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_reconstruction_client.py +0 -0
  66. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_release_gate.py +0 -0
  67. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_roadmark_preview.py +0 -0
  68. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_semantic_scene_authoring.py +0 -0
  69. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_semantic_scene_client.py +0 -0
  70. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_semantic_scene_contract.py +0 -0
  71. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_semantic_scene_independent.py +0 -0
  72. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_semantic_scene_native_clip.py +0 -0
  73. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_source_attributes.py +0 -0
  74. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_source_content.py +0 -0
  75. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_time_contract.py +0 -0
  76. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_token.py +0 -0
  77. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_tracking_eval.py +0 -0
  78. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_training_identity.py +0 -0
  79. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_transform.py +0 -0
  80. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_transform_chain.py +0 -0
  81. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_validation.py +0 -0
  82. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_vector_map.py +0 -0
  83. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_vector_map_geometry.py +0 -0
  84. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_vector_map_session.py +0 -0
  85. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_work_items.py +0 -0
  86. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_work_session.py +0 -0
  87. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/tests/test_work_session_validation_reuse.py +0 -0
  88. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/__init__.py +0 -0
  89. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/_image_contract.py +0 -0
  90. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/accounts.py +0 -0
  91. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/annotation_contract.py +0 -0
  92. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/annotation_reference.py +0 -0
  93. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/audit.py +0 -0
  94. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/build_info.py +0 -0
  95. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/clean_basemap.py +0 -0
  96. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/__init__.py +0 -0
  97. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/_origin.py +0 -0
  98. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/accounts.py +0 -0
  99. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/annotation_reference.py +0 -0
  100. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/assets.py +0 -0
  101. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/bags.py +0 -0
  102. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/capabilities.py +0 -0
  103. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/checkpoints.py +0 -0
  104. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/clean_basemap.py +0 -0
  105. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/client.py +0 -0
  106. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/clip_work_sessions.py +0 -0
  107. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/clips.py +0 -0
  108. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/dataset_identity.py +0 -0
  109. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/image_clips.py +0 -0
  110. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/image_exports.py +0 -0
  111. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/image_preannotations.py +0 -0
  112. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/image_review.py +0 -0
  113. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/image_schemas.py +0 -0
  114. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/image_work_sessions.py +0 -0
  115. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/label_schemas.py +0 -0
  116. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/preannotation.py +0 -0
  117. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/projects.py +0 -0
  118. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/reconstruction.py +0 -0
  119. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/semantic_scene.py +0 -0
  120. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/semantic_scene_authoring.py +0 -0
  121. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/services.py +0 -0
  122. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/test_sets.py +0 -0
  123. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/client/work_items.py +0 -0
  124. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/consumer_identity.py +0 -0
  125. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/coordinate_contract.py +0 -0
  126. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/core/__init__.py +0 -0
  127. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/core/loader.py +0 -0
  128. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/core/models.py +0 -0
  129. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/core/token.py +0 -0
  130. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/core/transform.py +0 -0
  131. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/current_state.py +0 -0
  132. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/dataset_contract.py +0 -0
  133. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/dataset_identity.py +0 -0
  134. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/__init__.py +0 -0
  135. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/api.py +0 -0
  136. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/box.py +0 -0
  137. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/detection.py +0 -0
  138. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/matching.py +0 -0
  139. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/metrics.py +0 -0
  140. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/eval/tracking.py +0 -0
  141. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/export_bundle.py +0 -0
  142. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_clip.py +0 -0
  143. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_export.py +0 -0
  144. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_geometry.py +0 -0
  145. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_groups.py +0 -0
  146. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_preannotation.py +0 -0
  147. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_reference.py +0 -0
  148. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_review.py +0 -0
  149. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_schema.py +0 -0
  150. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_schema_migration.py +0 -0
  151. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_schema_upgrade.py +0 -0
  152. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_source.py +0 -0
  153. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/image_work_session.py +0 -0
  154. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/inference/__init__.py +0 -0
  155. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/inference/input.py +0 -0
  156. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/inference/models.py +0 -0
  157. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/inference/schemas.py +0 -0
  158. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/inference/service.py +0 -0
  159. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/inference/tasks.py +0 -0
  160. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/json_contract.py +0 -0
  161. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/label_schema.py +0 -0
  162. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/lidar_materialization.py +0 -0
  163. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/materialize.py +0 -0
  164. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/project_discovery.py +0 -0
  165. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/roadmark_preview.py +0 -0
  166. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/semantic_scene_authoring.py +0 -0
  167. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/semantic_scene_contract.py +0 -0
  168. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/source_content.py +0 -0
  169. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/time_contract.py +0 -0
  170. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/training_identity.py +0 -0
  171. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/validation/__init__.py +0 -0
  172. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/validation/contract.py +0 -0
  173. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/validation/platform_pose.py +0 -0
  174. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/validation/report.py +0 -0
  175. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/validation/validator.py +0 -0
  176. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/vector_map.py +0 -0
  177. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/vector_map_geometry.py +0 -0
  178. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/work_items.py +0 -0
  179. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit/work_session.py +0 -0
  180. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit.egg-info/dependency_links.txt +0 -0
  181. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit.egg-info/entry_points.txt +0 -0
  182. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit.egg-info/requires.txt +0 -0
  183. {x4d_devkit-0.60.0 → x4d_devkit-0.61.0}/x4d_devkit.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: x4d-devkit
3
- Version: 0.60.0
3
+ Version: 0.61.0
4
4
  Summary: Official X-4D external SDK and CLI for datasets, platform APIs, training bridges, and automation
5
5
  Author: windzu
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "x4d-devkit"
7
- version = "0.60.0"
7
+ version = "0.61.0"
8
8
  description = "Official X-4D external SDK and CLI for datasets, platform APIs, training bridges, and automation"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -0,0 +1,161 @@
1
+ import importlib
2
+ import json
3
+ import pkgutil
4
+ import sys
5
+ import zipfile
6
+
7
+ import pytest
8
+
9
+ import x4d_devkit
10
+ from x4d_devkit import cli
11
+ from x4d_devkit.consumer_identity import CONSUMER_IDENTITY_DIFF_SCHEMA_VERSION
12
+ from x4d_devkit.contracts import (
13
+ CONTRACT_MANIFEST_VERSION,
14
+ ContractManifest,
15
+ ContractManifestError,
16
+ build_manifest,
17
+ compare_manifests,
18
+ compatibility_document,
19
+ contract_family,
20
+ installed_manifest,
21
+ wheel_manifest,
22
+ )
23
+ from x4d_devkit.dataset_identity import DATASET_DIFF_SCHEMA_VERSION
24
+ from x4d_devkit.work_session import WORK_SESSION_CONTRACT_VERSION
25
+
26
+
27
+ def test_contract_family_strips_only_the_exact_version_suffix():
28
+ assert contract_family("x4d-dataset-identity-diff-v8") == "x4d-dataset-identity-diff"
29
+ assert contract_family("x4d-account-page-v3") == "x4d-account-page"
30
+ for bad in ("x4d-account", "x4d-account-v0", "X4D-account-v1", "x4d-account-v1 "):
31
+ with pytest.raises(ContractManifestError):
32
+ contract_family(bad)
33
+
34
+
35
+ def test_installed_manifest_states_one_current_identifier_per_family():
36
+ manifest = installed_manifest()
37
+
38
+ assert manifest.devkit_version == x4d_devkit.__version__
39
+ for contract_id in (
40
+ DATASET_DIFF_SCHEMA_VERSION,
41
+ WORK_SESSION_CONTRACT_VERSION,
42
+ CONSUMER_IDENTITY_DIFF_SCHEMA_VERSION,
43
+ ):
44
+ assert manifest.contracts[contract_family(contract_id)] == contract_id
45
+
46
+
47
+ def test_every_public_contract_version_constant_is_in_the_manifest():
48
+ contracts = set(installed_manifest().contracts.values())
49
+ missing = []
50
+ for module_info in pkgutil.walk_packages(x4d_devkit.__path__, "x4d_devkit."):
51
+ module = importlib.import_module(module_info.name)
52
+ for name, value in vars(module).items():
53
+ if (
54
+ name.isupper()
55
+ and isinstance(value, str)
56
+ and value.startswith("x4d-")
57
+ and value[-1].isdigit()
58
+ and "-v" in value
59
+ and value not in contracts
60
+ ):
61
+ missing.append(f"{module_info.name}.{name}={value}")
62
+ assert not missing
63
+
64
+
65
+ def test_build_manifest_rejects_two_identifiers_for_one_family():
66
+ sources = [("a.py", 'A = "x4d-thing-v1"\n'), ("b.py", 'B = "x4d-thing-v2"\n')]
67
+ with pytest.raises(ContractManifestError, match="x4d-thing"):
68
+ build_manifest("1.0.0", sources)
69
+
70
+
71
+ def test_build_manifest_counts_only_whole_identifier_constants():
72
+ source = '"""Docstring mentioning x4d-other-v9."""\nA = "x4d-thing-v1"\nB = f"x4d-x-v{1}"\n'
73
+ manifest = build_manifest("1.0.0", [("a.py", source)])
74
+ assert manifest.contracts == {"x4d-thing": "x4d-thing-v1"}
75
+
76
+
77
+ def test_compare_reports_only_shared_families_with_different_identifiers():
78
+ producer = ContractManifest("2.0.0", {"x4d-a": "x4d-a-v2", "x4d-b": "x4d-b-v1", "x4d-new": "x4d-new-v1"})
79
+ consumer = ContractManifest("1.0.0", {"x4d-a": "x4d-a-v1", "x4d-b": "x4d-b-v1", "x4d-old": "x4d-old-v1"})
80
+
81
+ mismatches = compare_manifests(producer, consumer)
82
+
83
+ assert [(m.family, m.producer, m.consumer) for m in mismatches] == [("x4d-a", "x4d-a-v2", "x4d-a-v1")]
84
+ document = compatibility_document(producer, consumer)
85
+ assert document["compatible"] is False
86
+ assert document["shared_families"] == 2
87
+ assert compatibility_document(producer, producer)["compatible"] is True
88
+
89
+
90
+ def _write_wheel(path, *, name="x4d_devkit", version="9.9.9", sources=None):
91
+ with zipfile.ZipFile(path, "w") as archive:
92
+ archive.writestr(
93
+ f"{name}-{version}.dist-info/METADATA",
94
+ f"Metadata-Version: 2.1\nName: {name.replace('_', '-')}\nVersion: {version}\n",
95
+ )
96
+ for member, text in (sources or {}).items():
97
+ archive.writestr(member, text)
98
+
99
+
100
+ def test_wheel_manifest_reads_sources_without_installing(tmp_path):
101
+ wheel = tmp_path / "x4d_devkit-9.9.9-py3-none-any.whl"
102
+ _write_wheel(
103
+ wheel,
104
+ sources={
105
+ "x4d_devkit/__init__.py": "import does_not_exist\n",
106
+ "x4d_devkit/sub/mod.py": 'V = "x4d-thing-v4"\n',
107
+ "other/mod.py": 'V = "x4d-ignored-v1"\n',
108
+ },
109
+ )
110
+
111
+ manifest = wheel_manifest(wheel)
112
+
113
+ assert manifest.devkit_version == "9.9.9"
114
+ assert manifest.contracts == {"x4d-thing": "x4d-thing-v4"}
115
+
116
+
117
+ def test_wheel_manifest_rejects_other_packages(tmp_path):
118
+ wheel = tmp_path / "other-1.0.0-py3-none-any.whl"
119
+ _write_wheel(wheel, name="other", version="1.0.0", sources={"x4d_devkit/a.py": ""})
120
+ with pytest.raises(ContractManifestError):
121
+ wheel_manifest(wheel)
122
+ with pytest.raises(ContractManifestError):
123
+ wheel_manifest(tmp_path / "missing.whl")
124
+
125
+
126
+ def _run_cli(monkeypatch, capsys, *argv):
127
+ monkeypatch.setattr(sys, "argv", ["x4d-devkit", *argv])
128
+ code = 0
129
+ try:
130
+ cli.main()
131
+ except SystemExit as exc:
132
+ code = exc.code
133
+ return code, capsys.readouterr().out
134
+
135
+
136
+ def test_cli_manifest_and_compare(tmp_path, monkeypatch, capsys):
137
+ code, out = _run_cli(monkeypatch, capsys, "contracts", "manifest", "--format", "json")
138
+ assert code == 0
139
+ document = json.loads(out)
140
+ assert document["contract_version"] == CONTRACT_MANIFEST_VERSION
141
+ assert document["devkit_version"] == x4d_devkit.__version__
142
+
143
+ old = tmp_path / "x4d_devkit-0.0.1-py3-none-any.whl"
144
+ _write_wheel(
145
+ old,
146
+ version="0.0.1",
147
+ sources={"x4d_devkit/a.py": 'V = "x4d-dataset-identity-diff-v1"\n'},
148
+ )
149
+ code, out = _run_cli(
150
+ monkeypatch, capsys, "contracts", "compare", "--consumer-wheel", str(old), "--format", "json"
151
+ )
152
+ assert code == 3
153
+ report = json.loads(out)
154
+ assert report["compatible"] is False
155
+ assert report["mismatches"] == [
156
+ {
157
+ "family": "x4d-dataset-identity-diff",
158
+ "producer": DATASET_DIFF_SCHEMA_VERSION,
159
+ "consumer": "x4d-dataset-identity-diff-v1",
160
+ }
161
+ ]
@@ -11,7 +11,7 @@ from x4d_devkit.eval.matching import MetricData
11
11
 
12
12
 
13
13
  def test_package_version_is_current_release():
14
- assert x4d_devkit.__version__ == "0.60.0"
14
+ assert x4d_devkit.__version__ == "0.61.0"
15
15
 
16
16
 
17
17
  def test_loader_exposes_and_enforces_only_current_schema(tmp_path):
@@ -688,6 +688,51 @@ def cmd_dataset_coordinate_contract(args):
688
688
  print(format_training_coordinate_contract())
689
689
 
690
690
 
691
+ def _contract_manifest(wheel):
692
+ from x4d_devkit.contracts import installed_manifest, wheel_manifest
693
+
694
+ return wheel_manifest(wheel) if wheel else installed_manifest()
695
+
696
+
697
+ def cmd_contracts_manifest(args):
698
+ from x4d_devkit.contracts import ContractManifestError
699
+
700
+ try:
701
+ manifest = _contract_manifest(args.wheel)
702
+ except ContractManifestError as exc:
703
+ raise SystemExit(f"contract manifest error: {exc}")
704
+ if args.format == "json":
705
+ print_json(manifest.to_document())
706
+ return
707
+ print(f"x4d-devkit {manifest.devkit_version}: {len(manifest.contracts)} contract families")
708
+ for family, contract_id in sorted(manifest.contracts.items()):
709
+ print(f" {contract_id}")
710
+
711
+
712
+ def cmd_contracts_compare(args):
713
+ from x4d_devkit.contracts import ContractManifestError, compatibility_document
714
+
715
+ try:
716
+ document = compatibility_document(
717
+ _contract_manifest(args.producer_wheel), _contract_manifest(args.consumer_wheel)
718
+ )
719
+ except ContractManifestError as exc:
720
+ raise SystemExit(f"contract manifest error: {exc}")
721
+ if args.format == "json":
722
+ print_json(document)
723
+ else:
724
+ verdict = "compatible" if document["compatible"] else "INCOMPATIBLE"
725
+ print(
726
+ f"producer {document['producer_devkit_version']} / consumer "
727
+ f"{document['consumer_devkit_version']}: {verdict} "
728
+ f"({document['shared_families']} shared families)"
729
+ )
730
+ for item in document["mismatches"]:
731
+ print(f" {item['family']}: producer {item['producer']} / consumer {item['consumer']}")
732
+ if not document["compatible"]:
733
+ sys.exit(3)
734
+
735
+
691
736
  def main():
692
737
  parser = argparse.ArgumentParser(prog="x4d-devkit", description="X-4D DevKit CLI")
693
738
  parser.add_argument(
@@ -702,6 +747,29 @@ def main():
702
747
  p_version.add_argument("--format", choices=["table", "json"], default="table")
703
748
  p_version.set_defaults(func=cmd_version)
704
749
 
750
+ p_contracts = sub.add_parser(
751
+ "contracts", help="Offline contract manifests and cross-application compatibility"
752
+ )
753
+ p_contracts_sub = p_contracts.add_subparsers(dest="subcommand")
754
+ p_contracts_manifest = p_contracts_sub.add_parser(
755
+ "manifest", help="List the exact contract identifiers of a Devkit version"
756
+ )
757
+ p_contracts_manifest.add_argument(
758
+ "--wheel", default=None, help="Read a Devkit wheel instead of the installed package"
759
+ )
760
+ p_contracts_manifest.add_argument("--format", choices=["table", "json"], default="table")
761
+ p_contracts_manifest.set_defaults(func=cmd_contracts_manifest)
762
+ p_contracts_compare = p_contracts_sub.add_parser(
763
+ "compare",
764
+ help="Fail (exit 3) when two Devkit versions disagree on a shared contract",
765
+ )
766
+ p_contracts_compare.add_argument(
767
+ "--producer-wheel", default=None, help="Producer wheel (default: installed package)"
768
+ )
769
+ p_contracts_compare.add_argument("--consumer-wheel", required=True, help="Consumer wheel")
770
+ p_contracts_compare.add_argument("--format", choices=["table", "json"], default="table")
771
+ p_contracts_compare.set_defaults(func=cmd_contracts_compare)
772
+
705
773
  p_login = sub.add_parser("login", help="Authenticate and save CLI config")
706
774
  p_login.add_argument("--username", required=True)
707
775
  p_login.add_argument("--password", default=None)
@@ -0,0 +1,186 @@
1
+ """Portable contract-ID manifests and cross-application compatibility.
2
+
3
+ Every portable contract carries an exact identifier such as
4
+ ``x4d-dataset-identity-diff-v8``. The identifiers are owned by the modules that
5
+ parse or produce them; this module does not keep a second registry. It derives
6
+ the manifest by scanning the package source for string constants that are
7
+ exactly one contract identifier, so the same code reads the installed package
8
+ or any published wheel without installing or importing it.
9
+
10
+ Two applications that exchange data are compatible only when every contract
11
+ family both of their Devkit versions know has the same identifier. Devkit
12
+ accepts only the current version of each contract, so a different identifier
13
+ means one side rejects the other's documents.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import ast
19
+ import re
20
+ import zipfile
21
+ from dataclasses import dataclass
22
+ from email.parser import HeaderParser
23
+ from pathlib import Path
24
+ from typing import Iterable, Mapping
25
+
26
+ CONTRACT_MANIFEST_VERSION = "x4d-devkit-contract-manifest-v1"
27
+ CONTRACT_COMPATIBILITY_VERSION = "x4d-contract-compatibility-v1"
28
+
29
+ CONTRACT_ID_PATTERN = re.compile(r"^x4d-[a-z0-9]+(?:-[a-z0-9]+)*-v[1-9][0-9]*$")
30
+ _VERSION_SUFFIX = re.compile(r"-v[1-9][0-9]*$")
31
+ _PACKAGE = "x4d_devkit"
32
+
33
+
34
+ class ContractManifestError(ValueError):
35
+ """A package source cannot produce one unambiguous contract manifest."""
36
+
37
+
38
+ def contract_family(contract_id: str) -> str:
39
+ """Return the version-free family of one exact contract identifier."""
40
+ if not CONTRACT_ID_PATTERN.fullmatch(contract_id):
41
+ raise ContractManifestError(f"not a contract identifier: {contract_id!r}")
42
+ return _VERSION_SUFFIX.sub("", contract_id)
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ class ContractManifest:
47
+ """The exact contract identifier of every family in one Devkit version."""
48
+
49
+ devkit_version: str
50
+ contracts: Mapping[str, str]
51
+
52
+ def to_document(self) -> dict:
53
+ return {
54
+ "contract_version": CONTRACT_MANIFEST_VERSION,
55
+ "devkit_version": self.devkit_version,
56
+ "contracts": dict(sorted(self.contracts.items())),
57
+ }
58
+
59
+
60
+ @dataclass(frozen=True)
61
+ class ContractMismatch:
62
+ """One family both sides know, with different exact identifiers."""
63
+
64
+ family: str
65
+ producer: str
66
+ consumer: str
67
+
68
+
69
+ def _scan_source(text: str, origin: str) -> set[str]:
70
+ try:
71
+ tree = ast.parse(text, filename=origin)
72
+ except SyntaxError as exc:
73
+ raise ContractManifestError(f"cannot parse {origin}: {exc}") from exc
74
+ return {
75
+ node.value
76
+ for node in ast.walk(tree)
77
+ if isinstance(node, ast.Constant)
78
+ and isinstance(node.value, str)
79
+ and CONTRACT_ID_PATTERN.fullmatch(node.value)
80
+ }
81
+
82
+
83
+ def build_manifest(devkit_version: str, sources: Iterable[tuple[str, str]]) -> ContractManifest:
84
+ """Build a manifest from ``(origin, python_source)`` pairs.
85
+
86
+ Fails when one family has more than one identifier: the package would then
87
+ not state a single current version for that contract.
88
+ """
89
+ if not devkit_version:
90
+ raise ContractManifestError("devkit_version is required")
91
+ by_family: dict[str, set[str]] = {}
92
+ for origin, text in sources:
93
+ for contract_id in _scan_source(text, origin):
94
+ by_family.setdefault(contract_family(contract_id), set()).add(contract_id)
95
+ ambiguous = {family: ids for family, ids in by_family.items() if len(ids) > 1}
96
+ if ambiguous:
97
+ detail = "; ".join(f"{family}: {sorted(ids)}" for family, ids in sorted(ambiguous.items()))
98
+ raise ContractManifestError(f"contract families with more than one identifier: {detail}")
99
+ return ContractManifest(
100
+ devkit_version=devkit_version,
101
+ contracts={family: next(iter(ids)) for family, ids in sorted(by_family.items())},
102
+ )
103
+
104
+
105
+ def installed_manifest() -> ContractManifest:
106
+ """Return the manifest of the running ``x4d_devkit`` package."""
107
+ from x4d_devkit import __version__
108
+
109
+ root = Path(__file__).resolve().parent
110
+ sources = (
111
+ (str(path.relative_to(root.parent)), path.read_text(encoding="utf-8"))
112
+ for path in sorted(root.rglob("*.py"))
113
+ )
114
+ return build_manifest(__version__, sources)
115
+
116
+
117
+ def wheel_manifest(wheel_path: str | Path) -> ContractManifest:
118
+ """Return the manifest of one Devkit wheel without installing or importing it."""
119
+ path = Path(wheel_path)
120
+ try:
121
+ archive = zipfile.ZipFile(path)
122
+ except (OSError, zipfile.BadZipFile) as exc:
123
+ raise ContractManifestError(f"cannot open wheel {path}: {exc}") from exc
124
+ with archive:
125
+ names = archive.namelist()
126
+ metadata = [
127
+ name
128
+ for name in names
129
+ if name.count("/") == 1
130
+ and name.startswith("x4d_devkit-")
131
+ and name.endswith(".dist-info/METADATA")
132
+ ]
133
+ if len(metadata) != 1:
134
+ raise ContractManifestError(f"{path} is not one x4d-devkit wheel")
135
+ headers = HeaderParser().parsestr(archive.read(metadata[0]).decode("utf-8"))
136
+ if (headers.get("Name") or "").lower().replace("_", "-") != "x4d-devkit":
137
+ raise ContractManifestError(f"{path} is not an x4d-devkit wheel")
138
+ version = headers.get("Version") or ""
139
+ sources = [
140
+ (name, archive.read(name).decode("utf-8"))
141
+ for name in sorted(names)
142
+ if name.startswith(f"{_PACKAGE}/") and name.endswith(".py")
143
+ ]
144
+ if not sources:
145
+ raise ContractManifestError(f"{path} contains no {_PACKAGE} sources")
146
+ return build_manifest(version, sources)
147
+
148
+
149
+ def compare_manifests(producer: ContractManifest, consumer: ContractManifest) -> list[ContractMismatch]:
150
+ """Return every shared family whose exact identifiers differ."""
151
+ return [
152
+ ContractMismatch(family=family, producer=producer.contracts[family], consumer=consumer_id)
153
+ for family, consumer_id in sorted(consumer.contracts.items())
154
+ if family in producer.contracts and producer.contracts[family] != consumer_id
155
+ ]
156
+
157
+
158
+ def compatibility_document(producer: ContractManifest, consumer: ContractManifest) -> dict:
159
+ """A machine-readable compatibility verdict for one producer/consumer pair."""
160
+ mismatches = compare_manifests(producer, consumer)
161
+ return {
162
+ "contract_version": CONTRACT_COMPATIBILITY_VERSION,
163
+ "compatible": not mismatches,
164
+ "producer_devkit_version": producer.devkit_version,
165
+ "consumer_devkit_version": consumer.devkit_version,
166
+ "shared_families": len(set(producer.contracts) & set(consumer.contracts)),
167
+ "mismatches": [
168
+ {"family": m.family, "producer": m.producer, "consumer": m.consumer} for m in mismatches
169
+ ],
170
+ }
171
+
172
+
173
+ __all__ = [
174
+ "CONTRACT_COMPATIBILITY_VERSION",
175
+ "CONTRACT_ID_PATTERN",
176
+ "CONTRACT_MANIFEST_VERSION",
177
+ "ContractManifest",
178
+ "ContractManifestError",
179
+ "ContractMismatch",
180
+ "build_manifest",
181
+ "compare_manifests",
182
+ "compatibility_document",
183
+ "contract_family",
184
+ "installed_manifest",
185
+ "wheel_manifest",
186
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: x4d-devkit
3
- Version: 0.60.0
3
+ Version: 0.61.0
4
4
  Summary: Official X-4D external SDK and CLI for datasets, platform APIs, training bridges, and automation
5
5
  Author: windzu
6
6
  License-Expression: Apache-2.0
@@ -17,6 +17,7 @@ tests/test_client_json_contract.py
17
17
  tests/test_client_projects.py
18
18
  tests/test_clip_archives.py
19
19
  tests/test_contract_validation.py
20
+ tests/test_contracts.py
20
21
  tests/test_coordinate_frames.py
21
22
  tests/test_current_state.py
22
23
  tests/test_current_state_identity_consumers_example.py
@@ -88,6 +89,7 @@ x4d_devkit/build_info.py
88
89
  x4d_devkit/clean_basemap.py
89
90
  x4d_devkit/cli.py
90
91
  x4d_devkit/consumer_identity.py
92
+ x4d_devkit/contracts.py
91
93
  x4d_devkit/coordinate_contract.py
92
94
  x4d_devkit/current_state.py
93
95
  x4d_devkit/dataset_contract.py
File without changes
File without changes
File without changes