Skip to content

refactor(workflow-executor): remove redundant Task from all naming#1518

Merged
Scra3 merged 4 commits intofeat/prd-214-setup-workflow-executor-packagefrom
refactor/workflow-executor-remove-task-naming
Mar 31, 2026
Merged

refactor(workflow-executor): remove redundant Task from all naming#1518
Scra3 merged 4 commits intofeat/prd-214-setup-workflow-executor-packagefrom
refactor/workflow-executor-remove-task-naming

Conversation

@Scra3
Copy link
Copy Markdown
Member

@Scra3 Scra3 commented Mar 31, 2026

Summary

Remove the redundant "Task" suffix from all type names, class names, file names, and string values in the workflow-executor package.

Before After
RecordTaskStepStatus RecordStepStatus
RecordTaskStepOutcome RecordStepOutcome
McpTaskStepOutcome McpStepOutcome
RecordTaskStepExecutionData RecordStepExecutionData
McpTaskStepExecutionData McpStepExecutionData
McpTaskStepDefinition McpStepDefinition
RecordTaskStepExecutor RecordStepExecutor
McpTaskStepExecutor McpStepExecutor
'record-task' 'record'
'mcp-task' 'mcp'
record-task-step-executor.ts record-step-executor.ts
mcp-task-step-executor.ts mcp-step-executor.ts

Test plan

  • yarn workspace @forestadmin/workflow-executor tsc --noEmit — compiles
  • yarn workspace @forestadmin/workflow-executor test — 409 tests pass
  • yarn workspace @forestadmin/workflow-executor lint — clean

🤖 Generated with Claude Code

Note

Remove 'Task' suffix from step type names in workflow-executor

  • Renames StepType.McpTask to StepType.Mcp and McpTask* types/classes to Mcp* throughout the package
  • Renames RecordTask* types and the RecordTaskStepExecutor base class to drop the Task suffix, changing the emitted stepOutcome.type from 'record-task' to 'record' and 'mcp-task' to 'mcp'
  • Updates patchBodySchemas in pending-data-validators.ts so PATCH confirmation bodies are validated under key 'mcp' instead of 'mcp-task'
  • Risk: Any external consumers of the public API (step outcome types, execution data types, or the pending-data PATCH endpoint) that reference the old 'mcp-task' or 'record-task' string literals will break

Macroscope summarized 503f08f.

@qltysh
Copy link
Copy Markdown

qltysh bot commented Mar 31, 2026

3 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 7): create 2
qlty Structure Function with high complexity (count = 12): executeToolAndPersist 1

protected async doExecute(): Promise<StepExecutionResult> {
// Branch A -- Re-entry after pending execution found in RunStore
const pending = await this.findPendingExecution<McpTaskStepExecutionData>('mcp-task');
const pending = await this.findPendingExecution<McpStepExecutionData>('mcp');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Low executors/mcp-step-executor.ts:49

The findPendingExecution call at line 49 uses type literal 'mcp', but existing pending executions in RunStore were previously saved with type: 'mcp-task'. This causes the lookup to miss stored pending data, so the code falls through to the first-call branch and triggers duplicate tool selection/execution instead of resuming the pending confirmation flow. Consider handling the legacy type 'mcp-task' in the lookup to maintain backward compatibility.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file packages/workflow-executor/src/executors/mcp-step-executor.ts around line 49:

The `findPendingExecution` call at line 49 uses type literal `'mcp'`, but existing pending executions in `RunStore` were previously saved with `type: 'mcp-task'`. This causes the lookup to miss stored pending data, so the code falls through to the first-call branch and triggers duplicate tool selection/execution instead of resuming the pending confirmation flow. Consider handling the legacy type `'mcp-task'` in the lookup to maintain backward compatibility.

Evidence trail:
1. `packages/workflow-executor/src/executors/mcp-step-executor.ts` line 49: `const pending = await this.findPendingExecution<McpStepExecutionData>('mcp');`
2. `packages/workflow-executor/src/executors/base-step-executor.ts` lines 94-102: `findPendingExecution` filters by exact type match
3. Commit `77038de451820f38ffced3876ddfc4332d2faa78`: "String values: 'record-task' → 'record', 'mcp-task' → 'mcp'"
4. `WORKFLOW-EXECUTOR-CONTRACT.md` lines 119, 155: Still documents `type: "mcp-task"` (no changes in PR diff)
5. git_diff between MERGE_BASE and REVIEWED_COMMIT for WORKFLOW-EXECUTOR-CONTRACT.md: no changes

alban bertolini and others added 3 commits March 31, 2026 15:22
Rename types, classes, files and string values to remove the redundant
"Task" suffix that was propagated from the old RecordTaskStepDefinition.

Types: RecordTaskStepStatus → RecordStepStatus, RecordTaskStepOutcome →
RecordStepOutcome, McpTaskStepOutcome → McpStepOutcome,
RecordTaskStepExecutionData → RecordStepExecutionData,
McpTaskStepExecutionData → McpStepExecutionData,
McpTaskStepDefinition → McpStepDefinition

Classes: RecordTaskStepExecutor → RecordStepExecutor,
McpTaskStepExecutor → McpStepExecutor

String values: 'record-task' → 'record', 'mcp-task' → 'mcp',
StepType.McpTask value 'mcp-task' → 'mcp'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Definition to RecordStepDefinition

- StepType.McpTask → StepType.Mcp
- RecordTaskStepDefinition → RecordStepDefinition
- formatMcpTask → formatMcp

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Scra3 Scra3 force-pushed the refactor/workflow-executor-remove-task-naming branch from f854fc9 to f38aa8f Compare March 31, 2026 13:27
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@qltysh
Copy link
Copy Markdown

qltysh bot commented Mar 31, 2026

Qlty

Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (11)

RatingFile% DiffUncovered Line #s
New file Coverage rating: A
packages/workflow-executor/src/executors/step-executor-factory.ts100.0%
New file Coverage rating: A
...ow-executor/src/executors/load-related-record-step-executor.ts100.0%
New file Coverage rating: A
...s/workflow-executor/src/executors/read-record-step-executor.ts100.0%
New file Coverage rating: A
packages/workflow-executor/src/executors/record-step-executor.ts100.0%
New file Coverage rating: A
packages/workflow-executor/src/types/step-outcome.ts100.0%
New file Coverage rating: A
packages/workflow-executor/src/types/step-definition.ts100.0%
New file Coverage rating: A
...workflow-executor/src/executors/update-record-step-executor.ts100.0%
New file Coverage rating: A
...-executor/src/executors/trigger-record-action-step-executor.ts100.0%
New file Coverage rating: A
packages/workflow-executor/src/index.ts100.0%
New file Coverage rating: A
packages/workflow-executor/src/executors/mcp-step-executor.ts100.0%
New file Coverage rating: A
...ow-executor/src/executors/summary/step-execution-formatters.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Scra3 Scra3 merged commit 252b69d into feat/prd-214-setup-workflow-executor-package Mar 31, 2026
30 checks passed
@Scra3 Scra3 deleted the refactor/workflow-executor-remove-task-naming branch March 31, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants