Skip to content

feat: add child workflow orchestration and controls#473

Merged
niteshpurohit merged 15 commits intomainfrom
feat/implement-child-workflows-and-subflow-orchestration
Apr 26, 2026
Merged

feat: add child workflow orchestration and controls#473
niteshpurohit merged 15 commits intomainfrom
feat/implement-child-workflows-and-subflow-orchestration

Conversation

@niteshpurohit
Copy link
Copy Markdown
Member

  • Introduced child workflow orchestration capabilities, allowing parent workflows to declare child workflows.
  • Implemented enqueueing of child workflows with separate batch IDs, ensuring isolation from parent workflows.
  • Added synchronization controls to propagate terminal states (success, failure, cancellation) from child workflows to parent workflows.
  • Enhanced workflow definitions to include child workflow metadata, improving clarity and functionality.
  • Updated documentation to reflect new child workflow features, including usage examples and operational expectations.
  • Added tests to validate child workflow behavior, ensuring robustness and correctness in orchestration.

closes: #350

- Introduced child workflow orchestration capabilities, allowing parent workflows to declare child workflows.
- Implemented enqueueing of child workflows with separate batch IDs, ensuring isolation from parent workflows.
- Added synchronization controls to propagate terminal states (success, failure, cancellation) from child workflows to parent workflows.
- Enhanced workflow definitions to include child workflow metadata, improving clarity and functionality.
- Updated documentation to reflect new child workflow features, including usage examples and operational expectations.
- Added tests to validate child workflow behavior, ensuring robustness and correctness in orchestration.

closes: #350
- Introduced `child_workflow_snapshot_attribute_value` type to enhance type safety for child workflow attributes.
- Updated `@attributes` and `initialize` method to use the new type, ensuring consistency in attribute handling.
- Modified `fetch` method to return the new attribute type, improving clarity and type correctness.
@niteshpurohit niteshpurohit self-assigned this Apr 25, 2026
Copilot AI review requested due to automatic review settings April 25, 2026 21:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows, enabling parent steps to gate on child workflow completion and providing explicit operator controls to enqueue child batches and sync terminal child state back to parent gate jobs.

Changes:

  • Introduces child workflow relationship metadata (child_workflow on steps, relationship snapshots on workflow snapshots) and gating semantics (parent step not reservable until child succeeds).
  • Adds explicit queue store APIs for child orchestration (enqueue_child_workflow, sync_child_workflows) and wires them into the InMemory reference store.
  • Updates docs and expands unit/integration specs to cover child workflow enqueueing, visibility, gating, and sync behavior.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents recovery expectations for child workflows and parent gating behavior.
docs/pages/workflows/child-workflows.md Adds child workflow concept docs, API examples, and explicit sync boundaries.
docs/pages/troubleshooting.md Adds troubleshooting guidance for child gate steps that won’t reserve.
docs/pages/runtime/controls.md Documents child workflow controls and non-automatic propagation guarantees.
core/karya/spec/karya/workflow/step_spec.rb Tests step-level normalization and defaults for child_workflow.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests child gating readiness and relationship validation on step snapshots.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests workflow snapshots exposing parent/child metadata + validation.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition inspection for child step ids.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit coverage for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Extends base contract tests for new child workflow APIs.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Adds integration tests for child enqueueing, gating, sync, and validation.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests in-memory state cleanup for child workflow relationships.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Validates new bulk mutation action names are accepted.
core/karya/sig/karya/workflow.rbs Adds RBS for child relationship snapshots and new workflow/step fields.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Types new child gating and snapshot builder helpers.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types child relationship registry stored in in-memory state.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds RBS for child enqueue/sync APIs and internals.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes child workflow APIs on the InMemory queue store.
core/karya/sig/karya/queue_store/base.rbs Extends queue store base interface with child workflow APIs.
core/karya/sig/karya.rbs Adds/adjusts type aliases supporting child workflow snapshot payloads.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child relationship fields and readiness gating on child success.
core/karya/lib/karya/workflow/step.rb Adds child_workflow step option with normalization and predicate.
core/karya/lib/karya/workflow/snapshot.rb Adds parent/child relationship metadata to workflow snapshots.
core/karya/lib/karya/workflow/definition.rb Adds definition-level child_step_ids inspection helper.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces immutable ChildWorkflowSnapshot model.
core/karya/lib/karya/workflow.rb Extends workflow DSL step declaration to accept child_workflow:.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Registers child metadata on enqueue and adds child gating to reservability checks.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship registry and pruned-batch cleanup hooks.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements child workflow enqueue + explicit sync in InMemory store.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new child workflow support module.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support and minor internal module formatting.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Extends allowed bulk mutation actions and error message.
core/karya/lib/karya/queue_store/base.rb Adds abstract methods for child workflow enqueue and sync controls.

Comment thread core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Outdated
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb
Comment thread core/karya/sig/karya.rbs Outdated
- Added ChildBatchRetention class to manage retention of terminal child batches based on active parent batches.
- Introduced TerminalBatchPruner class to prune terminal batches while respecting parent-child relationships.
- Updated workflow registration to utilize new classes for improved batch management.
- Enhanced tests to verify retention of terminal child batches when parent is active.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows, enabling parent steps to explicitly gate on separately-enqueued child workflow batches and allowing operators to synchronize terminal child outcomes back to parent gate jobs.

Changes:

  • Introduces child_workflow step metadata plus new snapshot surfaces for parent/child workflow relationships.
  • Adds queue store controls to enqueue child workflow batches and to sync terminal child states into parent gate jobs.
  • Updates in-memory store internals (state tracking, pruning, readiness checks) and expands specs + docs for the new orchestration model.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents recovery expectations for child workflows and explicit sync boundaries.
docs/pages/workflows/child-workflows.md Adds user-facing guide + examples for declaring/enqueuing/syncing child workflows.
docs/pages/troubleshooting.md Adds troubleshooting entry for gate steps blocked on child workflow completion.
docs/pages/runtime/controls.md Documents new child workflow operator controls semantics.
core/karya/spec/karya/workflow/step_spec.rb Tests normalization/defaults for optional child_workflow step metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests child-gated step readiness + relationship validation.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot exposure/validation for parent/child relationship metadata.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition indexing for child steps.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit specs for the new ChildWorkflowSnapshot model.
core/karya/spec/karya/queue_store_base_spec.rb Ensures new QueueStore base APIs raise NotImplementedError by default.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb End-to-end in-memory store coverage for enqueueing + gating + syncing child workflows.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Adds store-state tests for pruning/cleanup behavior with child relationships.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Expands allowed bulk mutation actions for child workflow operations.
core/karya/sig/karya/workflow.rbs Adds/extends RBS for child workflow metadata in steps/snapshots/definitions.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Types child workflow readiness + snapshot building in in-memory store support.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types new workflow child relationship registry + pruning helpers.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds RBS for in-memory child workflow enqueue/sync support.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes child workflow APIs on the in-memory queue store surface.
core/karya/sig/karya/queue_store/base.rbs Adds child workflow APIs to the queue store base interface.
core/karya/sig/karya.rbs Extends shared type unions and bulk mutation action type.
core/karya/lib/karya/workflow/step_snapshot.rb Implements step-level gating on child workflow success + relationship validation.
core/karya/lib/karya/workflow/step.rb Adds child_workflow step attribute + normalization.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationship surfaces (child_workflows, child_workflow, parent).
core/karya/lib/karya/workflow/definition.rb Adds child_step_ids exposure.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces immutable relationship snapshot model.
core/karya/lib/karya/workflow.rb Extends workflow DSL step to accept child_workflow:.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Gates reservability on child success + emits relationship snapshots.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship registry + pruning retention behavior.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements enqueue + sync controls for child workflows (in-memory store).
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new internal child workflow support module.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support and minor constant refactor.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new report action values + updates validation message.
core/karya/lib/karya/queue_store/base.rb Adds base API stubs for enqueueing/syncing child workflows.
Comments suppressed due to low confidence (1)

docs/pages/workflows/child-workflows.md:73

  • The example shows status: waiting-on-children, but the runtime Karya::Workflow::Snapshot#state only reports :pending | :running | :blocked | :succeeded | :failed | :cancelled. If this is meant to reflect snapshot.state, please align the docs to the actual state values or clarify that this is a separate derived/operator-facing status label.

Comment thread core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Outdated
Comment thread core/karya/spec/karya/workflow/snapshot_spec.rb
Comment thread core/karya/lib/karya/workflow/definition.rb Outdated
- Added `delete_expected_children` method to remove child workflow IDs for given parent job IDs.
- Updated `cleanup_child_workflows` to utilize `ExpectedChildrenCleanup` for better management of expected children.
- Introduced `ExpectedChildrenCleanup` class to encapsulate logic for cleaning up expected child metadata.
- Enhanced tests to verify expected child metadata removal during workflow pruning.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows by modeling parent↔child relationships between workflow batches, gating parent “child steps” until the child succeeds, and providing explicit operator controls to enqueue/sync child workflows.

Changes:

  • Introduces child workflow relationship metadata in workflow definitions and snapshots (parent/child batch linkage + child state).
  • Adds InMemory queue-store support for enqueue_child_workflow and sync_child_workflows, including retention/pruning safety for terminal child batches.
  • Expands docs and specs to cover the child workflow operational model and lifecycle behaviors.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery expectations and sync boundary.
docs/pages/workflows/child-workflows.md New/expanded child workflow concept docs + usage examples (declare/enqueue/sync/inspect).
docs/pages/troubleshooting.md Adds troubleshooting guidance for gated parent child-step reservation.
docs/pages/runtime/controls.md Documents child workflow controls and non-automatic propagation expectations.
core/karya/spec/karya/workflow/step_spec.rb Tests step-level normalization/defaulting for child_workflow.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step snapshot gating/validation for child workflow relationships.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot exposure/validation of parent+child relationship metadata.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition inspection for child_step_ids.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Extends Base contract tests for new child workflow APIs.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Integration specs for enqueueing child workflows + syncing terminal state.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests child relationship cleanup and retention behavior during pruning.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Allows new bulk mutation actions for child workflow controls.
core/karya/sig/karya/workflow.rbs Adds/updates signatures for child workflow snapshot + new workflow/step snapshot fields.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Types child workflow metadata handling and snapshot building in InMemory workflow support.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types new workflow child relationship registries + pruning helpers.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds signatures for child workflow enqueue/sync support module.
core/karya/sig/karya/queue_store/in_memory.rbs Adds enqueue_child_workflow / sync_child_workflows to InMemory API surface.
core/karya/sig/karya/queue_store/base.rbs Adds new child workflow methods to QueueStore::Base interface.
core/karya/sig/karya.rbs Extends core types for child workflow snapshots + new bulk mutation actions.
core/karya/lib/karya/workflow/step_snapshot.rb Gates step readiness on child workflow success + validates relationship metadata.
core/karya/lib/karya/workflow/step.rb Adds child_workflow option + normalization + predicate.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationship metadata to snapshots (child list + parent pointer).
core/karya/lib/karya/workflow/definition.rb Exposes child_step_ids via definition inspection.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb New immutable relationship snapshot model + validation.
core/karya/lib/karya/workflow.rb Wires new child workflow snapshot + DSL support for child_workflow:.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Stores child workflow declarations at enqueue + gates reservation on child success + snapshot building.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds workflow child relationship registry + retention-aware terminal batch pruning.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements enqueue/sync child workflow operations in InMemory store.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires the new child workflow support module.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support + minor internal cleanup.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new bulk mutation actions and updates validation messaging.
core/karya/lib/karya/queue_store/base.rb Adds Base interface methods for child workflow enqueue/sync.

Comment thread core/karya/lib/karya/workflow/snapshot.rb
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Outdated
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Outdated
- Introduced WorkflowChildIds class to manage child workflow metadata.
- Replaced ChildWorkflowIds references with WorkflowChildIds in relevant files.
- Updated Snapshot and State classes to accommodate child workflow relationships.
- Enhanced tests to verify behavior of waiting child workflows.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to core/karya, enabling parent workflow steps to declare child workflows, enqueue child batches explicitly, and synchronize terminal child outcomes back into the parent gate step for deterministic, inspectable composition (Issue #350).

Changes:

  • Extend workflow definitions/snapshots to model parent↔child relationships and gate parent readiness on child success.
  • Add enqueue_child_workflow and sync_child_workflows controls (implemented for the in-memory queue store) plus supporting internal state/retention logic.
  • Update docs and specs to cover child workflow enqueueing, inspection, recovery, and explicit sync boundaries.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents recovery expectations for child workflow batches and explicit sync behavior.
docs/pages/workflows/child-workflows.md Adds primary documentation for declaring, enqueueing, inspecting, and syncing child workflows.
docs/pages/troubleshooting.md Adds operator troubleshooting guidance for gated parent child steps.
docs/pages/runtime/controls.md Documents child workflow control boundaries alongside other runtime controls.
core/karya/spec/karya/workflow/step_spec.rb Tests step normalization/defaults for optional child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step readiness/blocking rules and validates child relationship metadata.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot exposure/validation of parent/child relationship metadata and blocked state derivation.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition inspection for identifying child-declared steps.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit coverage for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Ensures new queue store APIs are required by QueueStore::Base implementations.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb End-to-end in-memory tests for child enqueue isolation, gating, and sync propagation.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests relationship retention/pruning and cleanup behavior in store state.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Extends allowed bulk mutation report actions for child workflow operations.
core/karya/sig/karya/workflow.rbs Updates workflow type surface for child relationship snapshots and child step metadata.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Types new in-memory workflow snapshot building and child gating helpers.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds RBS for step→child-workflow-id extraction helper.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types child relationship indexes and new dependency registration APIs.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Types enqueue/sync child workflow support module and helpers.
core/karya/sig/karya/queue_store/in_memory.rbs Adds new public in-memory store APIs for child workflow enqueue/sync.
core/karya/sig/karya/queue_store/base.rbs Adds new abstract queue store APIs for child workflow enqueue/sync.
core/karya/sig/karya.rbs Extends core types for child workflow snapshots and new bulk action symbols.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child relationship fields, validation, and child-success gating for readiness.
core/karya/lib/karya/workflow/step.rb Adds child_workflow to step definition/options normalization.
core/karya/lib/karya/workflow/snapshot.rb Models child relationships/parent metadata and incorporates child gating into workflow state derivation.
core/karya/lib/karya/workflow/definition.rb Exposes child_step_ids and refactors definition inspection to use an @inspection object.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces immutable inspection model for a parent↔child workflow relationship.
core/karya/lib/karya/workflow.rb Wires DSL support for child_workflow: on workflow steps and requires new snapshot class.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Records child step declarations, builds relationship snapshots, and gates reservation on child success.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Extracts child workflow declarations from a definition into per-step metadata.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship registry, retention-aware pruning, and cleanup of child metadata.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements in-memory child enqueue and explicit terminal-state sync into parent gate jobs.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new in-memory internal support modules/files for child workflows.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support into the in-memory queue store and minor constant cleanup.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new bulk action symbols and updates validation error message.
core/karya/lib/karya/queue_store/base.rb Adds abstract enqueue_child_workflow and sync_child_workflows APIs to the base contract.
Comments suppressed due to low confidence (2)

docs/pages/workflows/child-workflows.md:73

  • The example uses status: waiting-on-children, but the runtime snapshot state exposed by Karya::Workflow::Snapshot#state for a parent waiting on a child is :blocked (see specs asserting state == :blocked). Either update the example to use the real state symbol or clarify that this is a UI-only label rather than an actual snapshot state value.
    core/karya/sig/karya/workflow.rbs:883
  • Karya::Workflow::Definition was refactored to store @inspection and no longer defines ivars/readers like @step_ids, @dependencies_by_step_id, @dependents_by_step_id, etc. The RBS still declares those instance variables/readers, so the signature is now out of sync with lib/karya/workflow/definition.rb and should be updated to match the new implementation.
      def initialize: (id: state_name, steps: Array[Step]) -> void
      def child_step_ids: () -> Array[String]
      def step: (state_name step_id) -> Step?
      def fetch_step: (state_name step_id) -> Step
      def dependencies_for: (state_name step_id) -> Array[String]
      def dependents_for: (state_name step_id) -> Array[String]

Comment thread core/karya/sig/karya/workflow.rbs Outdated
- Removed unused attributes related to step IDs and dependencies.
- Added new inspection attribute for enhanced graph inspection.
- Introduced methods for retrieving step IDs and root/leaf/compensable step IDs.
- Improved overall structure for better child workflow orchestration.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows and the in-memory queue store, enabling parent steps to gate on child workflow completion and providing explicit operator controls for enqueueing and terminal-state synchronization (issue #350).

Changes:

  • Introduces child workflow metadata in workflow definitions/steps and exposes parent/child relationship inspection via snapshots.
  • Implements in-memory store support for enqueueing child workflows, gating parent reservation until child success, and syncing terminal child state back to the parent gate step.
  • Updates RBS, docs, and specs to cover the new orchestration model and operator controls.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents recovery expectations for child workflows and explicit sync boundaries.
docs/pages/workflows/child-workflows.md Adds conceptual + operational documentation and usage examples for child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for parent gate steps waiting on children.
docs/pages/runtime/controls.md Documents new child-workflow-related runtime control boundaries.
core/karya/spec/karya/workflow/step_spec.rb Tests step-level normalization/defaults for child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step snapshot readiness/blocking rules and relationship validation for child steps.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests workflow snapshot exposure/validation of parent-child relationship metadata and blocked state behavior.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition graph inspection includes child_step_ids.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for child workflow relationship snapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Extends base store contract tests to require child workflow APIs.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Adds integration coverage for enqueueing/syncing child workflows and gating behavior.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests retention + cleanup behavior for child workflow relationship indexes.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Ensures bulk mutation report accepts new workflow control actions.
core/karya/sig/karya/workflow.rbs Adds/updates signatures for child workflow snapshots and workflow/step snapshot child metadata.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Updates in-memory workflow support signatures for child relationship snapshot building and gating.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds signatures for step→child-workflow-id extraction helper.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types new in-memory relationship registry + retention/pruning and registration metadata.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds signatures for enqueue/sync child workflow support module and helpers.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes child workflow APIs on the in-memory store interface.
core/karya/sig/karya/queue_store/base.rbs Extends base queue store interface with child workflow APIs.
core/karya/sig/karya.rbs Extends shared types for child-workflow snapshot attribute values and bulk mutation actions.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child workflow gating to step readiness and relationship validation plumbing.
core/karya/lib/karya/workflow/step.rb Adds child_workflow option normalization and predicates to workflow steps.
core/karya/lib/karya/workflow/snapshot.rb Adds snapshot-level child relationship metadata + blocked-state derivation for child steps.
core/karya/lib/karya/workflow/definition.rb Refactors inspection accessors and adds child_step_ids support.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces immutable public snapshot model for parent-child relationships.
core/karya/lib/karya/workflow.rb Extends workflow DSL to allow declaring child_workflow: on steps.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Wires child relationship metadata into workflow snapshots and adds child gating in reservation logic.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Implements step→child-workflow-id extraction for workflow registrations.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds relationship registry + terminal-batch retention/pruning behavior for active parent-child chains.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements enqueue + sync operations for child workflows and relationship registration.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new internal child workflow support files.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support module and minor constant/style adjustments.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Allows reporting of new child-workflow control actions.
core/karya/lib/karya/queue_store/base.rb Adds abstract child workflow APIs to the base queue store contract.

Comment thread core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Outdated
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Outdated
- Added WorkflowChildState class to manage nested child workflow snapshots and resolve workflow state for batches.
- Refactored child workflow state retrieval to utilize the new WorkflowChildState class for improved clarity and maintainability.
- Introduced tests for WorkflowChildState to ensure correct functionality and integration with existing workflow management.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows, enabling parent steps to gate on separately-enqueued child workflow batches and providing explicit operator controls to sync terminal child state back to the parent.

Changes:

  • Extend workflow definitions/snapshots/step snapshots to model parent↔child workflow relationships and gate readiness on child success.
  • Add in-memory queue store support for enqueue_child_workflow and sync_child_workflows, plus child relationship retention during pruning.
  • Add/expand docs and specs covering child workflow semantics, recovery, and operational controls.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery and explicit sync behavior.
docs/pages/workflows/child-workflows.md Adds end-to-end conceptual/operational docs and examples for child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for parent gate steps waiting on children.
docs/pages/runtime/controls.md Documents new child workflow control boundaries and expectations.
core/karya/spec/karya/workflow/step_spec.rb Tests step normalization/defaults for child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step gating/validation rules for child workflow relationships.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot relationship exposure, state derivation, and validations.
core/karya/spec/karya/workflow/definition_spec.rb Tests new child_step_ids inspection surface on definitions.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Enforces new abstract base methods for child orchestration controls.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Adds integration specs for enqueueing children, gating, and syncing terminal state.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb Tests nested child state derivation for in-memory store.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests pruning/cleanup semantics with parent-child batch relationships.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Extends allowed mutation actions to include child workflow controls.
core/karya/sig/karya/workflow.rbs Types new workflow relationship surfaces (snapshot/step/definition/child snapshot).
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Types new in-memory workflow snapshot building + child satisfaction checks.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs Adds signatures for recursive child workflow state resolution.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds signatures for extracting child workflow declarations from definitions.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types workflow child relationship registry + pruning/cleanup plumbing.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Types child enqueue + sync control surface for in-memory store.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes new child orchestration methods on the in-memory store interface.
core/karya/sig/karya/queue_store/base.rbs Exposes new child orchestration methods on the base queue store interface.
core/karya/sig/karya.rbs Extends shared types for child workflow snapshots and new control actions.
core/karya/lib/karya/workflow/step_snapshot.rb Gates step readiness on child workflow success + validates relationship identity.
core/karya/lib/karya/workflow/step.rb Adds optional child_workflow metadata to step definitions.
core/karya/lib/karya/workflow/snapshot.rb Adds relationship metadata to snapshots and incorporates child gating into state.
core/karya/lib/karya/workflow/definition.rb Adds child_step_ids inspection and stores graph inspection as a single object.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Implements the immutable child relationship snapshot object.
core/karya/lib/karya/workflow.rb Wires child_workflow through the workflow DSL builder.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Persists child declarations, builds relationship snapshots, and gates reservation on child success.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Implements recursive child workflow state resolution with caching.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Extracts per-step child workflow ids in definition order for storage.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship registry + retention-aware terminal batch pruning + cleanup.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements enqueue/sync control paths for child workflows in the in-memory store.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new internal child workflow support/state/id modules.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support and minor constant/style tweaks.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds enqueue_child_workflow/sync_child_workflows as valid report actions.
core/karya/lib/karya/queue_store/base.rb Adds abstract base methods for child enqueue and sync controls.

Comment thread core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Outdated
Comment thread core/karya/sig/karya/workflow.rbs
- Updated child workflow state methods to accept a timestamp parameter for improved state resolution.
- Modified workflow dependency checks to include the current time, ensuring accurate dependency satisfaction evaluation.
- Introduced a method to ensure parent relationships are initialized correctly, preventing empty indexes.
- Added tests to verify the correct behavior of workflow dependencies and child workflow states with the new timestamp parameter.
@niteshpurohit niteshpurohit requested a review from Copilot April 25, 2026 23:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows, allowing parent steps to gate on separately enqueued child workflow batches and providing explicit operator controls to sync terminal child states back to parents.

Changes:

  • Introduces child workflow relationship metadata in workflow definitions and snapshots (parent/child linkage + gating behavior).
  • Adds queue-store operations for child workflow enqueue (enqueue_child_workflow) and lifecycle synchronization (sync_child_workflows), with InMemory reference support.
  • Updates docs and specs to cover operator workflows, recovery, and visibility for parent/child orchestration.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents recovery expectations for child workflows and explicit sync boundary.
docs/pages/workflows/child-workflows.md Adds conceptual/operational documentation and usage examples for child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for gated parent steps waiting on child success.
docs/pages/runtime/controls.md Documents new child workflow control capabilities and non-goals (no automatic cascade).
core/karya/spec/karya/workflow/step_spec.rb Tests step-level child workflow metadata normalization/defaults.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests StepSnapshot gating + validation of relationship metadata.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot exposure of parent/child relationships and blocked/ready states.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition inspection for child step ids.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Extends Base contract specs to require child workflow orchestration methods.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Adds end-to-end InMemory specs for enqueueing/syncing child workflows.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates workflow readiness tests for new now: signature + gating.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb Adds unit coverage for nested child-state derivation logic.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Adds coverage for retention/pruning behavior with parent/child relationships.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Extends report action validation for new workflow control actions.
core/karya/sig/karya/workflow.rbs Adds RBS for child workflow snapshot/relationship fields and gating helpers.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Updates RBS for readiness checks with now: and child gating.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs Adds RBS for nested child-state resolution helper.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds RBS for deriving step→child_workflow_id declarations.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Extends StoreState/WorkflowChildren typing for child workflow metadata.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds RBS for InMemory child workflow enqueue + sync support.
core/karya/sig/karya/queue_store/in_memory.rbs Extends public InMemory API typing for child workflow controls.
core/karya/sig/karya/queue_store/base.rbs Extends base queue store contract typing for child workflow controls.
core/karya/sig/karya.rbs Adds new bulk mutation actions and workflow snapshot attribute types.
core/karya/lib/karya/workflow/step_snapshot.rb Implements child gating in per-step readiness and relationship validation.
core/karya/lib/karya/workflow/step.rb Adds step-level child_workflow declaration + normalization.
core/karya/lib/karya/workflow/snapshot.rb Adds snapshot relationship exposure (parent + children) and state derivation updates.
core/karya/lib/karya/workflow/definition.rb Adds definition inspection for child step ids and refactors inspection storage.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Adds immutable public snapshot for a single parent/child relationship.
core/karya/lib/karya/workflow.rb Extends DSL step to accept child_workflow: and requires new snapshot file.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Adds child relationship snapshot building and child gating in reservability checks.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Adds recursive child workflow state resolver with caching.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Adds builder for step→child_workflow_id metadata in definition order.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds workflow child relationship registry and retention-aware pruning behavior.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Threads now: into workflow readiness checks for reservation selection.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements child workflow enqueue + sync operations for InMemory store.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires newly added internal child workflow files.
core/karya/lib/karya/queue_store/in_memory.rb Mixes in child workflow support and minor constant/style adjustments.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Registers new bulk mutation actions for child workflow operations.
core/karya/lib/karya/queue_store/base.rb Adds abstract base methods for child workflow enqueue + sync controls.

Comment thread core/karya/sig/karya/queue_store/in_memory.rbs Outdated
Comment thread core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Outdated
- Added new private constants for better encapsulation of workflow-related classes.
- Updated method signatures to include time parameters for improved accuracy in dependency checks.
- Introduced a new method to delete expected children based on parent job IDs, enhancing child workflow management.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to core/karya, allowing a parent workflow step to declare a child workflow batch, gate parent execution on child success, and explicitly sync terminal child outcomes (failed/cancelled) back into the parent step.

Changes:

  • Extend workflow model/snapshots to carry child relationship metadata (ChildWorkflowSnapshot, child IDs by step, parent pointers) and gate readiness/state on child completion.
  • Add queue store APIs and in-memory implementation for enqueue_child_workflow and sync_child_workflows, including retention/pruning rules for terminal child batches.
  • Update docs and add unit/integration specs covering child enqueue, gating, sync behavior, snapshot visibility, and pruning invariants.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery boundaries and explicit sync for terminal propagation.
docs/pages/workflows/child-workflows.md Adds user-facing overview, examples, and operational expectations for child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for gated parent child-step reservation.
docs/pages/runtime/controls.md Documents child workflow control semantics (enqueue + sync; no automatic cascade).
core/karya/spec/karya/workflow/step_spec.rb Tests step normalization/defaults for child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests gating semantics and validation for child relationship metadata on step snapshots.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests workflow snapshots exposing parent/child relationships and blocked/ready state derivation.
core/karya/spec/karya/workflow/definition_spec.rb Tests Definition#child_step_ids indexing.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit specs for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Ensures new child workflow APIs are required by QueueStore::Base.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb End-to-end in-memory tests for enqueueing children, gating, syncing terminal state, and validation/no-partial-writes.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates dependency satisfaction helper calls to include now:.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb Tests recursive child state resolution including nested child relationships.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests child relationship cleanup and terminal batch retention while parent is active.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Extends accepted bulk mutation actions to include child workflow controls.
core/karya/sig/karya/workflow.rbs Adds/updates signatures for child workflow snapshots, relationship metadata, and gating-related internals.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Updates signatures for dependency gating (adds now:) and snapshot building of child relationships.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs Adds signatures for recursive child state resolver.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds signatures for mapping step IDs to declared child workflow IDs.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Adds signatures for child relationship registries and retention-aware pruning cleanup.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds signatures for in-memory child enqueue + sync implementation helpers.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes child workflow APIs on the in-memory store type.
core/karya/sig/karya/queue_store/base.rbs Exposes child workflow APIs on the base queue store interface.
core/karya/sig/karya.rbs Extends type aliases for workflow snapshot attribute values and bulk mutation actions.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child relationship fields + gating logic to step readiness/blocked semantics.
core/karya/lib/karya/workflow/step.rb Adds child_workflow step option with normalization and query helper.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationship metadata to snapshots and uses it for blocked/pending state derivation.
core/karya/lib/karya/workflow/definition.rb Refactors graph inspection exposure and adds child_step_ids.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces ChildWorkflowSnapshot value object with normalization/validation.
core/karya/lib/karya/workflow.rb Extends the DSL builder step signature to accept child_workflow:.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Gates reservability on child success, registers child IDs, and includes relationship snapshots in workflow snapshots.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Implements recursive workflow state resolution for child batches with caching.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Builds step→child-workflow-id mapping from workflow definitions.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship indexes, retention-aware terminal batch pruning, and relationship cleanup.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Updates reservability checks to pass now: into dependency/child gating.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements enqueueing child workflow batches and explicit sync of terminal child outcomes into parent gate jobs.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new internal child workflow helpers/state resolvers.
core/karya/lib/karya/queue_store/in_memory.rb Wires in child workflow support module and minor constant/style adjustments.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new bulk mutation action types and updates validation messaging.
core/karya/lib/karya/queue_store/base.rb Adds abstract API surface for child workflow enqueue + sync.

Comment thread core/karya/sig/karya/workflow.rbs
- Removed the `step_job_ids` attribute from the `ExecutionBinding` class.
- This change cleans up the code by eliminating an unnecessary attribute that is not being utilized.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya workflows, letting a parent workflow step explicitly gate on a separately-enqueued child workflow batch and enabling operators to explicitly synchronize terminal child outcomes back into the parent step.

Changes:

  • Extend workflow definitions/steps/snapshots to model declared child workflows and parent/child relationship inspection.
  • Add InMemory queue store support for enqueue_child_workflow and sync_child_workflows, including reservation gating and pruning rules for terminal child batches.
  • Update docs and specs to cover child workflow enqueue/sync/recovery and inspection behavior.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents recovery expectations for child workflows and explicit sync behavior.
docs/pages/workflows/child-workflows.md Adds end-to-end user documentation and examples for child workflow declaration, enqueue, inspection, and sync.
docs/pages/troubleshooting.md Adds troubleshooting guidance for child-workflow gate steps.
docs/pages/runtime/controls.md Documents child-workflow control semantics (enqueue + sync boundaries).
core/karya/spec/karya/workflow/step_spec.rb Tests step-level normalization/defaults for child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step snapshot gating and relationship metadata validation.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests workflow snapshot relationship exposure, gating state derivation, and validation.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition graph inspection includes child_step_ids.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Enforces new QueueStore Base hooks for child workflows.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Adds integration coverage for enqueueing children, gating, and syncing terminal states.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates dependency-satisfaction tests to pass now: and reflect child gating.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb Adds tests for nested child-state resolution and snapshot inclusion.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests child relationship retention and cleanup behavior during pruning.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Extends report action validation to include child workflow controls.
core/karya/sig/karya/workflow.rbs Adds/updates RBS for child workflow snapshots, step/snapshot relationship fields, and definition inspection.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Updates signatures for child gating and relationship snapshot builders.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs Adds RBS for recursive child workflow state resolver.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds RBS for extracting declared child-workflow ids per step.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Extends store state signatures for child relationship indexes and pruning/cleanup.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds RBS for enqueue/sync child workflow support module.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes new InMemory QueueStore methods and updated internal helper signatures.
core/karya/sig/karya/queue_store/base.rbs Extends QueueStore Base interface with child workflow operations.
core/karya/sig/karya.rbs Updates shared type unions for child workflow snapshot attribute values and new actions.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child relationship fields, readiness gating, and relationship validation at step snapshot level.
core/karya/lib/karya/workflow/step.rb Adds child_workflow option normalization and child_workflow? predicate.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationship grouping, relationship validation, and workflow state derivation that accounts for child gating.
core/karya/lib/karya/workflow/definition.rb Refactors to store graph inspection object and adds child_step_ids.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces immutable public snapshot for parent-child workflow relationships.
core/karya/lib/karya/workflow.rb Extends DSL step signature with child_workflow: and requires new snapshot type.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Stores child declarations in registrations, builds relationship snapshots, and gates reservation on child success.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Implements recursive child workflow state derivation with caching.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Extracts declared child-workflow ids from definitions for store registration.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship registry and pruning/cleanup rules for parent/child batches.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Updates reserve eligibility to pass now: into workflow gating checks.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Adds enqueue + explicit sync operations for child workflows in InMemory store.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new child workflow internal modules.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support and small constant formatting tweak.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new control actions and updates action validation message.
core/karya/lib/karya/queue_store/base.rb Extends abstract base class with new child workflow operations.

Comment thread docs/pages/troubleshooting.md
- Added a visiting parameter to track child workflow cycles during resolution.
- Updated the resolve method to raise an error for detected cycles.
- Modified StateSnapshot and RelationshipSnapshot to accommodate the visiting parameter.
- Enhanced tests to verify error handling for child workflow cycles.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces first-class child workflow orchestration to Karya workflows, enabling parent workflow steps to gate on separately-enqueued child workflow batches and providing explicit operator controls to sync terminal child outcomes back to parent gate jobs (closes #350).

Changes:

  • Add child workflow declaration metadata to workflow steps/definitions and surface parent/child relationship data in workflow snapshots.
  • Implement InMemory queue store support for enqueuing child workflow batches and syncing terminal child state into parent gate jobs, including retention/pruning safety for parent-child relationships.
  • Update docs and add extensive specs plus RBS updates to reflect the new orchestration and inspection surfaces.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery expectations and explicit sync boundaries.
docs/pages/workflows/child-workflows.md Adds end-to-end guidance for declaring/enqueuing/inspecting/syncing child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for parent gate steps blocked on child workflows.
docs/pages/runtime/controls.md Documents the new child workflow controls and non-automatic propagation rules.
core/karya/spec/karya/workflow/step_spec.rb Tests step-level normalization/defaults for child workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step snapshot gating behavior and relationship validation.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot relationship exposure, gating-derived state, and validation.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition indexing for child steps (child_step_ids).
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb New specs for relationship snapshot normalization and validation.
core/karya/spec/karya/queue_store_base_spec.rb Extends base store contract tests for child enqueue + sync APIs.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Integration-style InMemory specs for enqueueing/syncing child workflows.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates internal workflow dependency checks to pass now:.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb New specs for nested child state derivation and cycle detection.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests relationship retention/pruning and cleanup behavior.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Adds new bulk mutation actions for child workflow operations.
core/karya/sig/karya/workflow.rbs Adds/updates signatures for child workflow snapshots and relationship-aware workflow snapshots/steps/definitions.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Updates internal workflow support signatures for child gating and snapshot building.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs New RBS for recursive child workflow state resolution.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs New RBS for step→child workflow id mapping builder.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Extends store state typing for child relationship registries and retention/pruning.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs New RBS for InMemory child workflow enqueue + sync support.
core/karya/sig/karya/queue_store/in_memory.rbs Adds public InMemory APIs for child workflow enqueue + sync and updated helper signatures.
core/karya/sig/karya/queue_store/base.rbs Extends queue store base contract with child workflow enqueue + sync.
core/karya/sig/karya.rbs Extends shared type aliases for new snapshot attribute types and bulk mutation actions.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child workflow gate logic and relationship validation to step snapshots.
core/karya/lib/karya/workflow/step.rb Adds child_workflow metadata normalization to workflow steps.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationship plumbing to snapshots and incorporates child gating into derived workflow state.
core/karya/lib/karya/workflow/definition.rb Adds child step indexing and refactors definition inspection storage.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb New immutable snapshot type for parent-child workflow relationships.
core/karya/lib/karya/workflow.rb Extends workflow DSL to accept child_workflow: and requires new snapshot file.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Stores child workflow declarations, builds relationship snapshots, and gates reservation on child success.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb New recursive resolver for child workflow state + nested relationship snapshots with cycle detection.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb New builder for step→child workflow id metadata used during workflow registration.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship registries and pruner retention logic for terminal child batches with active parents.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Updates reservation gating to pass now: into workflow dependency checks.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb New InMemory implementation for enqueueing child workflows and syncing terminal state to parent gate jobs.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new child workflow internal support files.
core/karya/lib/karya/queue_store/in_memory.rb Mixes in child workflow support and minor constant/module formatting updates.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Extends allowed bulk mutation actions + error message list.
core/karya/lib/karya/queue_store/base.rb Adds abstract base methods for child workflow enqueue + sync.

- Refactored child workflow snapshot methods to use a dedicated child state resolver.
- Removed unused parameters from ChildWorkflowSnapshotBuilder initialization.
- Improved clarity and maintainability of child workflow state management.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to Karya’s workflow model, enabling parent steps to declare child workflows, enqueue child batches separately, and explicitly synchronize terminal child outcomes back to the parent gate job.

Changes:

  • Extend workflow definitions, snapshots, and step snapshots with child workflow metadata (IDs + relationship snapshots) and gate-step readiness rules.
  • Add in-memory queue store support for enqueuing child workflows, syncing terminal child states, and retaining terminal child batches while parents remain active.
  • Update docs and specs to cover child workflow operational behavior, recovery, and lifecycle propagation controls.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery boundaries and sync behavior.
docs/pages/workflows/child-workflows.md Adds detailed child workflow semantics, examples, and operator expectations.
docs/pages/troubleshooting.md Adds troubleshooting guidance for non-reservable child gate steps.
docs/pages/runtime/controls.md Documents new child workflow control primitives and non-automatic propagation.
core/karya/spec/karya/workflow/step_spec.rb Tests step normalization for child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests gate behavior and validation for child relationship metadata on step snapshots.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot exposure/validation of parent-child relationship metadata and blocked state.
core/karya/spec/karya/workflow/definition_spec.rb Tests definition inspection for child step IDs.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Adds base contract coverage for enqueue/sync child workflow APIs.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb End-to-end in-memory tests for enqueueing, gating, sync propagation, and validation.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates internal workflow dependency checks to pass now:.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb Adds tests for nested child state resolution and cycle detection.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests retention and cleanup behavior for child relationship indexes.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Allows new bulk mutation actions for child workflow controls.
core/karya/sig/karya/workflow.rbs Mirrors new workflow child relationship types and snapshot/step APIs in RBS.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Mirrors new snapshot building and gating helper signatures.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs Adds RBS for recursive child state resolver.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds RBS for step→child-workflow declaration mapping helper.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Adds relationship registry + retention and cleanup typing.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds RBS for enqueue/sync child workflow support module.
core/karya/sig/karya/queue_store/in_memory.rbs Adds public APIs + private helpers for child workflow orchestration in InMemory.
core/karya/sig/karya/queue_store/base.rbs Adds abstract API surface for child workflow enqueue/sync.
core/karya/sig/karya.rbs Extends type unions and bulk mutation action enum for new controls.
core/karya/lib/karya/workflow/step_snapshot.rb Implements gate-step readiness based on child workflow success + validates relationship identity.
core/karya/lib/karya/workflow/step.rb Adds child_workflow option normalization and predicate.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationship metadata to snapshots and blocks workflow state when child gates are unsatisfied.
core/karya/lib/karya/workflow/definition.rb Adds definition inspection support for child step IDs.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Introduces immutable relationship snapshot type for parent-child workflows.
core/karya/lib/karya/workflow.rb Extends DSL step definition to accept child_workflow: keyword.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Stores child declarations, builds relationship snapshots, and gates reservation on child success.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Implements recursive child workflow state resolution with cycle detection.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Derives step→child workflow declarations from definitions.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds relationship registry, retention-aware terminal pruning, and cleanup for child metadata.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Passes now: through dependency checks for child gate eligibility.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Adds child batch enqueue + explicit sync of terminal child outcomes into parent gate jobs.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires new internal modules for child workflows.
core/karya/lib/karya/queue_store/in_memory.rb Includes child workflow support module and minor style updates.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new supported bulk mutation actions for child workflows.
core/karya/lib/karya/queue_store/base.rb Adds abstract methods for child workflow enqueue/sync controls.

Comment thread core/karya/lib/karya/workflow/snapshot.rb
Comment thread core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Outdated
- Added logic to preserve ancestor cycle markers during nested cycle raises.
- Updated child workflow initialization to validate relationships and detect duplicates.
- Improved error handling for child workflow state management.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to core/karya, modeling parent→child workflow relationships as explicit batch metadata and providing queue-store controls to enqueue child batches and synchronize terminal child outcomes back to the parent gate step.

Changes:

  • Introduces child workflow metadata on workflow steps/snapshots and blocks parent “child steps” until the child batch succeeds.
  • Adds queue-store APIs and in-memory implementation for enqueue_child_workflow and sync_child_workflows, including nested child state resolution and retention-aware pruning.
  • Updates docs and adds specs/RBS to cover the new child workflow primitives and operational controls.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery boundaries and how sync affects parent gates.
docs/pages/workflows/child-workflows.md Adds conceptual/operational docs and examples for declaring/enqueuing/syncing child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for parent gate steps blocked on child workflows.
docs/pages/runtime/controls.md Documents new child-workflow-related control behaviors and non-goals (no auto-cascade).
core/karya/spec/karya/workflow/step_spec.rb Tests step normalization/defaults for child_workflow metadata.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Tests step snapshot gating/validation behavior for child workflow relationships.
core/karya/spec/karya/workflow/snapshot_spec.rb Tests snapshot relationship exposure, gating state derivation, and validation.
core/karya/spec/karya/workflow/definition_spec.rb Tests Definition#child_step_ids inspection support.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb Adds unit tests for ChildWorkflowSnapshot normalization/validation.
core/karya/spec/karya/queue_store_base_spec.rb Ensures new base APIs must be implemented by backends.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Integration coverage for enqueueing/syncing child workflows in the in-memory store.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates dependency readiness helper spec to pass now:.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb Adds tests for nested child state resolution and cycle detection.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Tests pruning/cleanup semantics around parent-child relationships and indexes.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Extends allowed bulk mutation actions to include child workflow controls.
core/karya/sig/karya/workflow.rbs Adds child workflow snapshot types/fields and updates snapshot/definition signatures.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Adds snapshot builder typing for child relationships and new dependency helpers.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs Adds signatures for recursive child-state resolver.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs Adds signatures for step→child-workflow-id mapping builder.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Types workflow child relationship registry and retention-aware pruning support.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs Adds signatures for in-memory child enqueue/sync support.
core/karya/sig/karya/queue_store/in_memory.rbs Exposes new public queue-store APIs and adjusts private helper signatures.
core/karya/sig/karya/queue_store/base.rbs Adds new base interface methods for child workflows.
core/karya/sig/karya.rbs Extends shared types/unions for child workflow snapshots and mutation actions.
core/karya/lib/karya/workflow/step_snapshot.rb Gates readiness on child success and validates relationship metadata.
core/karya/lib/karya/workflow/step.rb Adds child_workflow option normalization and predicate.
core/karya/lib/karya/workflow/snapshot.rb Threads child relationship metadata through snapshot building and state derivation.
core/karya/lib/karya/workflow/definition.rb Adds child_step_ids via graph inspection while keeping definition immutable.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb Implements immutable ChildWorkflowSnapshot with normalization/validation.
core/karya/lib/karya/workflow.rb Extends DSL to declare child_workflow: and requires new snapshot class.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Stores child declarations, builds relationship snapshots, and gates reservation on child success.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb Implements nested child state resolution with caching/cycle detection.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb Builds step→child workflow id mapping in definition order.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds workflow child registry, retention-aware pruning, and cleanup wiring.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Passes now: into workflow dependency/child gating checks during reserve scans.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb Implements enqueue and explicit sync controls for child workflows.
core/karya/lib/karya/queue_store/in_memory/internal.rb Requires newly added internal child workflow modules.
core/karya/lib/karya/queue_store/in_memory.rb Wires in child workflow support module and minor refactors.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Adds new control actions to validation/error messaging.
core/karya/lib/karya/queue_store/base.rb Adds abstract child workflow APIs to the base queue store contract.

- Introduced `workflow_control_job_ids` method to manage job IDs for workflows.
- Adjusted visibility of `WorkflowSnapshotBuilder` class to private for encapsulation.
- Removed unnecessary private declaration for `workflow_dependencies_satisfied?` method.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class child workflow orchestration to core/karya, enabling parent workflow steps to declare child workflows, enqueue child batches separately, and explicitly synchronize terminal child outcomes back into the parent gate step for deterministic lifecycle behavior and operator visibility.

Changes:

  • Introduces child workflow relationship metadata in workflow definitions and runtime snapshots (parent/child linkage + child state).
  • Adds queue-store controls to enqueue child workflow batches and to explicitly sync failed/cancelled child state into the parent gate step.
  • Expands in-memory store state/indexing and pruning behavior to track and retain child batches appropriately, with comprehensive specs and docs updates.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/pages/workflows/replay.md Documents child workflow recovery boundaries and explicit sync behavior.
docs/pages/workflows/child-workflows.md Adds end-to-end guidance for declaring/enqueueing/inspecting/syncing child workflows.
docs/pages/troubleshooting.md Adds troubleshooting guidance for parent gate steps blocked on child workflows.
docs/pages/runtime/controls.md Documents new child workflow control surfaces and non-goals (no implicit enqueue/cascade).
core/karya/spec/karya/workflow/step_spec.rb Adds coverage for child_workflow normalization/defaults on steps.
core/karya/spec/karya/workflow/step_snapshot_spec.rb Adds readiness/blocking and validation coverage for child workflow step snapshots.
core/karya/spec/karya/workflow/snapshot_spec.rb Adds snapshot relationship exposure + validation + state derivation behavior for child steps.
core/karya/spec/karya/workflow/definition_spec.rb Verifies child step id indexing on definitions.
core/karya/spec/karya/workflow/child_workflow_snapshot_spec.rb New spec for snapshot normalization/immutability and state validation.
core/karya/spec/karya/queue_store_base_spec.rb Ensures new child workflow APIs are required by queue store backends.
core/karya/spec/karya/queue_store/in_memory_workflow_spec.rb Integration specs for enqueueing child batches + gating + syncing terminal state.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_support_spec.rb Updates internal dependency readiness specs to account for new now: threading.
core/karya/spec/karya/queue_store/in_memory/internal/workflow_child_state_spec.rb New unit specs for nested child state resolution and cycle detection.
core/karya/spec/karya/queue_store/in_memory/internal/store_state_spec.rb Covers retention/pruning and relationship index cleanup semantics for child batches.
core/karya/spec/karya/queue_store/bulk_mutation_report_spec.rb Adds new bulk-mutation actions for child enqueue + child sync.
core/karya/sig/karya/workflow.rbs Updates/extends workflow RBS for child workflow metadata and snapshot APIs.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_support.rbs Updates in-memory workflow support signatures for child snapshots + gating checks.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_state.rbs New RBS for nested child state resolver.
core/karya/sig/karya/queue_store/in_memory/internal/workflow_child_ids.rbs New RBS for definition-derived child workflow id mapping.
core/karya/sig/karya/queue_store/in_memory/internal/store_state.rbs Extends store state signatures for child relationship registries and pruning behavior.
core/karya/sig/karya/queue_store/in_memory/internal/child_workflow_support.rbs New RBS for in-memory child enqueue + sync controls.
core/karya/sig/karya/queue_store/in_memory.rbs Extends InMemory queue store API with child enqueue + sync controls.
core/karya/sig/karya/queue_store/base.rbs Extends base queue store contract with child enqueue + sync controls.
core/karya/sig/karya.rbs Extends global types for workflow/step snapshot attribute unions and bulk mutation actions.
core/karya/lib/karya/workflow/step_snapshot.rb Adds child relationship fields + gating readiness logic + relationship validation.
core/karya/lib/karya/workflow/step.rb Adds child_workflow declaration support on steps and normalization.
core/karya/lib/karya/workflow/snapshot.rb Adds child relationships to snapshot structure and state derivation (blocked-on-child).
core/karya/lib/karya/workflow/definition.rb Adds child step indexing (child_step_ids) via inspection graph.
core/karya/lib/karya/workflow/child_workflow_snapshot.rb New immutable snapshot type for parent-child relationship inspection.
core/karya/lib/karya/workflow.rb Extends workflow DSL builder to accept child_workflow: on steps.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_support.rb Extends snapshot building + reservability checks to include child relationship gating.
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_state.rb New resolver for nested child workflow state (with cycle detection + caching).
core/karya/lib/karya/queue_store/in_memory/internal/workflow_child_ids.rb New helper to derive step→child workflow id declarations from definitions.
core/karya/lib/karya/queue_store/in_memory/internal/store_state.rb Adds child relationship indexes + retention-aware pruning + cleanup for child metadata.
core/karya/lib/karya/queue_store/in_memory/internal/reserve_selection_support.rb Threads now: through dependency readiness to support child gating resolution.
core/karya/lib/karya/queue_store/in_memory/internal/child_workflow_support.rb New in-memory implementation for child enqueue + explicit sync controls.
core/karya/lib/karya/queue_store/in_memory/internal.rb Wires new internal helpers into InMemory internal loading.
core/karya/lib/karya/queue_store/in_memory.rb Mixes in child workflow support and minor constant formatting updates.
core/karya/lib/karya/queue_store/bulk_mutation_report.rb Registers new bulk mutation actions and updates action validation messaging.
core/karya/lib/karya/queue_store/base.rb Adds abstract base methods for child enqueue + child sync controls.

@niteshpurohit niteshpurohit merged commit 36e0438 into main Apr 26, 2026
26 checks passed
@niteshpurohit niteshpurohit deleted the feat/implement-child-workflows-and-subflow-orchestration branch April 26, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement child workflows and subflow orchestration

2 participants