Skip to content

feat: TaskDefinition syntactic sugar — higher-level API compiling to Worker + Binding #26

@mdproctor

Description

@mdproctor

Part of epic #24.

Port and adapt TaskDefinition from casehub-poc's casehub-core as a higher-level authoring API.

What it does

TaskDefinition lets users define case behaviour (entry criteria, produced keys, execution logic) without constructing Worker + Binding pairs directly against the raw engine model. The framework compiles a TaskDefinition into the corresponding engine primitives at registration time.

POC reference

io.casehub.core.TaskDefinition — interface with entryCriteria(), producedKeys(), execute(CaseFile), timeout, and retry policy.
io.casehub.core.TaskDefinitionRegistry — registration with circular dependency validation.

Scope

  • Decide whether TaskDefinition belongs in api/ (shared across repos) or is app-local to this service
  • Port the interface, adapting CaseFile references to the current engine model (CaseContext)
  • Implement compilation: TaskDefinitionWorker + Binding at registration time
  • Port circular dependency validation from TaskDefinitionRegistry

Open question

Whether entryCriteria / producedKeys semantics map cleanly to the current engine's Worker + Binding model, or need adaptation.

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmigrationCapability migrated or to be migrated from casehub-poc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions