sanka-cli 0.2.12__tar.gz → 0.2.13__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.
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/PKG-INFO +1 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/pyproject.toml +1 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/discovery.py +2 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/lifecycle.py +12 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/__init__.py +1 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/__init__.py +4 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/blueprint.py +32 -8
- sanka_cli-0.2.13/src/sanka_extensions/flow/native.py +185 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/protocol.py +28 -2
- sanka_cli-0.2.13/tests/fixtures/flow/synthetic_native_order_billing_blueprint.json +88 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/flow_wheel_acceptance.py +43 -9
- sanka_cli-0.2.13/tests/test_business_flow_extension_acceptance.py +143 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_cli.py +1 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_extension.py +15 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_extension_wheel_acceptance.py +15 -2
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_lifecycle.py +23 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_mcp_retirement.py +1 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_sanka_facade.py +1 -1
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/.gitignore +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/LICENSES/AGPL-3.0-only.txt +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/LICENSES/Apache-2.0.txt +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/NOTICE +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/README.md +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/_client.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/cli/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/cli/_compact.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/cli/_output.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/cli/_research.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/cli/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/connector/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/connector/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/__about__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/concurrency.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/connector_client.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/connector_host.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/engine.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/continuous.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/errors.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/local.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/model.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/report_codec.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/routes.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/scope.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/state.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/execution/validate.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/artifacts.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/code_lifecycle.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/code_repair.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/lifecycle.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/model.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/runner.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/stage.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/extensions/store.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/extension.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/host.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/merge.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/model.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/planner.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/sqlite.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/state.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/flow/verification.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/hashing.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/errors.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/mapping_candidates.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/model.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/owner_mapping.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/pending_relationships.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/mapping/record_mapping.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/planner.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/private_sqlite.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/registry.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/safe_local_io.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/spec.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka/runtime/state.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/__main__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/bundle.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/certificates.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/client.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/ai.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/auth.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/cloud.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/cloud_fleet.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/cloud_migrate.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/code.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/doctor.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/functions.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/migrate.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/profiles.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/resources.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/skill.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/commands/workflows.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/config.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/main.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/output.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/runtime.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/skills/sanka-cli/SKILL.md +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_cli/state.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/__about__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/credentials.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/errors.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/protocols.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/provisioning.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/records.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/registration.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_connector/schema.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extension_sdk/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extension_sdk/contract.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extension_sdk/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/code/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/code/contract.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/__about__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/credentials.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/errors.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/protocols.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/provisioning.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/records.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/registration.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/data/schema.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/_wire.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/definition.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/graph.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/identity.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/scenario.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/flow/source.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/__about__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/credentials.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/errors.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/protocols.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/provisioning.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/py.typed +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/records.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/registration.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/src/sanka_extensions/systems/schema.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/conftest.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/api/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/api/serializers.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/api/views.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/config/__init__.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/config/settings.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/config/urls.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_drf_project/manage.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_marketplace/drf-to-fastapi.json +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/extension_marketplace/marketplace.json +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/flow/synthetic_sales_created_estimate_blueprint.json +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/fixtures/flow/synthetic_sales_quote_blueprint.json +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_cli_developer_experience.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_code_bundle.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_code_commands.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_code_lifecycle.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_code_repair.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_concurrency.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_connector_client.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_connector_host.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_credential_provider.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_doctor.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_engine_e2e.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_engine_execution_adoption.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_engine_pg_to_clickhouse_e2e.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_engine_postgres_e2e.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_continuous.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_exact_scope.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_local_store.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_report_codec.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_routes.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_scope.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_seam.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_execution_validate.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_extension_discovery.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_extension_lifecycle.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_extension_runner.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_extension_stage.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_extension_store.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_extension_wheel_acceptance.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_merge.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_planner.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_sdk_codec.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_sqlite.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_flow_verification.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_hashing.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_hosted_cli.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_mapping_candidates.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_mapping_owner_mapping.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_mapping_pending_relationships.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_mapping_record_mapping.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_planner.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_registry.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_safe_local_io.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_skill_commands.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_spec.py +0 -0
- {sanka_cli-0.2.12 → sanka_cli-0.2.13}/tests/test_state_store.py +0 -0
|
@@ -455,7 +455,8 @@ def _flow_capabilities(value: Any, code: str, path: Path) -> tuple[FlowCapabilit
|
|
|
455
455
|
r"[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:/[a-z][a-z0-9]*(?:-[a-z0-9]+)*)?", flow_type
|
|
456
456
|
)
|
|
457
457
|
is None
|
|
458
|
-
or item["output_schema"]
|
|
458
|
+
or item["output_schema"]
|
|
459
|
+
not in ("sanka-flow-blueprint/v1", "sanka-flow-blueprint/v2", "sanka-flow-blueprint/v3")
|
|
459
460
|
or not isinstance(item["references"], list)
|
|
460
461
|
or not isinstance(item["values"], list)
|
|
461
462
|
):
|
|
@@ -24,6 +24,16 @@ def _same(expected: Document, actual: Document) -> None:
|
|
|
24
24
|
raise FlowError("FLOW_TARGET_STALE", "Target configuration or reference revision changed")
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
def _require_verification_profile(plan: FlowPlan) -> None:
|
|
28
|
+
version = plan.to_dict()["blueprint"].get("schema_version")
|
|
29
|
+
if version not in {"sanka-flow-blueprint/v1", "sanka-flow-blueprint/v2"}:
|
|
30
|
+
raise FlowError(
|
|
31
|
+
"FLOW_VERIFICATION_PROFILE_UNSUPPORTED",
|
|
32
|
+
"This Flow profile has no native scenario verifier; "
|
|
33
|
+
"verification and activation are unavailable",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
27
37
|
def _resource_ids(observation: Document) -> tuple[str, ...]:
|
|
28
38
|
return tuple(r["target_id"] for r in observation.to_dict()["resources"])
|
|
29
39
|
|
|
@@ -163,6 +173,7 @@ class FlowLifecycle:
|
|
|
163
173
|
await _release(self.store, claim)
|
|
164
174
|
|
|
165
175
|
async def verify(self, plan: FlowPlan, *, attempt_id: str) -> Document:
|
|
176
|
+
_require_verification_profile(plan)
|
|
166
177
|
self._check(plan, plan.digest)
|
|
167
178
|
claim = await self.store.claim(plan.digest, attempt_id)
|
|
168
179
|
try:
|
|
@@ -244,6 +255,7 @@ class FlowLifecycle:
|
|
|
244
255
|
approved_verification_digest: str,
|
|
245
256
|
attempt_id: str,
|
|
246
257
|
) -> Document:
|
|
258
|
+
_require_verification_profile(plan)
|
|
247
259
|
self._check(plan, plan.digest)
|
|
248
260
|
claim = await self.store.claim(plan.digest, attempt_id)
|
|
249
261
|
try:
|
|
@@ -5,6 +5,7 @@ from sanka_extensions.flow._wire import artifact_digest
|
|
|
5
5
|
from sanka_extensions.flow.blueprint import (
|
|
6
6
|
BLUEPRINT_SCHEMA_VERSION,
|
|
7
7
|
BLUEPRINT_V2_SCHEMA_VERSION,
|
|
8
|
+
BLUEPRINT_V3_SCHEMA_VERSION,
|
|
8
9
|
Blueprint,
|
|
9
10
|
Resource,
|
|
10
11
|
)
|
|
@@ -34,6 +35,7 @@ from sanka_extensions.flow.identity import (
|
|
|
34
35
|
Reference,
|
|
35
36
|
UnsupportedFinding,
|
|
36
37
|
)
|
|
38
|
+
from sanka_extensions.flow.native import NativeOrderBillingWorkflow
|
|
37
39
|
from sanka_extensions.flow.protocol import (
|
|
38
40
|
MAX_MESSAGE_BYTES,
|
|
39
41
|
PROTOCOL_VERSION,
|
|
@@ -58,6 +60,7 @@ from sanka_extensions.flow.source import (
|
|
|
58
60
|
__all__ = [
|
|
59
61
|
"BLUEPRINT_SCHEMA_VERSION",
|
|
60
62
|
"BLUEPRINT_V2_SCHEMA_VERSION",
|
|
63
|
+
"BLUEPRINT_V3_SCHEMA_VERSION",
|
|
61
64
|
"MAX_MESSAGE_BYTES",
|
|
62
65
|
"PROTOCOL_VERSION",
|
|
63
66
|
"SCHEMA_VERSION",
|
|
@@ -75,6 +78,7 @@ __all__ = [
|
|
|
75
78
|
"FlowDefinition",
|
|
76
79
|
"FlowExtensionFailure",
|
|
77
80
|
"Mapping",
|
|
81
|
+
"NativeOrderBillingWorkflow",
|
|
78
82
|
"RecordIdentity",
|
|
79
83
|
"Reference",
|
|
80
84
|
"ReferenceRequirement",
|
|
@@ -38,10 +38,12 @@ from sanka_extensions.flow.identity import (
|
|
|
38
38
|
reference_index,
|
|
39
39
|
require_reference,
|
|
40
40
|
)
|
|
41
|
+
from sanka_extensions.flow.native import NATIVE_ORDER_BILLING_SCHEMA, NativeOrderBillingWorkflow
|
|
41
42
|
from sanka_extensions.flow.scenario import Scenario
|
|
42
43
|
|
|
43
44
|
BLUEPRINT_SCHEMA_VERSION = "sanka-flow-blueprint/v1"
|
|
44
45
|
BLUEPRINT_V2_SCHEMA_VERSION = "sanka-flow-blueprint/v2"
|
|
46
|
+
BLUEPRINT_V3_SCHEMA_VERSION = "sanka-flow-blueprint/v3"
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
@dataclass(frozen=True, slots=True, init=False)
|
|
@@ -66,7 +68,11 @@ class Resource(WireRecord):
|
|
|
66
68
|
if id in depends_on:
|
|
67
69
|
raise ValueError("resource cannot depend on itself")
|
|
68
70
|
if kind == "workflow":
|
|
69
|
-
graph =
|
|
71
|
+
graph = (
|
|
72
|
+
NativeOrderBillingWorkflow.from_dict(spec)
|
|
73
|
+
if type(spec) is dict and spec.get("schema_version") == NATIVE_ORDER_BILLING_SCHEMA
|
|
74
|
+
else WorkflowGraph.from_dict(spec)
|
|
75
|
+
)
|
|
70
76
|
if graph.id != id:
|
|
71
77
|
raise ValueError("workflow graph identity must match its resource identity")
|
|
72
78
|
spec = graph.to_dict()
|
|
@@ -189,7 +195,7 @@ class Blueprint(WireRecord):
|
|
|
189
195
|
) -> None:
|
|
190
196
|
choice(
|
|
191
197
|
schema_version,
|
|
192
|
-
(BLUEPRINT_SCHEMA_VERSION, BLUEPRINT_V2_SCHEMA_VERSION),
|
|
198
|
+
(BLUEPRINT_SCHEMA_VERSION, BLUEPRINT_V2_SCHEMA_VERSION, BLUEPRINT_V3_SCHEMA_VERSION),
|
|
193
199
|
"Blueprint schema_version",
|
|
194
200
|
)
|
|
195
201
|
identifier(id, "blueprint id")
|
|
@@ -244,7 +250,12 @@ class Blueprint(WireRecord):
|
|
|
244
250
|
for resource in self.resources:
|
|
245
251
|
capabilities.add(f"flow.resource.{resource.kind}/v1")
|
|
246
252
|
if resource.kind == "workflow":
|
|
247
|
-
|
|
253
|
+
workflow = (
|
|
254
|
+
NativeOrderBillingWorkflow.from_dict(resource.spec)
|
|
255
|
+
if self.schema_version == BLUEPRINT_V3_SCHEMA_VERSION
|
|
256
|
+
else WorkflowGraph.from_dict(resource.spec)
|
|
257
|
+
)
|
|
258
|
+
capabilities.update(workflow.required_capabilities)
|
|
248
259
|
return tuple(sorted(capabilities))
|
|
249
260
|
|
|
250
261
|
def require_supported(self, *, capabilities: frozenset[str] | None = None) -> None:
|
|
@@ -253,7 +264,7 @@ class Blueprint(WireRecord):
|
|
|
253
264
|
"Blueprint contains unsupported semantics: "
|
|
254
265
|
+ ", ".join(f.code for f in self.unsupported)
|
|
255
266
|
)
|
|
256
|
-
if self.schema_version
|
|
267
|
+
if self.schema_version != BLUEPRINT_SCHEMA_VERSION or capabilities is not None:
|
|
257
268
|
missing = set(self.required_capabilities) - (capabilities or frozenset())
|
|
258
269
|
if missing:
|
|
259
270
|
raise ValueError(
|
|
@@ -262,6 +273,19 @@ class Blueprint(WireRecord):
|
|
|
262
273
|
|
|
263
274
|
def _validate(self) -> None:
|
|
264
275
|
_dependencies(self.resources)
|
|
276
|
+
if self.schema_version == BLUEPRINT_V3_SCHEMA_VERSION:
|
|
277
|
+
if (
|
|
278
|
+
len(self.resources) != 1
|
|
279
|
+
or self.resources[0].kind != "workflow"
|
|
280
|
+
or self.resources[0].depends_on
|
|
281
|
+
):
|
|
282
|
+
raise ValueError("native v3 requires exactly one independent workflow")
|
|
283
|
+
if self.origin.kind != "template":
|
|
284
|
+
raise ValueError("native v3 supports explicit template generation only")
|
|
285
|
+
if self.references or self.mappings or self.scenarios:
|
|
286
|
+
raise ValueError("native v3 has no portable graph references or scenario evidence")
|
|
287
|
+
NativeOrderBillingWorkflow.from_dict(self.resources[0].spec)
|
|
288
|
+
return
|
|
265
289
|
references = reference_index(self.references)
|
|
266
290
|
resources = {resource.id: resource for resource in self.resources}
|
|
267
291
|
for reference in self.references:
|
|
@@ -426,7 +450,7 @@ class Blueprint(WireRecord):
|
|
|
426
450
|
"scenarios": [scenario.to_dict() for scenario in self.scenarios],
|
|
427
451
|
"unsupported": [finding.to_dict() for finding in self.unsupported],
|
|
428
452
|
}
|
|
429
|
-
if self.schema_version
|
|
453
|
+
if self.schema_version != BLUEPRINT_SCHEMA_VERSION:
|
|
430
454
|
result["required_capabilities"] = list(self.required_capabilities)
|
|
431
455
|
return result
|
|
432
456
|
|
|
@@ -437,7 +461,7 @@ class Blueprint(WireRecord):
|
|
|
437
461
|
version = value.get("schema_version") if type(value) is dict else None
|
|
438
462
|
choice(
|
|
439
463
|
version,
|
|
440
|
-
(BLUEPRINT_SCHEMA_VERSION, BLUEPRINT_V2_SCHEMA_VERSION),
|
|
464
|
+
(BLUEPRINT_SCHEMA_VERSION, BLUEPRINT_V2_SCHEMA_VERSION, BLUEPRINT_V3_SCHEMA_VERSION),
|
|
441
465
|
"Blueprint schema_version",
|
|
442
466
|
)
|
|
443
467
|
payload = object_fields(
|
|
@@ -456,7 +480,7 @@ class Blueprint(WireRecord):
|
|
|
456
480
|
"scenarios",
|
|
457
481
|
"unsupported",
|
|
458
482
|
}
|
|
459
|
-
| ({"required_capabilities"} if version
|
|
483
|
+
| ({"required_capabilities"} if version != BLUEPRINT_SCHEMA_VERSION else set()),
|
|
460
484
|
"Blueprint",
|
|
461
485
|
)
|
|
462
486
|
if payload["policies"] != _policies():
|
|
@@ -476,7 +500,7 @@ class Blueprint(WireRecord):
|
|
|
476
500
|
scenarios=array(payload["scenarios"], Scenario.from_dict, "scenarios"),
|
|
477
501
|
unsupported=array(payload["unsupported"], UnsupportedFinding.from_dict, "unsupported"),
|
|
478
502
|
)
|
|
479
|
-
if version
|
|
503
|
+
if version != BLUEPRINT_SCHEMA_VERSION and payload["required_capabilities"] != list(
|
|
480
504
|
result.required_capabilities
|
|
481
505
|
):
|
|
482
506
|
raise ValueError("required_capabilities must exactly describe the Blueprint semantics")
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
"""Typed native order-import/billing profile; declarations never execute providers.
|
|
3
|
+
|
|
4
|
+
This first native profile supports an interval trigger, a complete order import,
|
|
5
|
+
and creation of draft invoices from precisely that import's output. It is not an
|
|
6
|
+
escape hatch for arbitrary native action payloads. Hosts must resolve the endpoint
|
|
7
|
+
and immutable mapping in the pinned workspace before planning or construction.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
from datetime import date
|
|
14
|
+
from typing import Self
|
|
15
|
+
from uuid import UUID
|
|
16
|
+
|
|
17
|
+
from sanka_extensions.flow._wire import WireRecord, array, identifier, object_fields, text
|
|
18
|
+
from sanka_extensions.flow.definition import JsonValue
|
|
19
|
+
from sanka_extensions.flow.identity import ArtifactIdentity
|
|
20
|
+
|
|
21
|
+
NATIVE_ORDER_BILLING_SCHEMA = "sanka-flow-native-order-billing/v1"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _integer(value: object, minimum: int, maximum: int, label: str) -> int:
|
|
25
|
+
if type(value) is not int or not minimum <= value <= maximum:
|
|
26
|
+
raise ValueError(f"{label} must be an integer between {minimum} and {maximum}")
|
|
27
|
+
return value
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True, slots=True)
|
|
31
|
+
class NativeOrderBillingWorkflow(WireRecord):
|
|
32
|
+
"""One explicit native capability composition with retry-preserving policies.
|
|
33
|
+
|
|
34
|
+
The endpoint and mapping IDs are selectors, never authentication material.
|
|
35
|
+
Mapping digest/revision must come from independently observed hosted state.
|
|
36
|
+
No invoice step may run after failed, cancelled or partial import completion.
|
|
37
|
+
Existing invoices and user edits survive repeated scheduling and retries.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
id: str
|
|
41
|
+
interval_minutes: int
|
|
42
|
+
source_endpoint_id: str
|
|
43
|
+
mapping: ArtifactIdentity
|
|
44
|
+
pipeline_id: str
|
|
45
|
+
deal_stage_ids: tuple[str, ...]
|
|
46
|
+
updated_since: str
|
|
47
|
+
invoice_due_days: int
|
|
48
|
+
|
|
49
|
+
def __post_init__(self) -> None:
|
|
50
|
+
identifier(self.id, "workflow id")
|
|
51
|
+
_integer(self.interval_minutes, 1, 1440, "interval_minutes")
|
|
52
|
+
endpoint = text(self.source_endpoint_id, "source_endpoint_id")
|
|
53
|
+
if str(UUID(endpoint)) != endpoint:
|
|
54
|
+
raise ValueError("source_endpoint_id must be a canonical UUID")
|
|
55
|
+
if type(self.mapping) is not ArtifactIdentity:
|
|
56
|
+
raise ValueError("mapping requires an immutable artifact identity")
|
|
57
|
+
identifier(self.pipeline_id, "pipeline_id")
|
|
58
|
+
if type(self.deal_stage_ids) is not tuple or not 1 <= len(self.deal_stage_ids) <= 100:
|
|
59
|
+
raise ValueError("deal_stage_ids requires one to 100 exact stage IDs")
|
|
60
|
+
for stage in self.deal_stage_ids:
|
|
61
|
+
identifier(stage, "deal stage")
|
|
62
|
+
if len(set(self.deal_stage_ids)) != len(self.deal_stage_ids):
|
|
63
|
+
raise ValueError("deal_stage_ids must be unique")
|
|
64
|
+
object.__setattr__(self, "deal_stage_ids", tuple(sorted(self.deal_stage_ids)))
|
|
65
|
+
if (
|
|
66
|
+
date.fromisoformat(text(self.updated_since, "updated_since")).isoformat()
|
|
67
|
+
!= self.updated_since
|
|
68
|
+
):
|
|
69
|
+
raise ValueError("updated_since must use YYYY-MM-DD in UTC")
|
|
70
|
+
_integer(self.invoice_due_days, 0, 365, "invoice_due_days")
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def configuration(self) -> dict[str, JsonValue]:
|
|
74
|
+
"""Exact executable selections; excludes generated logical identities."""
|
|
75
|
+
return {
|
|
76
|
+
"interval_minutes": self.interval_minutes,
|
|
77
|
+
"source_endpoint_id": self.source_endpoint_id,
|
|
78
|
+
"mapping": self.mapping.to_dict(),
|
|
79
|
+
"pipeline_id": self.pipeline_id,
|
|
80
|
+
"deal_stage_ids": list(self.deal_stage_ids),
|
|
81
|
+
"updated_since": self.updated_since,
|
|
82
|
+
"invoice_due_days": self.invoice_due_days,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_configuration(cls, id: str, value: object) -> Self:
|
|
87
|
+
payload = object_fields(
|
|
88
|
+
value,
|
|
89
|
+
{
|
|
90
|
+
"interval_minutes",
|
|
91
|
+
"source_endpoint_id",
|
|
92
|
+
"mapping",
|
|
93
|
+
"pipeline_id",
|
|
94
|
+
"deal_stage_ids",
|
|
95
|
+
"updated_since",
|
|
96
|
+
"invoice_due_days",
|
|
97
|
+
},
|
|
98
|
+
"native configuration",
|
|
99
|
+
)
|
|
100
|
+
return cls(
|
|
101
|
+
id,
|
|
102
|
+
payload["interval_minutes"],
|
|
103
|
+
payload["source_endpoint_id"],
|
|
104
|
+
ArtifactIdentity.from_dict(payload["mapping"]),
|
|
105
|
+
payload["pipeline_id"],
|
|
106
|
+
array(payload["deal_stage_ids"], lambda v: identifier(v, "deal stage"), "deal stages"),
|
|
107
|
+
payload["updated_since"],
|
|
108
|
+
payload["invoice_due_days"],
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def node_ids(self) -> tuple[str, str, str]:
|
|
113
|
+
return (f"{self.id}/schedule", f"{self.id}/import-orders", f"{self.id}/draft-invoices")
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def required_capabilities(self) -> tuple[str, ...]:
|
|
117
|
+
return (
|
|
118
|
+
NATIVE_ORDER_BILLING_SCHEMA,
|
|
119
|
+
"flow.native.complete-import-output/v1",
|
|
120
|
+
"flow.native.draft-invoices-from-orders/v1",
|
|
121
|
+
"flow.native.hubspot-deals-to-orders/v1",
|
|
122
|
+
"flow.native.interval-minutes/v1",
|
|
123
|
+
"flow.native.preserve-existing-invoices/v1",
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def to_dict(self) -> dict[str, JsonValue]:
|
|
127
|
+
return {
|
|
128
|
+
"schema_version": NATIVE_ORDER_BILLING_SCHEMA,
|
|
129
|
+
"id": self.id,
|
|
130
|
+
"interval_minutes": self.interval_minutes,
|
|
131
|
+
"source_endpoint_id": self.source_endpoint_id,
|
|
132
|
+
"mapping": self.mapping.to_dict(),
|
|
133
|
+
"pipeline_id": self.pipeline_id,
|
|
134
|
+
"deal_stage_ids": list(self.deal_stage_ids),
|
|
135
|
+
"updated_since": self.updated_since,
|
|
136
|
+
"invoice_due_days": self.invoice_due_days,
|
|
137
|
+
"node_ids": list(self.node_ids),
|
|
138
|
+
"policies": {
|
|
139
|
+
"import_target": "order",
|
|
140
|
+
"import_completion": "complete_only",
|
|
141
|
+
"invoice_source": "imported_orders_only",
|
|
142
|
+
"invoice_status": "draft",
|
|
143
|
+
"existing_invoice": "preserve",
|
|
144
|
+
"invoice_grouping": "one_per_order",
|
|
145
|
+
"construction": "inactive",
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@classmethod
|
|
150
|
+
def from_dict(cls, value: object) -> Self:
|
|
151
|
+
payload = object_fields(
|
|
152
|
+
value,
|
|
153
|
+
{
|
|
154
|
+
"schema_version",
|
|
155
|
+
"id",
|
|
156
|
+
"interval_minutes",
|
|
157
|
+
"source_endpoint_id",
|
|
158
|
+
"mapping",
|
|
159
|
+
"pipeline_id",
|
|
160
|
+
"deal_stage_ids",
|
|
161
|
+
"updated_since",
|
|
162
|
+
"invoice_due_days",
|
|
163
|
+
"node_ids",
|
|
164
|
+
"policies",
|
|
165
|
+
},
|
|
166
|
+
"native order billing workflow",
|
|
167
|
+
)
|
|
168
|
+
if payload["schema_version"] != NATIVE_ORDER_BILLING_SCHEMA:
|
|
169
|
+
raise ValueError("unsupported native workflow schema_version")
|
|
170
|
+
result = cls(
|
|
171
|
+
payload["id"],
|
|
172
|
+
payload["interval_minutes"],
|
|
173
|
+
payload["source_endpoint_id"],
|
|
174
|
+
ArtifactIdentity.from_dict(payload["mapping"]),
|
|
175
|
+
payload["pipeline_id"],
|
|
176
|
+
array(payload["deal_stage_ids"], lambda v: identifier(v, "deal stage"), "deal stages"),
|
|
177
|
+
payload["updated_since"],
|
|
178
|
+
payload["invoice_due_days"],
|
|
179
|
+
)
|
|
180
|
+
if (
|
|
181
|
+
payload["node_ids"] != list(result.node_ids)
|
|
182
|
+
or payload["policies"] != result.to_dict()["policies"]
|
|
183
|
+
):
|
|
184
|
+
raise ValueError("native workflow ordering and safety policies cannot be changed")
|
|
185
|
+
return result
|
|
@@ -27,6 +27,7 @@ from sanka_extensions.flow._wire import (
|
|
|
27
27
|
from sanka_extensions.flow.blueprint import (
|
|
28
28
|
BLUEPRINT_SCHEMA_VERSION,
|
|
29
29
|
BLUEPRINT_V2_SCHEMA_VERSION,
|
|
30
|
+
BLUEPRINT_V3_SCHEMA_VERSION,
|
|
30
31
|
Blueprint,
|
|
31
32
|
)
|
|
32
33
|
from sanka_extensions.flow.definition import (
|
|
@@ -36,13 +37,20 @@ from sanka_extensions.flow.definition import (
|
|
|
36
37
|
encode_definition,
|
|
37
38
|
)
|
|
38
39
|
from sanka_extensions.flow.identity import ArtifactIdentity, Reference, reference_index
|
|
40
|
+
from sanka_extensions.flow.native import NativeOrderBillingWorkflow
|
|
39
41
|
|
|
40
42
|
PROTOCOL_VERSION = "sanka-flow-extension/v1"
|
|
41
43
|
MAX_MESSAGE_BYTES = 4 * 1024 * 1024
|
|
42
44
|
type JsonScalar = str | int | float | bool | None
|
|
43
45
|
type ScalarType = Literal["string", "number", "boolean", "null"]
|
|
44
|
-
type OutputSchema = Literal[
|
|
45
|
-
|
|
46
|
+
type OutputSchema = Literal[
|
|
47
|
+
"sanka-flow-blueprint/v1", "sanka-flow-blueprint/v2", "sanka-flow-blueprint/v3"
|
|
48
|
+
]
|
|
49
|
+
OUTPUT_SCHEMAS = (
|
|
50
|
+
BLUEPRINT_SCHEMA_VERSION,
|
|
51
|
+
BLUEPRINT_V2_SCHEMA_VERSION,
|
|
52
|
+
BLUEPRINT_V3_SCHEMA_VERSION,
|
|
53
|
+
)
|
|
46
54
|
|
|
47
55
|
|
|
48
56
|
def _scalar_type(value: object) -> ScalarType:
|
|
@@ -287,6 +295,15 @@ class BlueprintRequest(WireRecord):
|
|
|
287
295
|
for name, value in values.items():
|
|
288
296
|
identifier(name, "selected value name")
|
|
289
297
|
_scalar_type(value)
|
|
298
|
+
if output_schema == BLUEPRINT_V3_SCHEMA_VERSION:
|
|
299
|
+
if references or values:
|
|
300
|
+
raise ValueError("native v3 uses only its typed definition configuration")
|
|
301
|
+
selected = object_fields(
|
|
302
|
+
definition.parameters, {"native_configuration"}, "native definition parameters"
|
|
303
|
+
)
|
|
304
|
+
NativeOrderBillingWorkflow.from_configuration(
|
|
305
|
+
"selection", selected["native_configuration"]
|
|
306
|
+
)
|
|
290
307
|
for attribute, assigned in (
|
|
291
308
|
("request_id", request_id),
|
|
292
309
|
("extension", extension),
|
|
@@ -432,6 +449,15 @@ class BlueprintResponse(WireRecord):
|
|
|
432
449
|
raise ValueError("Flow output changed the requested target references")
|
|
433
450
|
if FrozenJson(self.blueprint.parameters) != FrozenJson(request.blueprint_parameters):
|
|
434
451
|
raise ValueError("Flow output changed the requested target, values or parameters")
|
|
452
|
+
if request.output_schema == BLUEPRINT_V3_SCHEMA_VERSION:
|
|
453
|
+
selected = NativeOrderBillingWorkflow.from_configuration(
|
|
454
|
+
"selection", request.definition.parameters["native_configuration"]
|
|
455
|
+
)
|
|
456
|
+
generated = NativeOrderBillingWorkflow.from_dict(self.blueprint.resources[0].spec)
|
|
457
|
+
if FrozenJson(generated.configuration) != FrozenJson(selected.configuration):
|
|
458
|
+
raise ValueError(
|
|
459
|
+
"Native Flow output changed the requested executable configuration"
|
|
460
|
+
)
|
|
435
461
|
self.blueprint.require_supported(capabilities=frozenset(request.target.capabilities))
|
|
436
462
|
|
|
437
463
|
def to_dict(self) -> dict[str, JsonValue]:
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "sanka-flow-blueprint/v3",
|
|
3
|
+
"id": "billing",
|
|
4
|
+
"revision": "1",
|
|
5
|
+
"origin": {
|
|
6
|
+
"kind": "template",
|
|
7
|
+
"identity": {
|
|
8
|
+
"id": "sanka/hubspot-deal-invoices",
|
|
9
|
+
"revision": "1",
|
|
10
|
+
"digest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"extension": {
|
|
14
|
+
"id": "sanka/business-flows",
|
|
15
|
+
"revision": "1",
|
|
16
|
+
"digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
|
|
17
|
+
},
|
|
18
|
+
"parameters": {},
|
|
19
|
+
"policies": {
|
|
20
|
+
"reapply": {
|
|
21
|
+
"user_changes": "preserve",
|
|
22
|
+
"conflicts": "require_resolution",
|
|
23
|
+
"ownership": "installation",
|
|
24
|
+
"removals": "explicit_plan"
|
|
25
|
+
},
|
|
26
|
+
"lifecycle": {
|
|
27
|
+
"stages": [
|
|
28
|
+
"construct",
|
|
29
|
+
"verify",
|
|
30
|
+
"activate"
|
|
31
|
+
],
|
|
32
|
+
"new_automations": "disabled_until_activation",
|
|
33
|
+
"activation": "explicit_verified_revision"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"resources": [
|
|
37
|
+
{
|
|
38
|
+
"id": "billing",
|
|
39
|
+
"kind": "workflow",
|
|
40
|
+
"spec": {
|
|
41
|
+
"deal_stage_ids": [
|
|
42
|
+
"closedwon"
|
|
43
|
+
],
|
|
44
|
+
"id": "billing",
|
|
45
|
+
"interval_minutes": 30,
|
|
46
|
+
"invoice_due_days": 30,
|
|
47
|
+
"mapping": {
|
|
48
|
+
"digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
49
|
+
"id": "saved-order-mapping",
|
|
50
|
+
"revision": "7"
|
|
51
|
+
},
|
|
52
|
+
"node_ids": [
|
|
53
|
+
"billing/schedule",
|
|
54
|
+
"billing/import-orders",
|
|
55
|
+
"billing/draft-invoices"
|
|
56
|
+
],
|
|
57
|
+
"pipeline_id": "default",
|
|
58
|
+
"policies": {
|
|
59
|
+
"construction": "inactive",
|
|
60
|
+
"existing_invoice": "preserve",
|
|
61
|
+
"import_completion": "complete_only",
|
|
62
|
+
"import_target": "order",
|
|
63
|
+
"invoice_grouping": "one_per_order",
|
|
64
|
+
"invoice_source": "imported_orders_only",
|
|
65
|
+
"invoice_status": "draft"
|
|
66
|
+
},
|
|
67
|
+
"schema_version": "sanka-flow-native-order-billing/v1",
|
|
68
|
+
"source_endpoint_id": "11111111-1111-4111-8111-111111111111",
|
|
69
|
+
"updated_since": "2026-09-01"
|
|
70
|
+
},
|
|
71
|
+
"depends_on": []
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"references": [],
|
|
75
|
+
"mappings": [],
|
|
76
|
+
"scenarios": [],
|
|
77
|
+
"unsupported": [],
|
|
78
|
+
"required_capabilities": [
|
|
79
|
+
"flow.native.complete-import-output/v1",
|
|
80
|
+
"flow.native.draft-invoices-from-orders/v1",
|
|
81
|
+
"flow.native.hubspot-deals-to-orders/v1",
|
|
82
|
+
"flow.native.interval-minutes/v1",
|
|
83
|
+
"flow.native.preserve-existing-invoices/v1",
|
|
84
|
+
"flow.resource.workflow/v1",
|
|
85
|
+
"sanka-flow-blueprint/v3",
|
|
86
|
+
"sanka-flow-native-order-billing/v1"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -14,6 +14,8 @@ from test_extension_store import _marketplace, _responses
|
|
|
14
14
|
from sanka.runtime.extensions.model import ExtensionError
|
|
15
15
|
from sanka.runtime.extensions.store import ExtensionStore
|
|
16
16
|
from sanka.runtime.flow.extension import FlowExtensionRunner
|
|
17
|
+
from sanka.runtime.flow.model import Document, Installation, TargetSnapshot
|
|
18
|
+
from sanka.runtime.flow.planner import plan_reconstruction
|
|
17
19
|
|
|
18
20
|
# The parent selects either the embedded SDK or the independently published SDK.
|
|
19
21
|
# Dynamic import keeps this test able to validate either distribution boundary.
|
|
@@ -39,11 +41,12 @@ def main():
|
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
42
|
-
fixture =
|
|
43
|
-
"synthetic_sales_quote_blueprint.json"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
fixture = {
|
|
45
|
+
"v1": "synthetic_sales_quote_blueprint.json",
|
|
46
|
+
"v2": "synthetic_sales_created_estimate_blueprint.json",
|
|
47
|
+
"v3": "synthetic_native_order_billing_blueprint.json",
|
|
48
|
+
}[version]
|
|
49
|
+
sdk_version = "0.1.0a5" if version == "v3" else "0.1.0a4"
|
|
47
50
|
fixture_text = (Path(__file__).parent / "fixtures" / "flow" / fixture).read_text()
|
|
48
51
|
blueprint = flow.Blueprint.from_dict(json.loads(fixture_text))
|
|
49
52
|
mutation = {
|
|
@@ -51,6 +54,10 @@ def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
|
51
54
|
"missing-identity": "pass",
|
|
52
55
|
"template-tamper": "output['blueprint']['origin']['identity']['revision'] = 'changed'",
|
|
53
56
|
"schema-tamper": "output['blueprint']['schema_version'] = 'sanka-flow-blueprint/unknown'",
|
|
57
|
+
"configuration-tamper": (
|
|
58
|
+
"output['blueprint']['resources'][0]['spec']['source_endpoint_id'] = "
|
|
59
|
+
"'22222222-2222-4222-8222-222222222222'"
|
|
60
|
+
),
|
|
54
61
|
}[mode]
|
|
55
62
|
generator_source = GENERATOR.replace("MUTATION", mutation)
|
|
56
63
|
if mode == "missing-identity":
|
|
@@ -63,7 +70,7 @@ def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
|
63
70
|
)
|
|
64
71
|
source, generator = _marketplace(
|
|
65
72
|
root / "source",
|
|
66
|
-
requires=("sanka-extension-sdk==
|
|
73
|
+
requires=(f"sanka-extension-sdk=={sdk_version}",),
|
|
67
74
|
cli_source=generator_source,
|
|
68
75
|
extra_members=(("example_demo/blueprint.json", fixture_text),),
|
|
69
76
|
)
|
|
@@ -89,7 +96,7 @@ def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
|
89
96
|
)
|
|
90
97
|
wheels = {"example_demo-0.1.0-py3-none-any.whl": generator}
|
|
91
98
|
for filename in (
|
|
92
|
-
"sanka_extension_sdk-
|
|
99
|
+
f"sanka_extension_sdk-{sdk_version}-py3-none-any.whl",
|
|
93
100
|
"sanka_connector_sdk-0.1.0a12-py3-none-any.whl",
|
|
94
101
|
):
|
|
95
102
|
content = (release / filename).read_bytes()
|
|
@@ -104,7 +111,16 @@ def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
|
104
111
|
manifest_path.write_text(json.dumps(manifest))
|
|
105
112
|
capabilities = list(reversed(blueprint.required_capabilities))
|
|
106
113
|
if mode == "missing-identity":
|
|
107
|
-
capabilities.remove(
|
|
114
|
+
capabilities.remove(
|
|
115
|
+
"flow.native.interval-minutes/v1" if version == "v3" else "flow.record-identity/v1"
|
|
116
|
+
)
|
|
117
|
+
definition = flow.create(type=blueprint.origin.identity.id)
|
|
118
|
+
if version == "v3":
|
|
119
|
+
profile = flow.NativeOrderBillingWorkflow.from_dict(blueprint.resources[0].spec)
|
|
120
|
+
definition = flow.FlowDefinition(
|
|
121
|
+
type=blueprint.origin.identity.id,
|
|
122
|
+
parameters={"native_configuration": profile.configuration},
|
|
123
|
+
)
|
|
108
124
|
with pytest.MonkeyPatch.context() as patch:
|
|
109
125
|
_responses(patch, wheels)
|
|
110
126
|
store = ExtensionStore(root / "project", user_root=root / "user")
|
|
@@ -115,7 +131,7 @@ def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
|
115
131
|
result = FlowExtensionRunner(store).generate(
|
|
116
132
|
"example/demo",
|
|
117
133
|
request_id="generation-1",
|
|
118
|
-
definition=flow.encode_definition(
|
|
134
|
+
definition=flow.encode_definition(definition),
|
|
119
135
|
target={"id": "synthetic-workspace", "revision": "1", "capabilities": capabilities},
|
|
120
136
|
references=[r.to_dict() for r in blueprint.references],
|
|
121
137
|
values={},
|
|
@@ -132,4 +148,22 @@ def verify(release: Path, root: Path, version: str, mode: str) -> None:
|
|
|
132
148
|
assert result.resources == blueprint.resources
|
|
133
149
|
assert result.scenarios == blueprint.scenarios
|
|
134
150
|
assert result.extension.digest == before.manifest_digest
|
|
151
|
+
if version == "v3":
|
|
152
|
+
# Structural planning against a synthetic observation proves
|
|
153
|
+
# shared-runtime consumption, not native provider execution.
|
|
154
|
+
observed = TargetSnapshot(
|
|
155
|
+
"synthetic-workspace", "1", (), frozenset({"workflow"}), Document({})
|
|
156
|
+
)
|
|
157
|
+
plan = plan_reconstruction(
|
|
158
|
+
blueprint=result,
|
|
159
|
+
installation=Installation("native-installation", observed.target),
|
|
160
|
+
observed=observed,
|
|
161
|
+
)
|
|
162
|
+
assert plan.applicable
|
|
163
|
+
payload = plan.to_dict()
|
|
164
|
+
assert payload["construction"] == "inactive"
|
|
165
|
+
assert len(payload["operations"]) == 1
|
|
166
|
+
operation = payload["operations"][0]
|
|
167
|
+
assert operation["action"] == "create"
|
|
168
|
+
assert operation["configuration"] == blueprint.resources[0].spec
|
|
135
169
|
assert store.resolve_locked("example/demo") == before
|