sanka-cli 0.2.6__tar.gz → 0.2.8__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 (178) hide show
  1. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/PKG-INFO +20 -6
  2. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/README.md +19 -5
  3. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/pyproject.toml +3 -1
  4. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/__init__.py +6 -2
  5. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/_client.py +109 -31
  6. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/cli/__init__.py +43 -26
  7. sanka_cli-0.2.8/src/sanka/cli/_compact.py +103 -0
  8. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/__init__.py +1 -1
  9. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/connector_client.py +18 -14
  10. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/connector_host.py +20 -16
  11. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/engine.py +17 -17
  12. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/model.py +1 -1
  13. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/report_codec.py +1 -1
  14. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/routes.py +9 -9
  15. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/scope.py +8 -8
  16. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/validate.py +2 -2
  17. sanka_cli-0.2.8/src/sanka/runtime/extensions/artifacts.py +80 -0
  18. sanka_cli-0.2.8/src/sanka/runtime/extensions/code_lifecycle.py +214 -0
  19. sanka_cli-0.2.8/src/sanka/runtime/extensions/code_repair.py +185 -0
  20. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/extensions/discovery.py +4 -4
  21. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/extensions/lifecycle.py +1 -65
  22. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/extensions/model.py +9 -2
  23. sanka_cli-0.2.8/src/sanka/runtime/extensions/runner.py +258 -0
  24. sanka_cli-0.2.6/src/sanka/runtime/extensions/runner.py → sanka_cli-0.2.8/src/sanka/runtime/extensions/stage.py +65 -230
  25. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/extensions/store.py +96 -31
  26. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/mapping_candidates.py +1 -1
  27. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/model.py +2 -2
  28. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/owner_mapping.py +1 -1
  29. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/pending_relationships.py +3 -3
  30. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/record_mapping.py +1 -1
  31. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/planner.py +2 -2
  32. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/registry.py +37 -23
  33. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/state.py +1 -1
  34. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/__init__.py +1 -1
  35. sanka_cli-0.2.8/src/sanka_cli/commands/code.py +19 -0
  36. sanka_cli-0.2.6/src/sanka_cli/commands/code.py → sanka_cli-0.2.8/src/sanka_cli/commands/functions.py +41 -37
  37. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/migrate.py +7 -7
  38. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/main.py +2 -0
  39. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/skills/sanka-cli/SKILL.md +9 -0
  40. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/__about__.py +1 -1
  41. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/__init__.py +54 -18
  42. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/credentials.py +1 -1
  43. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/errors.py +27 -16
  44. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/protocols.py +24 -15
  45. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/provisioning.py +2 -2
  46. sanka_cli-0.2.8/src/sanka_connector/registration.py +42 -0
  47. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/schema.py +10 -3
  48. sanka_cli-0.2.8/src/sanka_extension_sdk/__init__.py +32 -0
  49. sanka_cli-0.2.8/src/sanka_extension_sdk/contract.py +328 -0
  50. sanka_cli-0.2.8/src/sanka_extension_sdk/py.typed +0 -0
  51. sanka_cli-0.2.8/src/sanka_extensions/__init__.py +2 -0
  52. sanka_cli-0.2.8/src/sanka_extensions/code/__init__.py +32 -0
  53. sanka_cli-0.2.8/src/sanka_extensions/code/contract.py +4 -0
  54. sanka_cli-0.2.8/src/sanka_extensions/data/__about__.py +8 -0
  55. sanka_cli-0.2.8/src/sanka_extensions/data/__init__.py +256 -0
  56. sanka_cli-0.2.8/src/sanka_extensions/data/credentials.py +14 -0
  57. sanka_cli-0.2.8/src/sanka_extensions/data/errors.py +62 -0
  58. sanka_cli-0.2.8/src/sanka_extensions/data/protocols.py +78 -0
  59. sanka_cli-0.2.8/src/sanka_extensions/data/provisioning.py +42 -0
  60. sanka_cli-0.2.8/src/sanka_extensions/data/py.typed +0 -0
  61. sanka_cli-0.2.8/src/sanka_extensions/data/records.py +111 -0
  62. sanka_cli-0.2.8/src/sanka_extensions/data/registration.py +11 -0
  63. sanka_cli-0.2.8/src/sanka_extensions/data/schema.py +20 -0
  64. sanka_cli-0.2.8/src/sanka_extensions/flow/__init__.py +18 -0
  65. sanka_cli-0.2.8/src/sanka_extensions/flow/definition.py +140 -0
  66. sanka_cli-0.2.8/src/sanka_extensions/py.typed +0 -0
  67. sanka_cli-0.2.8/src/sanka_extensions/systems/__about__.py +6 -0
  68. sanka_cli-0.2.8/src/sanka_extensions/systems/__init__.py +132 -0
  69. sanka_cli-0.2.8/src/sanka_extensions/systems/credentials.py +8 -0
  70. sanka_cli-0.2.8/src/sanka_extensions/systems/errors.py +34 -0
  71. sanka_cli-0.2.8/src/sanka_extensions/systems/protocols.py +48 -0
  72. sanka_cli-0.2.8/src/sanka_extensions/systems/provisioning.py +24 -0
  73. sanka_cli-0.2.8/src/sanka_extensions/systems/py.typed +0 -0
  74. sanka_cli-0.2.8/src/sanka_extensions/systems/records.py +44 -0
  75. sanka_cli-0.2.8/src/sanka_extensions/systems/registration.py +7 -0
  76. sanka_cli-0.2.8/src/sanka_extensions/systems/schema.py +10 -0
  77. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/conftest.py +3 -3
  78. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_cli.py +11 -10
  79. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_cli_developer_experience.py +75 -0
  80. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_code_commands.py +41 -22
  81. sanka_cli-0.2.8/tests/test_code_lifecycle.py +241 -0
  82. sanka_cli-0.2.8/tests/test_code_repair.py +207 -0
  83. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_connector_client.py +21 -21
  84. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_connector_host.py +2 -2
  85. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_credential_provider.py +7 -7
  86. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_engine_e2e.py +2 -2
  87. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_engine_execution_adoption.py +8 -8
  88. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_engine_pg_to_clickhouse_e2e.py +2 -2
  89. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_engine_postgres_e2e.py +2 -2
  90. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_exact_scope.py +1 -1
  91. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_routes.py +1 -1
  92. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_scope.py +2 -2
  93. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_seam.py +2 -2
  94. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_validate.py +12 -12
  95. sanka_cli-0.2.8/tests/test_extension_stage.py +245 -0
  96. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_extension_store.py +114 -0
  97. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_hosted_cli.py +46 -3
  98. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_mapping_candidates.py +1 -1
  99. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_mapping_owner_mapping.py +1 -1
  100. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_mapping_pending_relationships.py +2 -2
  101. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_mapping_record_mapping.py +1 -1
  102. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_mcp.py +2 -2
  103. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_planner.py +7 -1
  104. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_registry.py +20 -20
  105. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_sanka_facade.py +52 -7
  106. sanka_cli-0.2.6/src/sanka/cli/_compact.py +0 -50
  107. sanka_cli-0.2.6/src/sanka_connector/registration.py +0 -38
  108. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/.gitignore +0 -0
  109. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/LICENSES/AGPL-3.0-only.txt +0 -0
  110. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/LICENSES/Apache-2.0.txt +0 -0
  111. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/NOTICE +0 -0
  112. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/cli/_output.py +0 -0
  113. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/cli/_research.py +0 -0
  114. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/cli/py.typed +0 -0
  115. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/connector/__init__.py +0 -0
  116. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/connector/py.typed +0 -0
  117. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/__about__.py +0 -0
  118. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/concurrency.py +0 -0
  119. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/__init__.py +0 -0
  120. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/continuous.py +0 -0
  121. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/errors.py +0 -0
  122. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/local.py +0 -0
  123. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/execution/state.py +0 -0
  124. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/extensions/__init__.py +0 -0
  125. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/hashing.py +0 -0
  126. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/__init__.py +0 -0
  127. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/mapping/errors.py +0 -0
  128. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/private_sqlite.py +0 -0
  129. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/py.typed +0 -0
  130. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/safe_local_io.py +0 -0
  131. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka/runtime/spec.py +0 -0
  132. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/__main__.py +0 -0
  133. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/bundle.py +0 -0
  134. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/certificates.py +0 -0
  135. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/client.py +0 -0
  136. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/__init__.py +0 -0
  137. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/ai.py +0 -0
  138. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/auth.py +0 -0
  139. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/cloud.py +0 -0
  140. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/cloud_fleet.py +0 -0
  141. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/cloud_migrate.py +0 -0
  142. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/profiles.py +0 -0
  143. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/resources.py +0 -0
  144. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/skill.py +0 -0
  145. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/commands/workflows.py +0 -0
  146. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/config.py +0 -0
  147. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/mcp/__init__.py +0 -0
  148. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/mcp/client.py +0 -0
  149. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/mcp/render.py +0 -0
  150. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/mcp/server.py +0 -0
  151. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/output.py +0 -0
  152. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/runtime.py +0 -0
  153. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_cli/state.py +0 -0
  154. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/py.typed +0 -0
  155. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/src/sanka_connector/records.py +0 -0
  156. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/api/__init__.py +0 -0
  157. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/api/serializers.py +0 -0
  158. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/api/views.py +0 -0
  159. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/config/__init__.py +0 -0
  160. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/config/settings.py +0 -0
  161. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/config/urls.py +0 -0
  162. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_drf_project/manage.py +0 -0
  163. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_marketplace/drf-to-fastapi.json +0 -0
  164. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/fixtures/extension_marketplace/marketplace.json +0 -0
  165. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_code_bundle.py +0 -0
  166. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_concurrency.py +0 -0
  167. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_continuous.py +0 -0
  168. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_local_store.py +0 -0
  169. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_execution_report_codec.py +0 -0
  170. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_extension_discovery.py +0 -0
  171. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_extension_lifecycle.py +0 -0
  172. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_extension_runner.py +0 -0
  173. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_extension_wheel_acceptance.py +0 -0
  174. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_hashing.py +0 -0
  175. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_safe_local_io.py +0 -0
  176. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_skill_commands.py +0 -0
  177. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_spec.py +0 -0
  178. {sanka_cli-0.2.6 → sanka_cli-0.2.8}/tests/test_state_store.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sanka-cli
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: Sanka command-line interface and migration runtime
5
5
  Project-URL: Repository, https://github.com/sankaHQ/sanka
6
6
  Project-URL: Issues, https://github.com/sankaHQ/sanka/issues
@@ -36,7 +36,7 @@ executable and contains:
36
36
 
37
37
  - the Apache-2.0 hosted command dispatcher, authentication, output, and
38
38
  optional MCP integration under `sanka_cli`;
39
- - the embedded Apache-2.0 Connector SDK under `sanka_connector`; and
39
+ - the embedded Apache-2.0 Sanka Extension SDK through `sanka_extensions`; and
40
40
  - the AGPL-3.0-only local migration runtime under `sanka`.
41
41
 
42
42
  Python 3.12 or newer is required.
@@ -108,6 +108,13 @@ workflows, AI, Custom Code, and explicitly cloud-selected migrations retain
108
108
  their existing authentication requirements. Add `--json` to local lifecycle
109
109
  commands for the stable `sanka-cli/v1` response envelope.
110
110
 
111
+ Custom functions use `sanka functions`; the old `sanka code` group keeps its original
112
+ function operations as a compatibility alias. Sanka Code migration commands remain
113
+ `scan`, `plan`, `apply`, `test`, and `verify`.
114
+
115
+ `--base-url` also selects the API origin for anonymous research/assessment. A full
116
+ migration-service URL in `SANKA_MIGRATE_API_BASE` is retained as a fallback.
117
+
111
118
  ## Hosted repository runs
112
119
 
113
120
  `sanka cloud` uploads reviewed repository ZIPs, starts runs with an explicit
@@ -126,10 +133,10 @@ component/runtime compatibility, exact wheel URL and SHA-256 digest, package
126
133
  metadata, entry points, and installed files. Project locks record the exact
127
134
  snapshot and artifact identities in `.sanka/extensions.lock`.
128
135
 
129
- Migration components use the `sanka-extension/v1` subprocess protocol.
130
- Connector implementations load only in an isolated child environment and are
136
+ Code extensions use the `sanka-extension/v1` subprocess protocol.
137
+ Extension implementations load only in an isolated child environment and are
131
138
  proxied over `sanka-connector/v1`; provider code is never imported into the
132
- main CLI process. Hosted providers are not local connectors.
139
+ main CLI process. Hosted SaaS implementations remain private to the cloud runtime.
133
140
 
134
141
  ## Python facade
135
142
 
@@ -137,7 +144,7 @@ main CLI process. Hosted providers are not local connectors.
137
144
  from sanka import Sanka
138
145
  ```
139
146
 
140
- `Sanka.connect(...)` creates a write-free endpoint descriptor.
147
+ `Sanka.configure_system(...)` creates a write-free endpoint descriptor.
141
148
  `Sanka.migrate(...)` creates or resumes a local lifecycle handle. Planning is
142
149
  destination-write-free, and apply requires the exact plan hash returned by
143
150
  plan.
@@ -176,6 +183,13 @@ contents and route source code are replaced by explicit omission counts and file
176
183
  names. Read the returned artifact for those details; a compact summary is not a
177
184
  replacement for the full report. `data.plan_hash` becomes the `plan_hash` line;
178
185
  use that core hash for apply, not a nested extension hash.
186
+ Successful scan/plan inventories replace descriptive serializer, view, OPTIONS,
187
+ parity-note and fingerprint-evidence metadata with counts and artifact references.
188
+ Identical core/extension scan fields appear once. Route decisions, adaptation
189
+ reasons, hashes and diagnostics remain inline; metadata containing diagnostics
190
+ also stays inline. Full `--json` output and saved artifacts are unchanged, and
191
+ results without artifacts retain their details.
192
+
179
193
 
180
194
  Keep the lifecycle: scan → plan → apply → test → verify. An applied scaffold with
181
195
  manual gaps is not complete. Test establishes generated scope; scenario verification
@@ -5,7 +5,7 @@ executable and contains:
5
5
 
6
6
  - the Apache-2.0 hosted command dispatcher, authentication, output, and
7
7
  optional MCP integration under `sanka_cli`;
8
- - the embedded Apache-2.0 Connector SDK under `sanka_connector`; and
8
+ - the embedded Apache-2.0 Sanka Extension SDK through `sanka_extensions`; and
9
9
  - the AGPL-3.0-only local migration runtime under `sanka`.
10
10
 
11
11
  Python 3.12 or newer is required.
@@ -77,6 +77,13 @@ workflows, AI, Custom Code, and explicitly cloud-selected migrations retain
77
77
  their existing authentication requirements. Add `--json` to local lifecycle
78
78
  commands for the stable `sanka-cli/v1` response envelope.
79
79
 
80
+ Custom functions use `sanka functions`; the old `sanka code` group keeps its original
81
+ function operations as a compatibility alias. Sanka Code migration commands remain
82
+ `scan`, `plan`, `apply`, `test`, and `verify`.
83
+
84
+ `--base-url` also selects the API origin for anonymous research/assessment. A full
85
+ migration-service URL in `SANKA_MIGRATE_API_BASE` is retained as a fallback.
86
+
80
87
  ## Hosted repository runs
81
88
 
82
89
  `sanka cloud` uploads reviewed repository ZIPs, starts runs with an explicit
@@ -95,10 +102,10 @@ component/runtime compatibility, exact wheel URL and SHA-256 digest, package
95
102
  metadata, entry points, and installed files. Project locks record the exact
96
103
  snapshot and artifact identities in `.sanka/extensions.lock`.
97
104
 
98
- Migration components use the `sanka-extension/v1` subprocess protocol.
99
- Connector implementations load only in an isolated child environment and are
105
+ Code extensions use the `sanka-extension/v1` subprocess protocol.
106
+ Extension implementations load only in an isolated child environment and are
100
107
  proxied over `sanka-connector/v1`; provider code is never imported into the
101
- main CLI process. Hosted providers are not local connectors.
108
+ main CLI process. Hosted SaaS implementations remain private to the cloud runtime.
102
109
 
103
110
  ## Python facade
104
111
 
@@ -106,7 +113,7 @@ main CLI process. Hosted providers are not local connectors.
106
113
  from sanka import Sanka
107
114
  ```
108
115
 
109
- `Sanka.connect(...)` creates a write-free endpoint descriptor.
116
+ `Sanka.configure_system(...)` creates a write-free endpoint descriptor.
110
117
  `Sanka.migrate(...)` creates or resumes a local lifecycle handle. Planning is
111
118
  destination-write-free, and apply requires the exact plan hash returned by
112
119
  plan.
@@ -145,6 +152,13 @@ contents and route source code are replaced by explicit omission counts and file
145
152
  names. Read the returned artifact for those details; a compact summary is not a
146
153
  replacement for the full report. `data.plan_hash` becomes the `plan_hash` line;
147
154
  use that core hash for apply, not a nested extension hash.
155
+ Successful scan/plan inventories replace descriptive serializer, view, OPTIONS,
156
+ parity-note and fingerprint-evidence metadata with counts and artifact references.
157
+ Identical core/extension scan fields appear once. Route decisions, adaptation
158
+ reasons, hashes and diagnostics remain inline; metadata containing diagnostics
159
+ also stays inline. Full `--json` output and saved artifacts are unchanged, and
160
+ results without artifacts retain their details.
161
+
148
162
 
149
163
  Keep the lifecycle: scan → plan → apply → test → verify. An applied scaffold with
150
164
  manual gaps is not complete. Test establishes generated scope; scenario verification
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sanka-cli"
3
- version = "0.2.6"
3
+ version = "0.2.8"
4
4
  description = "Sanka command-line interface and migration runtime"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -43,5 +43,7 @@ build-backend = "hatchling.build"
43
43
  packages = [
44
44
  "src/sanka",
45
45
  "src/sanka_cli",
46
+ "src/sanka_extensions",
46
47
  "src/sanka_connector",
48
+ "src/sanka_extension_sdk",
47
49
  ]
@@ -6,16 +6,17 @@ Install the ``sanka-cli`` distribution, then start here::
6
6
  from sanka import Sanka
7
7
  """
8
8
 
9
- from sanka._client import Connection, Migration, Sanka
9
+ from sanka._client import Connection, DataEndpoint, Migration, Sanka, SystemConfig
10
10
  from sanka.runtime.__about__ import __version__
11
11
  from sanka.runtime.engine import ExecutionError, InspectionResult, PlanMismatchError, VerifyReport
12
12
  from sanka.runtime.planner import MigrationPlan
13
- from sanka.runtime.registry import UnknownConnectorError
13
+ from sanka.runtime.registry import UnknownConnectorError, UnknownEndpointError, UnknownSystemError
14
14
  from sanka.runtime.spec import EndpointSpec, MigrationSpec, SpecError
15
15
  from sanka.runtime.state import RunStatus
16
16
 
17
17
  __all__ = [
18
18
  "Connection",
19
+ "DataEndpoint",
19
20
  "EndpointSpec",
20
21
  "ExecutionError",
21
22
  "InspectionResult",
@@ -26,7 +27,10 @@ __all__ = [
26
27
  "RunStatus",
27
28
  "Sanka",
28
29
  "SpecError",
30
+ "SystemConfig",
29
31
  "UnknownConnectorError",
32
+ "UnknownEndpointError",
33
+ "UnknownSystemError",
30
34
  "VerifyReport",
31
35
  "__version__",
32
36
  ]
@@ -12,36 +12,89 @@ from typing import Any
12
12
  from sanka.runtime.engine import InspectionResult, MigrationEngine, VerifyReport
13
13
  from sanka.runtime.execution import DEFAULT_VALIDATION_SAMPLE_SIZE
14
14
  from sanka.runtime.planner import MigrationPlan
15
- from sanka.runtime.registry import ConnectorRegistry
15
+ from sanka.runtime.registry import ExtensionRegistry
16
16
  from sanka.runtime.spec import EndpointSpec, MigrationSpec, SpecError
17
17
  from sanka.runtime.state import RunStatus, SqliteStateStore
18
- from sanka_connector import CredentialProvider
18
+ from sanka_extensions.data import CredentialProvider
19
19
 
20
20
 
21
- @dataclass(frozen=True, slots=True, kw_only=True)
22
- class Connection:
23
- """A selected connector and its non-secret endpoint configuration.
21
+ @dataclass(frozen=True, slots=True, kw_only=True, init=False)
22
+ class DataEndpoint:
23
+ """A data source or destination with independent, non-secret configuration.
24
24
 
25
- Creating a connection is write-free. It verifies that the provider is
26
- installed and returns a descriptor that can be passed directly to
27
- :meth:`Sanka.migrate`. Authentication and reachability are evaluated by the
28
- migration lifecycle, never while selecting the provider.
25
+ Creating this descriptor never authenticates an endpoint. Secret values stay
26
+ in environment variables or a managed credential store.
29
27
  """
30
28
 
31
- provider: str
29
+ endpoint_type: str
32
30
  roles: tuple[str, ...]
33
- connection: str | None = None
31
+ endpoint_reference: str | None = None
34
32
  options: Mapping[str, Any] = field(default_factory=dict)
35
33
 
34
+ def __init__(
35
+ self,
36
+ *,
37
+ endpoint_type: str | None = None,
38
+ system_type: str | None = None,
39
+ roles: tuple[str, ...],
40
+ endpoint_reference: str | None = None,
41
+ options: Mapping[str, Any] | None = None,
42
+ provider: str | None = None,
43
+ connection: str | None = None,
44
+ ) -> None:
45
+ # Old Connection keyword arguments remain accepted without silently
46
+ # choosing one endpoint when a caller supplies conflicting identities.
47
+ if system_type is not None and provider is not None and system_type != provider:
48
+ raise ValueError("system_type and compatibility provider disagree")
49
+ compatibility_type = system_type if system_type is not None else provider
50
+ if (
51
+ endpoint_type is not None
52
+ and compatibility_type is not None
53
+ and endpoint_type != compatibility_type
54
+ ):
55
+ raise ValueError("endpoint_type and compatibility type disagree")
56
+ if (
57
+ endpoint_reference is not None
58
+ and connection is not None
59
+ and endpoint_reference != connection
60
+ ):
61
+ raise ValueError("endpoint_reference and compatibility connection disagree")
62
+ selected_type = endpoint_type if endpoint_type is not None else compatibility_type
63
+ if selected_type is None or not selected_type.strip():
64
+ raise ValueError("endpoint_type is required")
65
+ object.__setattr__(self, "endpoint_type", selected_type)
66
+ object.__setattr__(self, "roles", roles)
67
+ object.__setattr__(
68
+ self,
69
+ "endpoint_reference",
70
+ endpoint_reference if endpoint_reference is not None else connection,
71
+ )
72
+ object.__setattr__(self, "options", dict(options or {}))
73
+
74
+ @property
75
+ def provider(self) -> str:
76
+ """Compatibility spelling for endpoint_type."""
77
+ return self.endpoint_type
78
+
79
+ @property
80
+ def system_type(self) -> str:
81
+ """Compatibility spelling for endpoint_type."""
82
+ return self.endpoint_type
83
+
84
+ @property
85
+ def connection(self) -> str | None:
86
+ """Compatibility spelling for endpoint_reference."""
87
+ return self.endpoint_reference
88
+
36
89
  def endpoint(self) -> EndpointSpec:
37
90
  return EndpointSpec(
38
- type=self.provider,
39
- connection=self.connection,
91
+ type=self.endpoint_type,
92
+ connection=self.endpoint_reference,
40
93
  options=dict(self.options),
41
94
  )
42
95
 
43
96
 
44
- EndpointInput = str | Path | EndpointSpec | Connection
97
+ EndpointInput = str | Path | EndpointSpec | DataEndpoint
45
98
 
46
99
 
47
100
  class Migration:
@@ -106,7 +159,7 @@ class Sanka:
106
159
  credential_provider: CredentialProvider | None = None,
107
160
  ) -> None:
108
161
  self._store = SqliteStateStore(state)
109
- self._registry = ConnectorRegistry.discover()
162
+ self._registry = ExtensionRegistry.discover()
110
163
  self._engine = MigrationEngine(
111
164
  store=self._store,
112
165
  registry=self._registry,
@@ -116,32 +169,50 @@ class Sanka:
116
169
  )
117
170
  self._closed = False
118
171
 
119
- def connect(
172
+ def configure_endpoint(
120
173
  self,
121
- provider: str,
122
- connection: str | Path | None = None,
174
+ endpoint_type: str,
175
+ endpoint_reference: str | Path | None = None,
123
176
  *,
124
177
  options: Mapping[str, Any] | None = None,
125
- ) -> Connection:
126
- """Select an installed migration connector.
178
+ ) -> DataEndpoint:
179
+ """Configure a data endpoint supported by an installed extension.
127
180
 
128
- ``connection`` is a path, URL, or named connection reference. Secret
129
- values must stay in environment variables or a managed credential
130
- store; the resulting descriptor may be persisted in a migration spec.
181
+ The endpoint reference is a path, URL, or named data endpoint.
182
+ Authentication and reachability are checked by the migration lifecycle.
131
183
  """
132
184
  self._ensure_open()
133
- normalized = provider.strip().lower()
185
+ normalized = endpoint_type.strip().lower()
134
186
  if normalized == "postgresql":
135
187
  normalized = "postgres"
136
188
  roles = self._registry.roles(normalized)
137
- connection_value = None if connection is None else str(connection)
138
- return Connection(
139
- provider=normalized,
189
+ return DataEndpoint(
190
+ endpoint_type=normalized,
140
191
  roles=roles,
141
- connection=connection_value,
142
- options=dict(options or {}),
192
+ endpoint_reference=None if endpoint_reference is None else str(endpoint_reference),
193
+ options=options,
143
194
  )
144
195
 
196
+ def configure_system(
197
+ self,
198
+ system_type: str,
199
+ endpoint_reference: str | Path | None = None,
200
+ *,
201
+ options: Mapping[str, Any] | None = None,
202
+ ) -> DataEndpoint:
203
+ """Compatibility method for configure_endpoint; does not authenticate."""
204
+ return self.configure_endpoint(system_type, endpoint_reference, options=options)
205
+
206
+ def connect(
207
+ self,
208
+ provider: str,
209
+ connection: str | Path | None = None,
210
+ *,
211
+ options: Mapping[str, Any] | None = None,
212
+ ) -> DataEndpoint:
213
+ """Compatibility method for configure_endpoint; does not authenticate."""
214
+ return self.configure_endpoint(provider, connection, options=options)
215
+
145
216
  def migrate(
146
217
  self,
147
218
  source: EndpointInput,
@@ -194,7 +265,7 @@ class Sanka:
194
265
 
195
266
 
196
267
  def _endpoint(value: EndpointInput, *, role: str) -> EndpointSpec:
197
- if isinstance(value, Connection):
268
+ if isinstance(value, DataEndpoint):
198
269
  return value.endpoint()
199
270
  if isinstance(value, EndpointSpec):
200
271
  return value
@@ -218,6 +289,13 @@ def _endpoint(value: EndpointInput, *, role: str) -> EndpointSpec:
218
289
  return EndpointSpec(type="sqlite", connection=str(path))
219
290
 
220
291
  raise SpecError(
221
- f"cannot infer the {role} connector from {raw!r}; pass an EndpointSpec, "
292
+ f"cannot infer the {role} system type from {raw!r}; pass an EndpointSpec, "
222
293
  "a URL-style endpoint, or a supported local path"
223
294
  )
295
+
296
+
297
+ # Compatibility import for clients using the original descriptor name.
298
+ Connection = DataEndpoint
299
+
300
+ # Compatibility names from the earlier systems terminology.
301
+ SystemConfig = DataEndpoint
@@ -55,7 +55,7 @@ from sanka.runtime.extensions.lifecycle import ApplicationLifecycle
55
55
  from sanka.runtime.extensions.runner import ExtensionResult
56
56
  from sanka.runtime.extensions.store import ExtensionStore
57
57
  from sanka.runtime.planner import MigrationPlan
58
- from sanka.runtime.registry import ConnectorRegistry, UnknownConnectorError
58
+ from sanka.runtime.registry import ExtensionRegistry, UnknownEndpointError
59
59
  from sanka.runtime.spec import EndpointSpec, MigrationSpec, SpecError
60
60
  from sanka.runtime.state import SqliteStateStore
61
61
 
@@ -83,12 +83,13 @@ class _CliArgumentParser(argparse.ArgumentParser):
83
83
  super().error(message)
84
84
 
85
85
 
86
- def main(argv: list[str] | None = None) -> int:
86
+ def main(argv: list[str] | None = None, *, api_base: str | None = None) -> int:
87
87
  arguments = list(sys.argv[1:] if argv is None else argv)
88
88
  json_errors = "--json" in arguments or "--compact-dsl" in arguments
89
89
  parser = _build_parser(json_errors=json_errors)
90
90
  try:
91
91
  args = parser.parse_args(arguments)
92
+ args.api_base = api_base
92
93
  except CliUsageError as error:
93
94
  command = arguments[0] if arguments and arguments[0] in SDK_COMMANDS else "sanka"
94
95
  return _print_cli_error(
@@ -121,7 +122,7 @@ def main(argv: list[str] | None = None) -> int:
121
122
  )
122
123
  except (
123
124
  SpecError,
124
- UnknownConnectorError,
125
+ UnknownEndpointError,
125
126
  ExecutionError,
126
127
  FileNotFoundError,
127
128
  ) as error:
@@ -400,7 +401,7 @@ def _build_parser(*, json_errors: bool = False) -> argparse.ArgumentParser:
400
401
 
401
402
  test = commands.add_parser(
402
403
  "test",
403
- help="generate and run unit tests for the created FastAPI app",
404
+ help="generate and run tests for the converted application",
404
405
  description=(
405
406
  "Prepare the generated uv or pip environment, write generated-app tests, and run "
406
407
  "them. This proves generated scope, not source parity."
@@ -550,9 +551,9 @@ def _build_parser(*, json_errors: bool = False) -> argparse.ArgumentParser:
550
551
 
551
552
  connect = commands.add_parser(
552
553
  "connect",
553
- help="select an installed connector and show its supported migration roles",
554
+ help="inspect installed extension support; does not authenticate a system",
554
555
  )
555
- connect.add_argument("provider", help="local provider slug, e.g. markdown or postgres")
556
+ connect.add_argument("provider", help="system type, e.g. markdown or postgres")
556
557
  connect.add_argument("--json", action="store_true", help="print provider details as JSON")
557
558
  connect.set_defaults(handler=_cmd_connect)
558
559
 
@@ -668,13 +669,20 @@ def _research_output_options(parser: argparse.ArgumentParser) -> None:
668
669
  parser.add_argument("--json", action="store_true", help="print the API data payload as JSON")
669
670
 
670
671
 
671
- def _research_client() -> SankaMigrateApiClient:
672
+ def _research_client(api_base: str | None = None) -> SankaMigrateApiClient:
673
+ # The shared CLI option names an API origin (optionally with a path prefix).
674
+ # The older SANKA_MIGRATE_API_BASE setting continues to name the full service root.
675
+ if api_base:
676
+ base = api_base.rstrip("/")
677
+ if not base.endswith("/v2/migrate"):
678
+ base += "/v2/migrate"
679
+ return SankaMigrateApiClient(base_url=base)
672
680
  return SankaMigrateApiClient()
673
681
 
674
682
 
675
683
  def _engine(state_path: str) -> MigrationEngine:
676
684
  return MigrationEngine(
677
- store=SqliteStateStore(state_path), registry=ConnectorRegistry.discover()
685
+ store=SqliteStateStore(state_path), registry=ExtensionRegistry.discover()
678
686
  )
679
687
 
680
688
 
@@ -696,7 +704,9 @@ def _extension_result(
696
704
  [
697
705
  (
698
706
  str(record.get("id", "")),
699
- str(record.get("kind", "")),
707
+ {"connector": "System access", "migration": "Code conversion"}.get(
708
+ str(record.get("kind", "")), str(record.get("kind", ""))
709
+ ),
700
710
  str(record.get("version", "")),
701
711
  ", ".join(map(str, record.get("status", []))),
702
712
  str(record.get("marketplace", "")),
@@ -791,22 +801,29 @@ async def _cmd_extension_marketplace_remove(args: argparse.Namespace) -> int:
791
801
 
792
802
 
793
803
  async def _cmd_connect(args: argparse.Namespace) -> int:
794
- registry = ConnectorRegistry.discover()
795
- provider = str(args.provider).strip().lower()
796
- if provider == "postgresql":
797
- provider = "postgres"
798
- roles = list(registry.roles(provider))
799
- payload = {
800
- "provider": provider,
801
- "roles": roles,
802
- "installed": True,
803
- "package": f"sanka-connector-{provider}",
804
- }
804
+ registry = ExtensionRegistry.discover()
805
+ system_type = str(args.provider).strip().lower()
806
+ if system_type == "postgresql":
807
+ system_type = "postgres"
808
+ try:
809
+ roles = list(registry.roles(system_type))
810
+ payload = {
811
+ "provider": system_type, # Compatibility JSON key.
812
+ "system_type": system_type,
813
+ "roles": roles,
814
+ "installed": True,
815
+ "connection_status": "not_checked",
816
+ **registry.extension_metadata(system_type),
817
+ }
818
+ finally:
819
+ registry.close()
805
820
  if args.json:
806
821
  print(json.dumps(payload, ensure_ascii=False, indent=2))
807
822
  else:
808
- print(f"{provider}: ready ({', '.join(roles)})")
809
- print(f"provided by installed package sanka-connector-{provider}")
823
+ print(f"{system_type}: extension installed ({', '.join(roles)})")
824
+ if payload.get("package"):
825
+ print(f"extension {payload['extension_id']}; package {payload['package']}")
826
+ print("System authentication and reachability have not been checked.")
810
827
  return 0
811
828
 
812
829
 
@@ -1149,7 +1166,7 @@ async def _cmd_migrate(args: argparse.Namespace) -> int:
1149
1166
 
1150
1167
  async def _cmd_research_eol(args: argparse.Namespace) -> int:
1151
1168
  data = await asyncio.to_thread(
1152
- _research_client().research_eol,
1169
+ _research_client(getattr(args, "api_base", None)).research_eol,
1153
1170
  product=args.product,
1154
1171
  category=args.category,
1155
1172
  event_type=args.type,
@@ -1162,7 +1179,7 @@ async def _cmd_research_eol(args: argparse.Namespace) -> int:
1162
1179
 
1163
1180
  async def _cmd_research_tco(args: argparse.Namespace) -> int:
1164
1181
  data = await asyncio.to_thread(
1165
- _research_client().research_tco,
1182
+ _research_client(getattr(args, "api_base", None)).research_tco,
1166
1183
  product=args.product,
1167
1184
  category=args.category,
1168
1185
  locale=args.locale,
@@ -1177,7 +1194,7 @@ async def _cmd_research_compare(args: argparse.Namespace) -> int:
1177
1194
  "--platforms accepts at most 10 comma-separated values.",
1178
1195
  )
1179
1196
  data = await asyncio.to_thread(
1180
- _research_client().research_compare,
1197
+ _research_client(getattr(args, "api_base", None)).research_compare,
1181
1198
  category=args.category,
1182
1199
  platforms=args.platforms,
1183
1200
  locale=args.locale,
@@ -1209,7 +1226,7 @@ async def _cmd_assess(args: argparse.Namespace) -> int:
1209
1226
  if elapsed_ms < 2000:
1210
1227
  await asyncio.sleep((2000 - elapsed_ms) / 1000)
1211
1228
  data = await asyncio.to_thread(
1212
- _research_client().assess,
1229
+ _research_client(getattr(args, "api_base", None)).assess,
1213
1230
  {
1214
1231
  "source": args.source,
1215
1232
  "destination": args.destination or "",
@@ -0,0 +1,103 @@
1
+ # SPDX-License-Identifier: AGPL-3.0-only
2
+ """Model-facing presentation of the existing result, with JSON-escaped values."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import json
7
+ from typing import Any
8
+
9
+ _DIAGNOSTICS = {"error", "failures", "warnings", "risks", "coverage_issues", "limitations"}
10
+
11
+
12
+ def _has_diagnostics(value: Any) -> bool:
13
+ if isinstance(value, dict):
14
+ return any(
15
+ (name in _DIAGNOSTICS and bool(item)) or _has_diagnostics(item)
16
+ for name, item in value.items()
17
+ )
18
+ return isinstance(value, list) and any(_has_diagnostics(item) for item in value)
19
+
20
+
21
+ def _summary(
22
+ value: Any, *, path: tuple[str, ...] = (), artifacts: bool = False, inventory: bool = False
23
+ ) -> Any:
24
+ if isinstance(value, dict):
25
+ if path in {("files",), ("extension", "files")} and artifacts:
26
+ return {"names": sorted(value), "omitted_file_contents": len(value)}
27
+ result: dict[str, Any] = {}
28
+ for name, item in value.items():
29
+ if inventory and artifacts:
30
+ if not path and name == "extensions" and isinstance(item, list):
31
+ item = [
32
+ {
33
+ **entry,
34
+ "data": {
35
+ k: v
36
+ for k, v in entry["data"].items()
37
+ if k not in value or value[k] != v
38
+ },
39
+ }
40
+ if isinstance(entry, dict) and isinstance(entry.get("data"), dict)
41
+ else entry
42
+ for entry in item
43
+ ]
44
+ owner = path in {(), ("extension",), ("extensions", "[]", "data")}
45
+ route = len(path) >= 2 and path[-2:] == ("routes", "[]")
46
+ if (
47
+ (
48
+ (owner and name in {"serializer_details", "view_details", "status_codes"})
49
+ or (route and name in {"parity_notes", "options"})
50
+ or (path == ("fingerprint",) and name == "evidence")
51
+ )
52
+ and isinstance(item, (dict, list))
53
+ and not _has_diagnostics(item)
54
+ ):
55
+ result[name] = {"count": len(item), "details": "artifacts"}
56
+ continue
57
+ if name == "extension" and isinstance(item, dict):
58
+ # Core lifecycle responses repeat extension fields; retain differing hashes.
59
+ item = {k: v for k, v in item.items() if k not in value or value[k] != v}
60
+ if not item:
61
+ continue
62
+ if (
63
+ name == "source"
64
+ and {"classification", "method"} <= value.keys()
65
+ and isinstance(item, str)
66
+ and artifacts
67
+ ):
68
+ result["omitted_source_characters"] = len(item)
69
+ else:
70
+ result[name] = _summary(
71
+ item,
72
+ path=(*path, name),
73
+ artifacts=artifacts,
74
+ inventory=inventory and name not in _DIAGNOSTICS,
75
+ )
76
+ return result
77
+ if isinstance(value, list):
78
+ return [
79
+ _summary(item, path=(*path, "[]"), artifacts=artifacts, inventory=inventory)
80
+ for item in value
81
+ ]
82
+ return value
83
+
84
+
85
+ def render_compact(payload: dict[str, Any]) -> str:
86
+ """One header, then key=JSON lines. Never truncate failures, warnings or hashes."""
87
+ lines = [" ".join(str(payload[k]) for k in ("command", "outcome", "migration_state"))]
88
+ lines[0] = "sanka-compact/v1 " + lines[0]
89
+ data = _summary(
90
+ payload["data"],
91
+ artifacts=bool(payload.get("artifacts")),
92
+ inventory=payload["command"] in {"scan", "plan"} and payload["outcome"] == "success",
93
+ )
94
+ for key, value in data.items():
95
+ # Escape even extension-defined keys so a newline cannot forge another record.
96
+ label = key if key.isidentifier() else json.dumps(key, ensure_ascii=False)
97
+ lines.append(label + "=" + json.dumps(value, ensure_ascii=False, separators=(",", ":")))
98
+ for key in ("artifacts", "limitations", "next_actions"):
99
+ if payload.get(key):
100
+ lines.append(
101
+ key + "=" + json.dumps(payload[key], ensure_ascii=False, separators=(",", ":"))
102
+ )
103
+ return "\n".join(lines)
@@ -2,7 +2,7 @@
2
2
  """Sanka Runtime — planner, engine, state, and verification.
3
3
 
4
4
  Everything under ``sanka.runtime`` is AGPL-3.0-only. Connectors must not
5
- import this package; they depend on the Apache-2.0 ``sanka_connector`` SPI
5
+ import this package; they depend on the Apache-2.0 ``sanka_extensions.data`` SPI
6
6
  instead, and CI enforces that boundary.
7
7
 
8
8
  The runtime lands in Phase 2 (lifecycle state machine, SQLite state store,