Skip to content

feat(runtime): gate task execution on input/output artifacts (#510) - #538

Closed
EnmaJim wants to merge 1 commit into
andresharpe:mainfrom
EnmaJim:feature/issue-510
Closed

feat(runtime): gate task execution on input/output artifacts (#510)#538
EnmaJim wants to merge 1 commit into
andresharpe:mainfrom
EnmaJim:feature/issue-510

Conversation

@EnmaJim

@EnmaJim EnmaJim commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Closes #510

Summary of changes

Adds a task input/output artifact contract so a task can no longer be marked
done, nor silently feed a broken context downstream, when a required artifact
is absent, empty, or malformed.

  • Shared predicate Test-DotbotArtifact (src/runtime/Scripts/Invoke-WorkflowProcess.ps1):
    exists → non-empty → (for .json) parses. Minimal, toolchain-free; Markdown/
    source bottom out at the non-empty check by design.
  • Producer-exit gate strengthened: Test-TaskOutput now rejects empty/
    malformed declared outputs (previously existence-only), satisfying the issue's
    "absent, empty, or fails shape validation".
  • Consumer-entry gate added: new Test-TaskInput validates a task's declared
    inputs before it runs. On failure the task is escalated to needs-input with
    a specific, actionable message (e.g. Required input 'briefing/repo-scan.md' is absent)
    via the existing Set-WorkflowTaskNeedsInput. The gate runs before any
    provider session, so a blocked task wastes no tokens.
  • New first-class inputs task field threaded through the closed schemas and
    builders (TaskDefinition, TaskInstance/New-TaskInstance, New-WorkflowTask,
    _FlattenTask) plus API/MCP parity (HttpServer POST/PATCH /tasks,
    task-create MCP tool).
  • Downstream blocking + resume reuse existing machinery: a needs-input task
    isn't reselected and its depends_on dependents stay blocked; answering
    "retry" requeues it and the gate re-validates — no full workflow restart.
  • Tasks without inputs/outputs are unaffected (existing behaviour preserved).

Screenshots / recordings

Required input artifacts surfaced in ACTION REQUIRED, with retry/skip:

Action required slideout showing missing input artifacts with retry/skip options

Resume: after answering "Investigate logs and retry", the task requeues with no error and runs to done:

Task resuming after the retry answer with no error

Testing notes

  • All tests green (pwsh tests/Run-Tests.ps1).
  • New tests added for the input/output gate, the inputs schema, and gate wiring.

Checklist

  • Tests added or updated
  • Docs updated (if behaviour changed) — schema doc-comments updated; no user docs needed
  • Linked issue exists
  • Follows the contribution guide

@carlospedreira

Copy link
Copy Markdown
Collaborator

@EnmaJim this is new feature/design territory and needs its own prioritization pass, so I’ll defer it for now rather than settling the artifact contract model inside this PR.

@EnmaJim EnmaJim closed this Jul 2, 2026
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Dotbot Product Backlog Jul 2, 2026
@EnmaJim
EnmaJim deleted the feature/issue-510 branch July 7, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Task Output Contract: Execution Gates on Missing Artifacts

2 participants