Skip to content

Phase 1: Implement Job State Machine (in-memory) #2

@monthop-gmail

Description

@monthop-gmail

Objective

Implement the core Job State Machine as an in-memory engine in packages/core/.

States (from state-machine.md)

DRAFT → GOVERNANCE_ANALYSIS → APPROVED / REJECTED →
TASK_PLANNING → IN_PROGRESS → VALIDATING →
DEPLOYABLE → COMPLETED / FAILED

Scope

  • Define state enum and valid transitions
  • Implement transition engine with guard validation
  • Reject invalid transitions with clear errors
  • Emit events on state change (for future observability)
  • Immutable transition history / audit log per job
  • Unit tests for all valid and invalid transitions

Out of Scope (for now)

  • Persistence (DB/Redis)
  • Governance rules engine
  • REST API

Acceptance Criteria

  • All 10 states implemented
  • Invalid transitions throw/reject
  • Each transition is recorded in audit log
  • Test coverage ≥ 90%

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions