Skip to content

kernel: BatchService — state machine draft→approved→in_annotation→completed, membership freeze, partition into AnnotationJobs (default 1, by size, by explicit segments) #8

Description

@JArmandoAnaya

Context

The Batch is the unit of annotation work. Membership is editable only in draft; approval
freezes it and partitions it into jobs.

Deliverables

  • State machine draft → approved → in_annotation → completed with guarded transitions
    (invalid transitions raise).
  • add_assets/remove_assets allowed only in draft.
  • approve(batch, partition=...) — partition strategies: single job (default), by size
    ("jobs of N assets"), by explicit segments. Jobs are an exact partition: disjoint,
    union = batch. Schema version pinned for the whole batch at approval.
  • completed is derived: batch completes when all its jobs complete; only then are
    annotated assets promoted to the Dataset (promotion itself in DatasetService).
  • Asset exclusion during annotation (skipped) is a recorded decision, never a removal.

Acceptance criteria

  • Transition table fully tested, including invalid moves
  • Partition property test: disjointness + exact union for all strategies
  • Membership mutation after approval raises

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kernelvisionset.kernel — domain, ports, adapters, servicesm1M1 — Living kernel (0.0.1-alpha.1)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions