Skip to content

fix(process): dep-gated conditions + barriers wait for spawned children (#569) - #573

Merged
carlospedreira merged 1 commit into
andresharpe:mainfrom
IBondarenko-iwg:fix/569-manifest-condition-order-barrier-wiring
Jul 6, 2026
Merged

fix(process): dep-gated conditions + barriers wait for spawned children (#569)#573
carlospedreira merged 1 commit into
andresharpe:mainfrom
IBondarenko-iwg:fix/569-manifest-condition-order-barrier-wiring

Conversation

@IBondarenko-iwg

Copy link
Copy Markdown
Contributor

Linked issue

Closes #569
Refs #557

Child PR of the 8-bug epic #557, delivering bugs 4 and 5. Merging Closes #569; #557 stays open until the last child lands.

Summary of changes

src/runtime/Modules/Dotbot.Process/Dotbot.Process.psm1 — both fixes in the Get-NextWorkflowTask candidate loop:

Bug 4 — premature, cascading condition-skip. The loop evaluated _IsManifestConditionMet before _AreDepsMet, so a task whose manifest condition points at a file its own upstream dependency produces was marked skipped/condition-not-met at launch (the file doesn't exist yet), added to the done-set, and — since condition-not-met satisfies dependents — cascaded the skip down the chain (observed live: 6 implementation-chain tasks skipped in start-from-jira). Now _AreDepsMet is checked first: a task with unmet deps stays todo (blocked, never marked), and because Get-NextWorkflowTask reloads from disk each call, its condition re-evaluates once the producer completes. A genuinely-false condition on a dep-met task is still a real condition-not-met skip.

Bug 5 — barriers ignored dynamically-spawned children. _AreDepsMet only inspects the explicit dependencies array, so a barrier fired the instant its generator dependency went done — while the children the generator spawned into tasks/todo (stamped extensions.runner.generated_by / provenance.expanded_by) were still running. New _HasOutstandingGeneratedChildren blocks a type=barrier candidate while any non-complete task was generated by one of its dependencies. "Complete" reuses the same rule as the dependency done-set (done/cancelled/split, or skipped only with an intentional reason), so a framework-error skip (max-retries, which Reset-SkippedTasks retries) or a needs-input/needs-review child keeps the barrier waiting rather than firing over unfinished work. Barrier-scoped, direct children only — verified complete for all shipped workflows; widening is a one-line scope-predicate change.

Testing notes

tests/Test-TaskActions.ps1 (Layer 2) adds behavioral coverage calling the exported Get-NextWorkflowTask against on-disk task fixtures:

  • Bug 4: producer + a dependent conditioned on the producer's output. Pass 1 (file absent): producer is selected and the conditioned task stays todo (not condition-not-met). Mark producer done + create the file → pass 2 selects the conditioned task.
  • Bug 5: done generator + a todo child stamped generated_by, plus a higher-priority barrier depending on the generator. Assert the barrier is not selected while the child is non-terminal (child selected); mark child done → barrier is then selected.

Run: pwsh ./tests/Test-TaskActions.ps1 (or ./tests/Run-Tests.ps1 -Layer 2). PARSE OK; PSScriptAnalyzer clean on the changed region; reviewed with /pwsh-review (diff-bug + idioms + history) — one major (child-complete semantics) applied, no blockers.

Checklist

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes two workflow-task scheduling defects in the Dotbot.Process runtime that caused (1) manifest conditions to be evaluated too early (leading to permanent, cascading condition-not-met skips), and (2) barrier tasks to ignore dynamically spawned child tasks created by their generator dependencies.

Changes:

  • Reorders scheduling checks so dependency satisfaction gates manifest condition evaluation (preventing premature condition-not-met skips).
  • Adds barrier readiness logic to block type=barrier tasks while any non-terminal tasks generated/expanded by its dependencies remain outstanding.
  • Adds Layer 2 fixture-based tests covering both scheduling behaviors via Get-NextWorkflowTask.

Reviewed changes

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

File Description
src/runtime/Modules/Dotbot.Process/Dotbot.Process.psm1 Fixes task selection ordering (deps-before-condition) and adds generated-child awareness for barrier eligibility.
tests/Test-TaskActions.ps1 Adds regression tests using on-disk task fixtures to validate the new scheduling behavior for bugs #569 (bugs 4 & 5).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@carlospedreira carlospedreira left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed locally and via connector. Focused regression suite passed: tests/Test-TaskActions.ps1 reported 186 passed, 0 failed. No blocking issues found.

@carlospedreira
carlospedreira merged commit 716afc7 into andresharpe:main Jul 6, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Dotbot Product Backlog Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Manifest scheduling: condition-skip cascade + barrier wiring (#557 bugs 4,5)

3 participants