Skip to content

feat: long-lived workers with lifecycle scopes (CASE / STAGE / BINDING) #237

@mdproctor

Description

@mdproctor

Phase 3 migration item from casehub-poc. Workers in the engine currently have no structured lifecycle scope — they are activated per binding trigger and complete independently. This issue tracks first-class lifecycle scoping.

Scope

Define and implement CASE, STAGE, and BINDING lifecycle scopes for workers:

  • BINDING scope — worker lives for the duration of a single binding activation (current implicit behaviour)
  • STAGE scope — worker is active for the lifetime of a containing stage; terminated when the stage exits
  • CASE scope — worker persists for the full case lifetime; receives all context change events within the case

Dependencies

  • Nested stage events (stage activation/completion events must be reliable before scope teardown can be triggered)
  • Worker execution lifecycle tracking in the engine

Notes

Module home TBD — likely casehub-blackboard/ for stage-scoped, engine/ for case-scoped.

Refs casehub-poc migration plan (Phase 3): docs/superpowers/specs/2026-04-14-casehub-engine-migration-plan.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmigrationCapability existing in casehub-poc, or planned in its design/architecture docs

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions