stabilize 0.34.3__tar.gz → 0.34.4__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.
- {stabilize-0.34.3 → stabilize-0.34.4}/PKG-INFO +3 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/pyproject.toml +60 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/__init__.py +114 -113
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/assertions.py +25 -38
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/audit.py +2 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/__init__.py +3 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/adoption.py +1 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/commands.py +11 -11
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/config.py +2 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/grants.py +4 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/history_location.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/migrate.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/migretti_runner.py +5 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/queue_table_cli.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/tenancy_cli.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/conditions.py +12 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/context/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/context/stage_context.py +9 -21
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/__init__.py +5 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/deferred_choice.py +2 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/graph.py +14 -25
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/merge.py +1 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/readiness.py +45 -57
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/topological.py +11 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/error_codes.py +4 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/__init__.py +2 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/chain.py +4 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/__init__.py +41 -43
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/base.py +8 -10
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/bus.py +20 -30
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/projections/__init__.py +5 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/projections/base.py +9 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/projections/metrics.py +2 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/projections/timeline.py +24 -21
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/__init__.py +3 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/base.py +8 -13
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/composed.py +2 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/context.py +3 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/generic_events.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/instance.py +2 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/stage_events.py +8 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/task_events.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/workflow_events.py +2 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/replay.py +13 -21
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/snapshots.py +12 -22
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/__init__.py +8 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/interface.py +27 -34
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/__init__.py +6 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/events.py +104 -116
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/retention.py +16 -17
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/schema.py +3 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/snapshots.py +41 -43
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/store.py +63 -64
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/postgres/subscriptions.py +46 -51
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/__init__.py +3 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/events.py +9 -11
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/retention.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/schema.py +3 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/snapshots.py +7 -8
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/store.py +8 -8
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/subscriptions.py +4 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/subscriptions.py +36 -50
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/txn_scope.py +4 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/exceptions.py +9 -24
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/expressions.py +7 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/finalizers.py +5 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/__init__.py +18 -17
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/add_multi_instance.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/base.py +11 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/cancel_region.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/cancel_stage.py +6 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/handler.py +6 -12
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/split_logic.py +1 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/support.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_task.py +6 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_workflow.py +8 -11
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/continue_parent_stage.py +5 -12
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/__init__.py +3 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/handler.py +7 -13
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/traversal.py +1 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/error.py +10 -69
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/execution.py +4 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/handler.py +11 -19
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/held_results.py +0 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/result.py +9 -12
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/saving.py +3 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/signal_stage.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/skip_stage.py +6 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/conditions.py +6 -15
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/handler.py +7 -21
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/orchestration.py +18 -23
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/planner.py +3 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/starting.py +3 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_task.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_waiting_workflows.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/start_workflow.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/workflow_control.py +12 -17
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/hitl.py +3 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/launcher.py +10 -20
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/lifecycle.py +19 -43
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/llm/__init__.py +6 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/llm/client.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/llm/tasks.py +5 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/llm/tools.py +7 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/logging.py +7 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/metrics.py +16 -13
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/__init__.py +7 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/multi_instance.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/snapshot.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/engine_keys.py +0 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/enums.py +4 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/navigation.py +11 -22
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/stage.py +5 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/status.py +6 -8
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/task.py +3 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/workflow.py +18 -30
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/__init__.py +5 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/data.py +88 -91
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/display/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/display/constants.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/display/fetcher.py +2 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/display/interaction.py +14 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/display/monitor.py +3 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/display/rendering.py +12 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/monitor/models.py +9 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/orchestrator.py +19 -28
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/__init__.py +6 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/borrow.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/borrow_hook.py +9 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/committed_marks.py +4 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/connection.py +13 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/factory.py +19 -26
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/converters.py +1 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/helpers.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/maintenance.py +19 -14
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/operations.py +26 -27
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/queries.py +74 -82
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/signals.py +15 -8
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/stage_query.py +3 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/store.py +79 -79
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/transaction.py +3 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/workflow_ops.py +35 -34
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/schema_check.py +9 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/converters.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/helpers.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/migrations.py +20 -12
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/operations.py +5 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/queries.py +4 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/schema.py +6 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/signals.py +5 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/queries.py +7 -10
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/stage_ops.py +3 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/stage_query.py +2 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/store.py +10 -11
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/workflow_crud.py +3 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/tenant_schema.py +27 -16
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/transaction.py +5 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/transaction_ops.py +2 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/__init__.py +6 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/criteria.py +18 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/interface.py +31 -81
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/maintenance_defaults.py +7 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/query_defaults.py +2 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/signal_defaults.py +4 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/stage_criteria.py +3 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/transaction.py +2 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/task_lease.py +24 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/tenancy.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/transaction.py +14 -15
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/__init__.py +21 -19
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/dedup.py +12 -19
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/dlq.py +31 -36
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/interface.py +14 -30
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/message_base.py +4 -8
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/messages.py +61 -77
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/postgres.py +25 -30
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/postgres_lookups.py +41 -45
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/config.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/drain.py +11 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/handler_base.py +3 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/mixins.py +18 -14
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/processor.py +17 -27
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/redelivery.py +2 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/retention.py +2 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/submission.py +7 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/synchronous.py +7 -11
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/sqlite/__init__.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/sqlite/dlq.py +3 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/sqlite/lookups.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/sqlite/queue.py +15 -19
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/sqlite/schema.py +4 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/sqlite/serialization.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/recovery.py +7 -10
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/recovery_rules.py +4 -13
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/reducers.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/__init__.py +3 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/bulkheads.py +14 -20
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/circuits.py +13 -22
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/config.py +3 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/executor.py +17 -18
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/process_executor.py +20 -23
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/timeouts.py +3 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/stages/__init__.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/stages/builder.py +13 -29
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/stages/loop_builder.py +3 -7
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/stages/multi_instance_builder.py +3 -10
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/streaming.py +15 -14
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/__init__.py +5 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/docker.py +8 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/docker_commands.py +11 -12
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/handles.py +2 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/highway/__init__.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/highway/task.py +5 -12
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/__init__.py +6 -4
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/constants.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/guarded_opener.py +1 -1
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/request.py +4 -3
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/response.py +15 -15
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/task.py +9 -11
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/utils.py +5 -6
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/interface.py +29 -54
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/loop.py +11 -9
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/python.py +18 -20
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/registry.py +16 -27
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/result.py +16 -30
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/shell.py +23 -30
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/ssh.py +9 -10
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/sub_workflow.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/threads.py +4 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tracing.py +10 -15
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/validation/__init__.py +7 -5
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/validation/errors.py +1 -2
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/validation/helpers.py +7 -8
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/validation/schemas.py +2 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/validation/validator.py +33 -40
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/verification.py +15 -35
- {stabilize-0.34.3 → stabilize-0.34.4}/.gitignore +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/LICENSE +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/README.md +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/__init__.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/agent_team/README.md +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/agent_team/main.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/agent_team/team_tasks.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/benchmark-overhead.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/docker-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/dynamic-routing-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/event-sourcing-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/golden-standard-expected-result.txt +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/golden-standard.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/highway-integration-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/http-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/incident_commander/README.md +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/incident_commander/incident_tasks.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/incident_commander/main.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/incident_commander/tools.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/lats-coding-agent.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/llama-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/llama_example_pipelines.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/llama_example_support.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/python-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/python_example_pipelines.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/python_servers.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/research_analyst/README.md +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/research_analyst/analyst_tasks.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/research_analyst/main.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/research_analyst/tools.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/shell-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/examples/ssh-example.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KDQ4N9QPJ6Q4MCV3V9GHWPV4_initial_schema.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KE39HEAN221S7AWNS4A0H750_add_performance_indexes.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KE4YJT2W8A6NBX5R7CQMJK84_add_dlq_table.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KE5ZQT3X9B7PCS8R8DRMLN85_add_processed_messages.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KE60R04X0C8QDTS9SEESMN96_add_task_version.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KFA6JDAS811CB5RKPD1FBAST_add_stage_version.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KGFG6RM7NRCJ2PPJ7FZAM0Y9_widen_message_id_column.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KGHWCP1M2QSDE3TN4GUBLV8A_add_workflow_control_flow_patterns.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KWHFBW2B5VZJENEA3D8Z2YPW_add_stage_claims.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01KYTB6S57X765P3BJYY58H79Z_add_queue_task_id_index.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M483DVR3DS980FHS8N754CWH_queue_bigint_ids_and_timestamptz.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M4PAJCF82KCKYT5X4GMZH2XG_workflow_queue_table_and_stage_index.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M4Q8VTM40WEC4HR2X31Q07A5_workflow_config_version.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M4SVVY5XE3S18Y0CPQ8TATDP_purge_and_lookup_indexes.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M64SFQG36NHV5KQ3SHH5Z832_event_store_tables.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M64SFQGDVM97KQS2FFAJ72R5_task_leases.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M67VCHWECA748FVXG88MF3YF_tenant_key.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M684KJKQKEY9RG0RPEZ43GW1_tenant_indexes.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68BCSDHR6ECPVVESPS8WJC4_task_generation.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68FGEZVQR6KPAMW6P5N8B0E_recovery_activity.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68J0WB7ASSYV0JQYBA2KAQM_signal_delivery.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68P99JK1H6MC1W6RZ0SNHH0_definition_version.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68PK3W1DW3T8GZ3YKE3SVSJ_redelivery_budget.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68QC4M0YQASJV3NP98564RB_processed_at_timestamptz.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/migrations/01M68V88TB2FZ4AG6AH1QW3YY4_subscription_cursor.sql +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/driver.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/legacy_history.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/main.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/maintenance_commands.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/migrate_zone.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/migrations.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/prompt_text.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/prompt_text.txt +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/cli/schema_model.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/dag/readiness_types.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/definition_hash.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/base.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/delivery.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/permanent.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/sqlstates.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/store_errors.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/task.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/transient.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/utils.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/verification.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/errors/workflow.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/recorder/digests.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/retention.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/events/store/subscription_names.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/admission.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/cancel_hooks.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/deferred.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/fan_out.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/planner.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/defaults.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/deferred_choice.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/event_recording.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/reset.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/target.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/generation.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/guards.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/lease.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/run_task/verification.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/signal_cleanup.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/handlers/signal_refusal.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/maintenance.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/migrations/__init__.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/completion_records.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/models/stage/definition.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/columns.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/control_states.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/floors.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/function_sources.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/pool_options.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/postgres/transaction_signals.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/signal_scope.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/sqlite_config.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/ids.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/noop_transaction.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/store/owned_rows.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/persistence/task_state.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/py.typed +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/decode.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/message_contract.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/message_ids.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/ownership.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/queue/processor/lease_guard.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/recovery_age.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/recovery_plan.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/redaction.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/resilience/cancellation.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/builtins.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/highway/config.py +0 -0
- {stabilize-0.34.3 → stabilize-0.34.4}/src/stabilize/tasks/http/ssl_context.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: stabilize
|
|
3
|
-
Version: 0.34.
|
|
3
|
+
Version: 0.34.4
|
|
4
4
|
Summary: Stabilize Workflow Orchestration - Agentic Parallel Workflows
|
|
5
5
|
Project-URL: Homepage, https://github.com/rodmena-limited/stabilize
|
|
6
6
|
Project-URL: Repository, https://github.com/rodmena-limited/stabilize
|
|
@@ -54,6 +54,8 @@ Requires-Dist: pyyaml>=6.0; extra == 'dev'
|
|
|
54
54
|
Requires-Dist: ruff>=0.1; extra == 'dev'
|
|
55
55
|
Requires-Dist: structlog>=24.0; extra == 'dev'
|
|
56
56
|
Requires-Dist: testcontainers>=4.0; extra == 'dev'
|
|
57
|
+
Requires-Dist: types-psutil>=7.0; extra == 'dev'
|
|
58
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
57
59
|
Provides-Extra: observability
|
|
58
60
|
Requires-Dist: opentelemetry-api>=1.20; extra == 'observability'
|
|
59
61
|
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'observability'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "stabilize"
|
|
3
|
-
version = "0.34.
|
|
3
|
+
version = "0.34.4"
|
|
4
4
|
description = "Stabilize Workflow Orchestration - Agentic Parallel Workflows"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -104,6 +104,8 @@ dev = [
|
|
|
104
104
|
"testcontainers>=4.0",
|
|
105
105
|
"ruff>=0.1",
|
|
106
106
|
"mypy>=1.8",
|
|
107
|
+
"types-psutil>=7.0",
|
|
108
|
+
"types-PyYAML>=6.0",
|
|
107
109
|
"structlog>=24.0",
|
|
108
110
|
"opentelemetry-api>=1.20",
|
|
109
111
|
"opentelemetry-sdk>=1.20",
|
|
@@ -141,20 +143,72 @@ line-length = 120
|
|
|
141
143
|
target-version = "py311"
|
|
142
144
|
|
|
143
145
|
[tool.ruff.lint]
|
|
144
|
-
select = ["
|
|
146
|
+
select = ["ALL"]
|
|
145
147
|
ignore = [
|
|
146
|
-
"
|
|
148
|
+
"COM812",
|
|
149
|
+
"ISC001",
|
|
150
|
+
"CPY001",
|
|
151
|
+
"D100",
|
|
152
|
+
"D101",
|
|
153
|
+
"D102",
|
|
154
|
+
"D103",
|
|
155
|
+
"D104",
|
|
156
|
+
"D105",
|
|
157
|
+
"D106",
|
|
158
|
+
"D107",
|
|
159
|
+
"ANN401",
|
|
160
|
+
"PLC0415",
|
|
161
|
+
"TRY003",
|
|
162
|
+
"EM101",
|
|
163
|
+
"EM102",
|
|
164
|
+
"FBT001",
|
|
165
|
+
"FBT002",
|
|
166
|
+
"FBT003",
|
|
167
|
+
"ARG001",
|
|
168
|
+
"ARG002",
|
|
169
|
+
"ARG005",
|
|
170
|
+
"C901",
|
|
171
|
+
"PLR0911",
|
|
172
|
+
"PLR0912",
|
|
173
|
+
"PLR0913",
|
|
174
|
+
"PLR0915",
|
|
175
|
+
"PLR0917",
|
|
176
|
+
"PLR2004",
|
|
177
|
+
"BLE001",
|
|
178
|
+
"SLF001",
|
|
179
|
+
"PLW0603",
|
|
180
|
+
"S603",
|
|
181
|
+
"S608",
|
|
182
|
+
"B027",
|
|
183
|
+
"TRY400",
|
|
184
|
+
"TRY301",
|
|
185
|
+
"TRY004",
|
|
147
186
|
]
|
|
148
187
|
|
|
188
|
+
[tool.ruff.lint.isort]
|
|
189
|
+
required-imports = ["from __future__ import annotations"]
|
|
190
|
+
|
|
191
|
+
[tool.ruff.lint.pydocstyle]
|
|
192
|
+
convention = "google"
|
|
193
|
+
|
|
149
194
|
[tool.ruff.lint.per-file-ignores]
|
|
150
|
-
|
|
151
|
-
|
|
195
|
+
"src/stabilize/queue/messages.py" = ["TC001", "TC002", "TC003"]
|
|
196
|
+
"src/stabilize/queue/messages/*" = ["TC001", "TC002", "TC003"]
|
|
197
|
+
"src/stabilize/cli/*" = ["T201"]
|
|
198
|
+
"src/stabilize/models/stage/stage.py" = ["A002"]
|
|
199
|
+
"src/stabilize/tasks/http/request.py" = ["S310"]
|
|
200
|
+
"src/stabilize/tasks/highway/task.py" = ["S310"]
|
|
201
|
+
"src/stabilize/llm/client.py" = ["S310"]
|
|
202
|
+
"src/stabilize/tasks/docker.py" = ["S607"]
|
|
203
|
+
"src/stabilize/tasks/ssh.py" = ["S607"]
|
|
204
|
+
"!src/**" = ["A", "AIR", "ANN", "ARG", "ASYNC", "B", "BLE", "C4", "C90", "COM", "CPY", "D", "DJ", "DOC", "DTZ", "EM", "ERA", "EXE", "FA", "FAST", "FBT", "FIX", "FLY", "FURB", "G", "I002", "ICN", "INP", "INT", "ISC", "LOG", "NPY", "PD", "PERF", "PGH", "PIE", "PLC", "PLE", "PLR", "PLW", "PT", "PTH", "PYI", "Q", "RET", "RSE", "RUF", "S", "SIM", "SLF", "SLOT", "T10", "T20", "TC", "TD", "TID", "TRY", "YTT"]
|
|
152
205
|
"examples/*" = ["E402", "N999", "E501"]
|
|
153
206
|
|
|
154
207
|
[tool.mypy]
|
|
155
208
|
python_version = "3.11"
|
|
156
209
|
strict = true
|
|
157
|
-
|
|
210
|
+
warn_unreachable = true
|
|
211
|
+
enable_error_code = ["ignore-without-code", "truthy-bool", "possibly-undefined"]
|
|
158
212
|
|
|
159
213
|
[tool.pytest.ini_options]
|
|
160
214
|
testpaths = ["tests"]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Stabilize - Highway Workflow Engine execution layer.
|
|
1
|
+
"""Stabilize - Highway Workflow Engine execution layer.
|
|
3
2
|
|
|
4
3
|
This package provides a message-driven DAG execution engine for running
|
|
5
4
|
workflows with full support for:
|
|
@@ -13,7 +12,9 @@ workflows with full support for:
|
|
|
13
12
|
- Configuration validation with JSON Schema
|
|
14
13
|
"""
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
__version__ = "0.34.4"
|
|
17
18
|
|
|
18
19
|
# Assertion helpers
|
|
19
20
|
from stabilize.assertions import (
|
|
@@ -198,148 +199,148 @@ from stabilize.verification import (
|
|
|
198
199
|
)
|
|
199
200
|
|
|
200
201
|
__all__ = [
|
|
201
|
-
"
|
|
202
|
-
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
|
|
202
|
+
"AddMultiInstanceHandler",
|
|
203
|
+
"ApprovalTask",
|
|
204
|
+
"CallableVerifier",
|
|
205
|
+
"CancelRegionHandler",
|
|
206
|
+
"CancelStageHandler",
|
|
207
|
+
# Cooperative cancellation
|
|
208
|
+
"CancellationToken",
|
|
209
|
+
"CompleteStageHandler",
|
|
210
|
+
"CompleteTaskHandler",
|
|
211
|
+
"CompleteWorkflowHandler",
|
|
212
|
+
# Conditions
|
|
213
|
+
"Condition",
|
|
214
|
+
"ConditionReason",
|
|
215
|
+
"ConditionSet",
|
|
216
|
+
"ConditionType",
|
|
217
|
+
"ConfigError",
|
|
218
|
+
"ContextError",
|
|
219
|
+
"ContinueParentStageHandler",
|
|
220
|
+
"DockerTask",
|
|
221
|
+
"HTTPTask",
|
|
222
|
+
"HighwayTask",
|
|
207
223
|
"JoinType",
|
|
208
|
-
"
|
|
224
|
+
"JumpToStageHandler",
|
|
225
|
+
# Lifecycle management
|
|
226
|
+
"LifecycleManager",
|
|
209
227
|
"MultiInstanceConfig",
|
|
210
228
|
# Infrastructure
|
|
211
229
|
"Orchestrator",
|
|
212
|
-
"
|
|
213
|
-
"
|
|
230
|
+
"OutputError",
|
|
231
|
+
"OutputVerifier",
|
|
232
|
+
"PermanentError",
|
|
214
233
|
"PostgresQueue",
|
|
215
|
-
"SqliteQueue",
|
|
216
|
-
"WorkflowStore",
|
|
217
234
|
"PostgresWorkflowStore",
|
|
235
|
+
"PreconditionError",
|
|
236
|
+
"PythonTask",
|
|
237
|
+
"Queue",
|
|
238
|
+
"QueueProcessor",
|
|
239
|
+
"RecoveryError",
|
|
240
|
+
"RecoveryResult",
|
|
241
|
+
"RetryableTask",
|
|
242
|
+
"RunTaskHandler",
|
|
243
|
+
"SSHTask",
|
|
244
|
+
"SchemaValidator",
|
|
245
|
+
"ShellTask",
|
|
246
|
+
"SignalStageHandler",
|
|
247
|
+
"SkipStageHandler",
|
|
248
|
+
"SplitType",
|
|
249
|
+
"SqliteQueue",
|
|
218
250
|
"SqliteWorkflowStore",
|
|
251
|
+
# Assertions
|
|
252
|
+
"StabilizeError",
|
|
253
|
+
"StabilizeExpectedError",
|
|
254
|
+
"StabilizeFatalError",
|
|
219
255
|
# Handlers
|
|
220
256
|
"StabilizeHandler",
|
|
221
|
-
|
|
257
|
+
# Context helpers
|
|
258
|
+
"StageContext",
|
|
259
|
+
"StageExecution",
|
|
260
|
+
"StageNotReadyError",
|
|
222
261
|
"StartStageHandler",
|
|
223
|
-
"SkipStageHandler",
|
|
224
|
-
"CancelStageHandler",
|
|
225
|
-
"ContinueParentStageHandler",
|
|
226
|
-
"JumpToStageHandler",
|
|
227
|
-
"SignalStageHandler",
|
|
228
|
-
"CancelRegionHandler",
|
|
229
|
-
"AddMultiInstanceHandler",
|
|
230
262
|
"StartTaskHandler",
|
|
231
263
|
"StartWaitingWorkflowsHandler",
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"
|
|
235
|
-
"CompleteWorkflowHandler",
|
|
264
|
+
"StartWorkflowHandler",
|
|
265
|
+
"StreamItem",
|
|
266
|
+
"SubWorkflowTask",
|
|
236
267
|
# Tasks
|
|
237
268
|
"Task",
|
|
238
|
-
"RetryableTask",
|
|
239
|
-
"TaskResult",
|
|
240
|
-
# Cooperative cancellation
|
|
241
|
-
"CancellationToken",
|
|
242
269
|
"TaskCancelledError",
|
|
243
|
-
"
|
|
244
|
-
"
|
|
270
|
+
"TaskError",
|
|
271
|
+
"TaskExecution",
|
|
245
272
|
"TaskRegistry",
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
# Verifier registry
|
|
254
|
-
"register_verifier",
|
|
255
|
-
"get_verifier",
|
|
256
|
-
"verifier",
|
|
273
|
+
"TaskResult",
|
|
274
|
+
# Error hierarchy
|
|
275
|
+
"TransientError",
|
|
276
|
+
"TransientVerificationError",
|
|
277
|
+
# Configuration validation
|
|
278
|
+
"ValidationError",
|
|
279
|
+
"VerificationError",
|
|
257
280
|
# Verification
|
|
258
281
|
"Verifier",
|
|
259
282
|
"VerifyResult",
|
|
260
283
|
"VerifyStatus",
|
|
261
|
-
"
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"
|
|
270
|
-
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"StabilizeExpectedError",
|
|
274
|
-
"PreconditionError",
|
|
275
|
-
"ContextError",
|
|
276
|
-
"OutputError",
|
|
277
|
-
"ConfigError",
|
|
278
|
-
"VerificationError",
|
|
279
|
-
"StageNotReadyError",
|
|
280
|
-
"assert_true",
|
|
284
|
+
"Workflow",
|
|
285
|
+
# Recovery
|
|
286
|
+
"WorkflowRecovery",
|
|
287
|
+
# Core models
|
|
288
|
+
"WorkflowStatus",
|
|
289
|
+
"WorkflowStore",
|
|
290
|
+
# Agentic ergonomics (streaming / HITL / reducers)
|
|
291
|
+
"WorkflowStream",
|
|
292
|
+
"add_event",
|
|
293
|
+
"apply_output_reducers",
|
|
294
|
+
"approve",
|
|
295
|
+
"assert_config",
|
|
281
296
|
"assert_context",
|
|
282
|
-
"assert_context_type",
|
|
283
297
|
"assert_context_in",
|
|
298
|
+
"assert_context_type",
|
|
299
|
+
"assert_no_upstream_failures",
|
|
300
|
+
"assert_non_empty",
|
|
301
|
+
"assert_not_none",
|
|
284
302
|
"assert_output",
|
|
285
303
|
"assert_output_type",
|
|
286
304
|
"assert_stage_ready",
|
|
287
|
-
"
|
|
288
|
-
"assert_config",
|
|
305
|
+
"assert_true",
|
|
289
306
|
"assert_verified",
|
|
290
|
-
"assert_not_none",
|
|
291
|
-
"assert_non_empty",
|
|
292
|
-
# Configuration validation
|
|
293
|
-
"ValidationError",
|
|
294
|
-
"SchemaValidator",
|
|
295
|
-
"validate_context",
|
|
296
|
-
"validate_outputs",
|
|
297
|
-
"is_valid",
|
|
298
|
-
# Observability
|
|
299
|
-
"configure_logging",
|
|
300
|
-
"get_logger",
|
|
301
307
|
"bind_context",
|
|
302
|
-
"unbind_context",
|
|
303
308
|
"clear_context",
|
|
304
|
-
|
|
305
|
-
"
|
|
306
|
-
"task_logger",
|
|
309
|
+
# Observability
|
|
310
|
+
"configure_logging",
|
|
307
311
|
"configure_tracing",
|
|
312
|
+
"current_tenant",
|
|
313
|
+
"emit_progress",
|
|
314
|
+
"get_lifecycle_manager",
|
|
315
|
+
"get_logger",
|
|
316
|
+
"get_reducer",
|
|
317
|
+
"get_signal",
|
|
308
318
|
"get_tracer",
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"trace_task",
|
|
313
|
-
"trace_message_processing",
|
|
314
|
-
"add_event",
|
|
315
|
-
"set_attribute",
|
|
316
|
-
# Error hierarchy
|
|
317
|
-
"TransientError",
|
|
318
|
-
"TransientVerificationError",
|
|
319
|
-
"PermanentError",
|
|
320
|
-
"TaskError",
|
|
321
|
-
"RecoveryError",
|
|
322
|
-
"is_transient",
|
|
319
|
+
"get_verifier",
|
|
320
|
+
"install_shutdown_handlers",
|
|
321
|
+
"is_cancellation_requested",
|
|
323
322
|
"is_permanent",
|
|
324
|
-
|
|
325
|
-
"
|
|
326
|
-
"
|
|
323
|
+
"is_transient",
|
|
324
|
+
"is_valid",
|
|
325
|
+
"raise_if_cancellation_requested",
|
|
327
326
|
"recover_on_startup",
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"
|
|
331
|
-
"set_lifecycle_manager",
|
|
332
|
-
"install_shutdown_handlers",
|
|
333
|
-
# Agentic ergonomics (streaming / HITL / reducers)
|
|
334
|
-
"WorkflowStream",
|
|
335
|
-
"StreamItem",
|
|
336
|
-
"emit_progress",
|
|
337
|
-
"ApprovalTask",
|
|
338
|
-
"approve",
|
|
327
|
+
"register_reducer",
|
|
328
|
+
# Verifier registry
|
|
329
|
+
"register_verifier",
|
|
339
330
|
"reject",
|
|
340
331
|
"send_signal",
|
|
341
|
-
"
|
|
342
|
-
"
|
|
343
|
-
"
|
|
344
|
-
"
|
|
332
|
+
"set_attribute",
|
|
333
|
+
"set_lifecycle_manager",
|
|
334
|
+
"stage_logger",
|
|
335
|
+
"task_logger",
|
|
336
|
+
"trace_message_processing",
|
|
337
|
+
"trace_operation",
|
|
338
|
+
"trace_stage",
|
|
339
|
+
"trace_task",
|
|
340
|
+
"trace_workflow",
|
|
341
|
+
"unbind_context",
|
|
342
|
+
"validate_context",
|
|
343
|
+
"validate_outputs",
|
|
344
|
+
"verifier",
|
|
345
|
+
"workflow_logger",
|
|
345
346
|
]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Assertion helpers for validating preconditions and results.
|
|
1
|
+
"""Assertion helpers for validating preconditions and results.
|
|
3
2
|
|
|
4
3
|
This module provides assertion utilities that raise descriptive exceptions
|
|
5
4
|
when conditions are not met. These are useful for:
|
|
@@ -45,27 +44,27 @@ T = TypeVar("T")
|
|
|
45
44
|
|
|
46
45
|
# Re-export exceptions for backward compatibility
|
|
47
46
|
__all__ = [
|
|
48
|
-
"
|
|
49
|
-
"StabilizeFatalError",
|
|
50
|
-
"StabilizeExpectedError",
|
|
51
|
-
"PreconditionError",
|
|
47
|
+
"ConfigError",
|
|
52
48
|
"ContextError",
|
|
53
49
|
"OutputError",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
50
|
+
"PreconditionError",
|
|
51
|
+
"StabilizeError",
|
|
52
|
+
"StabilizeExpectedError",
|
|
53
|
+
"StabilizeFatalError",
|
|
56
54
|
"StageNotReadyError",
|
|
57
|
-
"
|
|
55
|
+
"VerificationError",
|
|
56
|
+
"assert_config",
|
|
58
57
|
"assert_context",
|
|
59
|
-
"assert_context_type",
|
|
60
58
|
"assert_context_in",
|
|
59
|
+
"assert_context_type",
|
|
60
|
+
"assert_no_upstream_failures",
|
|
61
|
+
"assert_non_empty",
|
|
62
|
+
"assert_not_none",
|
|
61
63
|
"assert_output",
|
|
62
64
|
"assert_output_type",
|
|
63
65
|
"assert_stage_ready",
|
|
64
|
-
"
|
|
65
|
-
"assert_config",
|
|
66
|
+
"assert_true",
|
|
66
67
|
"assert_verified",
|
|
67
|
-
"assert_not_none",
|
|
68
|
-
"assert_non_empty",
|
|
69
68
|
]
|
|
70
69
|
|
|
71
70
|
|
|
@@ -75,8 +74,7 @@ __all__ = [
|
|
|
75
74
|
|
|
76
75
|
|
|
77
76
|
def assert_true(condition: bool, message: str) -> None:
|
|
78
|
-
"""
|
|
79
|
-
Assert that a condition is true.
|
|
77
|
+
"""Assert that a condition is true.
|
|
80
78
|
|
|
81
79
|
Args:
|
|
82
80
|
condition: The condition to check
|
|
@@ -97,8 +95,7 @@ def assert_context(
|
|
|
97
95
|
key: str,
|
|
98
96
|
message: str | None = None,
|
|
99
97
|
) -> Any:
|
|
100
|
-
"""
|
|
101
|
-
Assert that a context key exists and return its value.
|
|
98
|
+
"""Assert that a context key exists and return its value.
|
|
102
99
|
|
|
103
100
|
Args:
|
|
104
101
|
stage: The stage execution
|
|
@@ -128,8 +125,7 @@ def assert_context_type(
|
|
|
128
125
|
expected_type: type[T],
|
|
129
126
|
message: str | None = None,
|
|
130
127
|
) -> T:
|
|
131
|
-
"""
|
|
132
|
-
Assert that a context key exists and has the expected type.
|
|
128
|
+
"""Assert that a context key exists and has the expected type.
|
|
133
129
|
|
|
134
130
|
Args:
|
|
135
131
|
stage: The stage execution
|
|
@@ -161,8 +157,7 @@ def assert_context_in(
|
|
|
161
157
|
allowed_values: list[Any],
|
|
162
158
|
message: str | None = None,
|
|
163
159
|
) -> Any:
|
|
164
|
-
"""
|
|
165
|
-
Assert that a context value is in a list of allowed values.
|
|
160
|
+
"""Assert that a context value is in a list of allowed values.
|
|
166
161
|
|
|
167
162
|
Args:
|
|
168
163
|
stage: The stage execution
|
|
@@ -193,8 +188,7 @@ def assert_output(
|
|
|
193
188
|
key: str,
|
|
194
189
|
message: str | None = None,
|
|
195
190
|
) -> Any:
|
|
196
|
-
"""
|
|
197
|
-
Assert that an output key exists and return its value.
|
|
191
|
+
"""Assert that an output key exists and return its value.
|
|
198
192
|
|
|
199
193
|
Args:
|
|
200
194
|
stage: The stage execution
|
|
@@ -224,8 +218,7 @@ def assert_output_type(
|
|
|
224
218
|
expected_type: type[T],
|
|
225
219
|
message: str | None = None,
|
|
226
220
|
) -> T:
|
|
227
|
-
"""
|
|
228
|
-
Assert that an output key exists and has the expected type.
|
|
221
|
+
"""Assert that an output key exists and has the expected type.
|
|
229
222
|
|
|
230
223
|
Args:
|
|
231
224
|
stage: The stage execution
|
|
@@ -255,8 +248,7 @@ def assert_stage_ready(
|
|
|
255
248
|
stage: StageExecution,
|
|
256
249
|
message: str | None = None,
|
|
257
250
|
) -> None:
|
|
258
|
-
"""
|
|
259
|
-
Assert that all upstream stages have completed successfully.
|
|
251
|
+
"""Assert that all upstream stages have completed successfully.
|
|
260
252
|
|
|
261
253
|
Args:
|
|
262
254
|
stage: The stage execution to check
|
|
@@ -279,8 +271,7 @@ def assert_no_upstream_failures(
|
|
|
279
271
|
stage: StageExecution,
|
|
280
272
|
message: str | None = None,
|
|
281
273
|
) -> None:
|
|
282
|
-
"""
|
|
283
|
-
Assert that no upstream stages have failed.
|
|
274
|
+
"""Assert that no upstream stages have failed.
|
|
284
275
|
|
|
285
276
|
Args:
|
|
286
277
|
stage: The stage execution to check
|
|
@@ -304,8 +295,7 @@ def assert_config(
|
|
|
304
295
|
message: str,
|
|
305
296
|
field: str | None = None,
|
|
306
297
|
) -> None:
|
|
307
|
-
"""
|
|
308
|
-
Assert a configuration condition.
|
|
298
|
+
"""Assert a configuration condition.
|
|
309
299
|
|
|
310
300
|
Args:
|
|
311
301
|
condition: The condition to check
|
|
@@ -327,8 +317,7 @@ def assert_verified(
|
|
|
327
317
|
message: str,
|
|
328
318
|
details: dict[str, Any] | None = None,
|
|
329
319
|
) -> None:
|
|
330
|
-
"""
|
|
331
|
-
Assert a verification condition.
|
|
320
|
+
"""Assert a verification condition.
|
|
332
321
|
|
|
333
322
|
Args:
|
|
334
323
|
condition: The condition to check
|
|
@@ -349,8 +338,7 @@ def assert_not_none(
|
|
|
349
338
|
value: T | None,
|
|
350
339
|
message: str,
|
|
351
340
|
) -> T:
|
|
352
|
-
"""
|
|
353
|
-
Assert that a value is not None and return it.
|
|
341
|
+
"""Assert that a value is not None and return it.
|
|
354
342
|
|
|
355
343
|
Args:
|
|
356
344
|
value: The value to check
|
|
@@ -374,8 +362,7 @@ def assert_non_empty(
|
|
|
374
362
|
value: str | list[Any] | dict[str, Any],
|
|
375
363
|
message: str,
|
|
376
364
|
) -> str | list[Any] | dict[str, Any]:
|
|
377
|
-
"""
|
|
378
|
-
Assert that a value is not empty.
|
|
365
|
+
"""Assert that a value is not empty.
|
|
379
366
|
|
|
380
367
|
Works with strings, lists, and dicts.
|
|
381
368
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Audit logging for Stabilize.
|
|
1
|
+
"""Audit logging for Stabilize.
|
|
3
2
|
|
|
4
3
|
Provides an immutable, structured audit trail for compliance-critical operations.
|
|
5
4
|
Audits are distinct from operational logs:
|
|
@@ -96,8 +95,7 @@ def audit(
|
|
|
96
95
|
details: dict[str, Any] | None = None,
|
|
97
96
|
ip_address: str | None = None,
|
|
98
97
|
) -> None:
|
|
99
|
-
"""
|
|
100
|
-
Record an audit event.
|
|
98
|
+
"""Record an audit event.
|
|
101
99
|
|
|
102
100
|
Args:
|
|
103
101
|
event_type: Category (e.g., "WORKFLOW_LIFECYCLE", "SECURITY")
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Stabilize CLI for database migrations and developer tools."""
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
from stabilize.cli.main import main
|
|
4
6
|
from stabilize.cli.prompt_text import PROMPT_TEXT
|
|
5
7
|
|
|
6
|
-
__all__ = ["
|
|
8
|
+
__all__ = ["PROMPT_TEXT", "main"]
|
|
@@ -151,4 +151,4 @@ def adoption_level(models: list[MigrationModel], catalog: Catalog) -> int:
|
|
|
151
151
|
def legacy_rows_for(shipped_plain: dict[str, str], level: int) -> dict[str, str]:
|
|
152
152
|
"""The stabilize_migrations rows the old runner would have recorded for the first *level* migrations."""
|
|
153
153
|
names = sorted(shipped_plain)[:level]
|
|
154
|
-
return {name: hashlib.md5(shipped_plain[name].encode()).hexdigest() for name in names}
|
|
154
|
+
return {name: hashlib.md5(shipped_plain[name].encode(), usedforsecurity=False).hexdigest() for name in names}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import sys
|
|
6
|
-
from pathlib import Path
|
|
7
6
|
from typing import TYPE_CHECKING, Any
|
|
8
7
|
|
|
9
8
|
from stabilize.cli.config import (
|
|
@@ -40,6 +39,8 @@ __all__ = [
|
|
|
40
39
|
]
|
|
41
40
|
|
|
42
41
|
if TYPE_CHECKING:
|
|
42
|
+
from pathlib import Path
|
|
43
|
+
|
|
43
44
|
from stabilize.persistence.store import WorkflowStore
|
|
44
45
|
from stabilize.queue import Queue
|
|
45
46
|
|
|
@@ -214,16 +215,15 @@ def mg_check_grants(role: str, db_url: str | None = None, config_path: Path | No
|
|
|
214
215
|
params = connection_params(config)
|
|
215
216
|
announce_driver(psycopg)
|
|
216
217
|
try:
|
|
217
|
-
with psycopg.connect(**params) as conn:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
report = check_role_grants(cur, role, schema, tables)
|
|
218
|
+
with psycopg.connect(**params) as conn, conn.cursor() as cur:
|
|
219
|
+
if not schema:
|
|
220
|
+
cur.execute("SELECT current_schema()")
|
|
221
|
+
row = cur.fetchone()
|
|
222
|
+
schema = row[0] if row else None
|
|
223
|
+
if not schema:
|
|
224
|
+
print("Error: no current schema; pass ?schema= in the database URL")
|
|
225
|
+
sys.exit(2)
|
|
226
|
+
report = check_role_grants(cur, role, schema, tables)
|
|
227
227
|
except psycopg.Error as e:
|
|
228
228
|
print(f"Database error: {redact_text(str(e))}")
|
|
229
229
|
sys.exit(2)
|
|
@@ -9,7 +9,7 @@ from pathlib import Path
|
|
|
9
9
|
from typing import TYPE_CHECKING
|
|
10
10
|
from urllib.parse import parse_qs, quote, unquote, urlencode
|
|
11
11
|
|
|
12
|
-
from stabilize.redaction import redact_db_url
|
|
12
|
+
from stabilize.redaction import redact_db_url
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
15
|
from typing import Any
|
|
@@ -88,7 +88,7 @@ def load_config(config_path: Path | None = None) -> dict[str, Any]:
|
|
|
88
88
|
print("Set MG_DATABASE_URL instead")
|
|
89
89
|
sys.exit(1)
|
|
90
90
|
try:
|
|
91
|
-
with
|
|
91
|
+
with Path(config_path).open() as f:
|
|
92
92
|
raw = yaml.safe_load(f)
|
|
93
93
|
except OSError as exc:
|
|
94
94
|
print(f"Error: cannot read {config_path}: {exc.strerror}")
|
|
@@ -129,10 +129,10 @@ def format_report(report: GrantReport) -> list[str]:
|
|
|
129
129
|
lines = [f"{header}, {len(report.tables)} engine table(s) from the shipped migrations"]
|
|
130
130
|
if not report.schema_usage:
|
|
131
131
|
lines.append(f" MISSING USAGE on schema {report.schema}")
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
lines.extend(
|
|
133
|
+
f" MISSING table {report.schema}.{table} does not exist (migrations not applied, or wrong schema)"
|
|
134
|
+
for table in report.missing_tables
|
|
135
|
+
)
|
|
136
136
|
for table, privileges in report.missing_privileges.items():
|
|
137
137
|
lines.append(f" MISSING {', '.join(privileges)} on {report.schema}.{table}")
|
|
138
138
|
for table, sequence in report.missing_sequences.items():
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from collections.abc import Iterable, Mapping
|
|
6
5
|
from dataclasses import dataclass, field
|
|
7
|
-
from typing import Any
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
8
7
|
|
|
9
8
|
from stabilize.cli.legacy_history import PLACEHOLDER_SQL, MigrettiState, TakeoverRefusedError
|
|
10
9
|
from stabilize.cli.migrations import migretti_checksum
|
|
11
10
|
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from collections.abc import Iterable, Mapping
|
|
13
|
+
|
|
12
14
|
DEFAULT_HISTORY_SCHEMA = "stabilize_history"
|
|
13
15
|
|
|
14
16
|
|