Skip to content

tooling: pre-commit hook to forbid new top-level WorkflowStep/AgentTask classes (#6951 AC8) #7048

Closed

Description

@mrveiss

Gap

While verifying #6951 closure, found AC8 was not implemented:

The canonical WorkflowTask/WorkflowPlan in autobot_shared.workflow exist (#6951 Phase 1b–3 done), but nothing prevents future contributors from re-introducing the same fragmentation.

Repro

```
$ grep -rn "WorkflowStep|AgentTask" .pre-commit-config.yaml
(empty)
```

Recommended fix

Add a local hook to .pre-commit-config.yaml, modeled on the existing no-new-health-route hook from #3333:

```yaml

  • id: no-new-workflow-step-class
    name: Prevent new WorkflowStep/AgentTask top-level classes
    entry: scripts/check_no_new_workflow_step_class.py
    language: python
    files: '.py$'
    exclude: '^(autobot_shared/workflow/|autobot-backend/enhanced_orchestration/types.py|autobot-backend/orchestration/types.py|autobot-backend/orchestration/sub_workflow.py|autobot-backend/workflow_templates/types.py)$'
    ```

The script greps for class (WorkflowStep|AgentTask) definitions outside the allowlist (canonical module + already-existing aliases/subclasses + SubWorkflowStep per AC6).

Acceptance Criteria

  • Hook present in .pre-commit-config.yaml and named no-new-workflow-step-class
  • Hook script at scripts/check_no_new_workflow_step_class.py (Python, exits non-zero with helpful message)
  • Allowlist documents the legitimate exceptions: canonical types + 5 known domain-specializations
  • Smoke test: synthesizing a new class WorkflowStep: definition outside allowlist → hook fails

Cross-references

Activity

  1. mrveiss commented on May 6, 2026

    @mrveiss
    OwnerAuthor

    Duplicate of #7014 — closed

    This issue was filed independently with the same goal (Phase 4 of #6951 — pre-commit hook to forbid new top-level WorkflowStep/AgentTask classes). The hook landed via PR #7037 closing #7014, with the canonical implementation at autobot-infrastructure/shared/scripts/hooks/pre-commit-no-new-workflow-step.

    Closing as duplicate. The implementation matches the recommended fix in this issue's body (local pre-commit-config entry, exempt-paths list, mirrors no-new-health-route from #3333), with one differentiation: the hook uses # noqa: workflow-shape line-level suppression instead of file-level exclude: config — same exempt-paths intent, finer-grained control.

    See PR #7037 for the implementation and 8-test-case verification table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions