# Changelog

All notable changes to the `@things-factory/labeling` package will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [9.1.0] - 2025-10-13

### Added

- Initial release of `@things-factory/labeling` package
- Extracted labeling workflow functionality from `@things-factory/integration-label-studio`
- Renamed all "scenario" terminology to "workflow" to avoid conflicts with existing scenario entity
- Complete workflow orchestration system:
  - Multi-step workflow definitions
  - Multiple trigger types (Manual, Schedule, DatasetUpdate, ExternalEvent)
  - 7 step types: ImportData, GeneratePredictions, WaitForAnnotations, SyncAnnotations, ValidateQuality, ExportResults, Notification
  - Workflow execution tracking with detailed step results
  - Error handling and retry logic
  - Conditional step execution
- GraphQL API:
  - `createLabelingWorkflow` - Create new workflow
  - `executeLabelingWorkflow` - Execute workflow
  - `pauseLabelingWorkflow` - Pause workflow
  - `resumeLabelingWorkflow` - Resume workflow
  - `labelingWorkflow` - Get workflow details
  - `labelingWorkflows` - List workflows
  - `workflowExecution` - Get execution status
  - `workflowExecutions` - List executions
- Complete TypeScript type definitions
- Comprehensive documentation (README, MIGRATION_GUIDE)

### Changed

- **BREAKING**: Moved from `integration-label-studio` to standalone `labeling` package
- **BREAKING**: Renamed all types and resolvers:
  - `LabelingScenario` → `LabelingWorkflow`
  - `ScenarioStep` → `WorkflowStep`
  - `ScenarioExecution` → `WorkflowExecution`
  - And all related types
- **BREAKING**: Changed privilege category from "label-studio" to "labeling"
- **BREAKING**: Renamed all GraphQL operations to use "Workflow" terminology

### Removed

- N/A (initial release)

### Deprecated

- Old scenario-related files in `@things-factory/integration-label-studio` are now marked as `.deprecated`

### Fixed

- N/A (initial release)

### Security

- N/A (initial release)

---

## Migration from labeling-scenario

If you were using the old `labeling-scenario` functionality from `@things-factory/integration-label-studio`, please see [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md) for detailed migration instructions.

### Quick Migration Summary

1. Install `@things-factory/labeling` package
2. Update imports from `scenario-types` to `workflow-types`
3. Replace all `Scenario*` types with `Workflow*` types
4. Update GraphQL queries/mutations to use new workflow operations
5. Update privilege checks to use "labeling" category

### Example

**Before:**
```typescript
import { LabelingScenario } from '@things-factory/integration-label-studio/...'
// createLabelingScenario mutation
```

**After:**
```typescript
import { LabelingWorkflow } from '@things-factory/labeling/...'
// createLabelingWorkflow mutation
```
