Skip to content

registerCommonTasks() has no declared return type, so any membership test is a TS2345 — builder main is red on it #855

Description

@sroussey

packages/tasks/src/browser.ts:23-28 declares no return type:

export const registerCommonTasks = () => {  return [...tasks, FileGrepTask, FileLoaderTask, FileSedTask]; }

The inferred element type is a union of ~58 concrete task classes whose static inputSchema() return types are literal-inferred and mutually unassignable. Any consumer asking "is X in this set" is therefore a type error.

workglow-dev/builder@1ed0a224 fails bun run types with:

packages/app/src/components/task/systemTasks.ts(30,105): error TS2345:
Argument of type 'typeof FileGrepTask | typeof FileLoaderTask | typeof FileSedTask' is not assignable …
Type 'DataPortSchema' is not assignable to type '{ readonly type: "object"; readonly properties: {}; readonly additionalProperties: true; }'.

builder's main has been red on this since 2026-08-20 (runs 1506, 1509–1512), across three further commits including two dependency bumps.

This also violates the repo's own convention ("Declare return types on top-level module functions"). Annotating it ITaskConstructor[] is a one-line fix with no behaviour change, and prevents the same trap for every other consumer.

Found during the 2026-08-24 review. Snapshot: workglow-dev/prdanalysis/grades/2026-08-24/cross-repo-integration.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions