# Task

> The task a run attempted: its type, its place in a chain of groups, its features and where it came from.

> **Info:** Added in 0.3. The matching [producer capability](https://orchestrationcontextprotocol.io/specification/0.3/document#producer) is `task`.

`run.task` names the task the run attempted. A learner compares runs on the same task, and pools runs on similar tasks, so the task needs a stable id, a type and a few features, all written by the tool that knows them.

```json
"task": {
  "id": "tsk_412",
  "type": "feature",
  "subtype": "cli_flag",
  "repo": "example/widget",
  "org": "example",
  "base_commit": "a1b2c3d",
  "features": { "size": "s", "lang": "python", "has_tests": "yes" },
  "source": { "kind": "backlog", "ref": "issue/412" },
  "labeled_by": { "how": "labeler", "model": "claude-fable-5-1", "tier": "heuristic" }
}
```

The task this run attempted, with its features and its groups. Both members of a pair carry the same task.id and base_commit (E194).

- `id` ([Id](https://orchestrationcontextprotocol.io/specification/0.3/schema#id), required): Stable task id. Both members of a pair carry the same task.id.

- `title` ([ShortText](https://orchestrationcontextprotocol.io/specification/0.3/schema#shorttext)): Short title. `loopmath share` drops it under metadata_only export.

- `type` (string): Top-level task type.

  Recommended values (open set): `bug_fix`, `feature`, `refactor`, `tests`, `docs`, `research`, `infra`, `data`.

  At most 100 characters.

- `subtype` (string): User subcategory; a slash-separated path is allowed, e.g. `payments/webhooks`.

  At most 500 characters.

- `repo` (string): Repository name or opaque id. `loopmath share` replaces it with a salted hash.

  At most 500 characters.

- `org` (string): Organization id. Defaults to the store's `org` config.

  At most 200 characters.

- `groups` ([TaskGroup](https://orchestrationcontextprotocol.io/specification/0.3/schema#taskgroup)[]): The task chain, root first: org, type, repo, subtype, extra user levels. Derived from the fields above when absent.

- `features` (map of boolean | number | string): Task features, key to boolean, number or string. Recommended keys: size (xs, s, m, l, xl), lang (primary language, lowercase), has_tests, spec_clarity (clear, partial, vague), needs_design, touches (1, 2-3, 4+). Filled by the orchestrator.

- `base_commit` (string): Commit the run started from. Pair members must match (E194).

  At most 200 characters.

- `source` (object): *properties*

  - `kind` (string, required): Where the task came from. live: a user's task as it happens. backlog: a planned task list. benchmark: a benchmark item. history: a logged past session.

    Recommended values (open set): `live`, `backlog`, `benchmark`, `history`.

    At most 100 characters.

  - `ref` (string): Opaque reference within that source.

    At most 500 characters.

  - `ext` ([Ext](https://orchestrationcontextprotocol.io/specification/0.3/schema#ext))

- `labeled_by` (object): *properties*

  - `how` (string, required): Who assigned type, subtype and features.

    Recommended values (open set): `orchestrator`, `user`, `labeler`, `inferred`.

    At most 100 characters.

  - `model` (string): The labelling model's id when `how` is labeler.

    At most 200 characters.

  - `tier` ([OutcomeTier](https://orchestrationcontextprotocol.io/specification/0.3/schema#outcometier))

  - `ext` ([Ext](https://orchestrationcontextprotocol.io/specification/0.3/schema#ext))

- `ext` ([Ext](https://orchestrationcontextprotocol.io/specification/0.3/schema#ext))

## Groups

A task belongs to a chain of groups, root first. A learner can pool evidence along the chain, so a new repository starts from what is known about its organization and task type.

- `level` (string, required): Grouping level, root first: org, type, repo, subtype, then extra user levels.

  Recommended values (open set): `org`, `type`, `repo`, `subtype`.

  At most 100 characters.

- `id` (string, required): The group's key at that level.

  At most 500 characters.

- When `groups` is absent, the chain is `org`, `type`, `repo`, `subtype`, taken from the task's fields, with absent fields skipped.
- A producer MAY add levels of its own after `subtype`.

## Features

`features` maps a key to a boolean, number or string. The keys are open; these are recommended so that runs from different tools line up:

| Key | Recommended values |
|---|---|
| `size` | `xs`, `s`, `m`, `l`, `xl` |
| `lang` | the primary language, lowercase |
| `has_tests` | not fixed |
| `spec_clarity` | `clear`, `partial`, `vague` |
| `needs_design` | not fixed |
| `touches` | `1`, `2-3`, `4+` |

`labeled_by` says who assigned `type`, `subtype` and `features`, and its `tier` says how far to trust them, for example `heuristic` for a model labeler.

## Requirements

- `task.id` is stable: every run on the same task carries the same id, so runs can be compared.
- Runs in one [slate](https://orchestrationcontextprotocol.io/specification/0.3/slates) MUST carry the same `task.id`, and the same `base_commit` when present ([E194](https://orchestrationcontextprotocol.io/specification/0.3/conformance#e194)).
- `title` is a short label. Under `metadata_only` it MUST NOT contain the task's prompt or issue text ([Privacy](https://orchestrationcontextprotocol.io/specification/0.3/privacy)). `repo` MAY be an opaque id instead of a name.
- `source.kind` says where the task came from: `live` for a user's task as it happens, `backlog` for a planned task list, `benchmark` for a benchmark item, `history` for a logged past session.
