# Auto-Labeling - Troubleshooting

Read on demand, when a run stops or warns.

## Run-time checks

The labeling round (`code_templates/labeling_round.py`) checks these before or during a run and reports each on stderr, in its stdout summary JSON and in the run's run-log entry.

| Check | When it fires | What happens |
|---|---|---|
| No labeled seed | No `EVAL_DATA`, no `DEMOS` in use, and no `decision.json`, `work/decision.json`, `splits/manifest.json` or `held_out_report.json` next to `OUT` or `SPEC` or one level up. The full loop's dev and val rounds (their split is `EVAL_DATA`) and its corpus run (`EVAL_DATA = splits/test.jsonl`) never fire it. | The run stops before any job, points to `references/cold-start.md`, and says how many reviewed rows a promise needs (19, 29 or 59 at zero errors for 0.85, 0.90 or 0.95). With `CONFIRM_NO_SEED` (the customer's opt-out) it goes on and records `unrefined_spec: true`. |
| Labels the spec never mentions | Classification and ner: a `LABEL_SET` entry the spec text never names (case-insensitive whole word; `_` and `-` also match a space). | A `WARNING: label(s) ... are never mentioned in the spec` line and `labels_missing_from_spec`. The fix is in `references/spec-authoring.md`, "Every label needs a definition". |
| Degraded jury | A juror cast no usable ballot on more than 5% of the rows. | A `JURY DEGRADED` warning naming the juror and its missing share, `degraded_jurors` in the summary and in the entry's `confidence_shortfall`, and a per-juror table plus a "Degraded jury" warning in the report's Jury transparency section. The labeling job's output does not return Bedrock's stopReason, so a refusal looks like any dropped reply; a model refusal is the usual cause. |
| Run id too long | `RUN_ID` over 40 characters. | The run stops before any job: the id goes into every scratch DataSet and job name. |
| Model not listed | `GENERATION_MODEL_ID`, a `JURY_MODELS`, `JUDGE_MODELS` or `GRADERS` id, or the `OPTIMIZER` `TeacherModel`, not an id the service accepts verbatim. | The service refuses the job at CreateJob (`contains unsupported model`), before any row is labeled; the run stops and relays the allowed list. |
| No score scale | An ordinal or llm_judge corpus run whose spec states no scale (`Scale: 1 to 5`). | The run stops before any upload: the job sizes its resample band from the scale and fails at load without one. |
| Demo is a gold row | A drawn demo has the id or the input text of an `EVAL_DATA` row. | The gold row is left out of the job's gold (a NOTE says how many): the job fails at load when a demo is an eval row. |
| Option refused by the service | `CONFIDENCE_METHOD`, `CONFIDENCE_ESTIMATOR`, `JUDGE_MODELS`, `CONFIDENCE_FLOOR_BYPASS`, `CONFIDENCE_RECALIBRATION` or `OPTIMIZER`, and CreateJob or the job refuses the field. | CreateJob refuses the request, or the job fails before any model call, naming the field (`Confidence` or `Optimizer`). Report the service's message and ask the user whether to rerun without the flag (billed; a new `RUN_ID` if the job ran). ⏸ |
| Split read out of turn | With a frozen split, a script reads rows of a split its step may not read (demos or a dev round outside dev, a val round outside val, corpus gold outside test or missing a test row no person relabeled), or a split file changed after the freeze. | The run stops before any upload (`split guard: ...`). Pass the right split file; restore a changed split file to its frozen bytes, or after dev or val edits run the `split_freeze` `rehash` action; never re-split. |
| Text column not passed | The first `INPUT_DATA` row has a non-empty text column that `TEXT_FIELDS` leaves out (not an id, gold, marker or model-output field). | A `WARNING: INPUT_DATA has text column(s) ...` line and `unpassed_text_fields` in the summary. Ask the user whether each column belongs in `TEXT_FIELDS` and the spec's Input Data. |
| Reserved column name | A non-empty text column, or a `TEXT_FIELDS` entry, has a name the labeling job reserves (such as `source`, which it writes on each labeled row). | The inspect cell (`code_templates/inspect_inputs.py` Cell 2) lists `reserved_text_fields` with a warning that gives each name's reason; a request with such a TextFields entry is refused before CreateJob with the same reason. Ask the user to copy the column to a new name in the corpus and the seed. |
| Stated confidence missing | With `CONFIDENCE_METHOD = stated`, more than 5% of the ballots (jury) or rows (one model) have no stated confidence. | A `STATED CONFIDENCE MISSING` warning, `stated_confidence_missing_rate` in the summary and a row in the report's certificate table. A missing one counts 0 in the row score. |
| Reserved column name (refine round) | A refine round's `INPUT_DATA` rows have a column named `stated_confidence` or `agreement_confidence`. | A warning: the skill reads both as model output (review rows hide them, a seed merge drops them), so neither can be a `TEXT_FIELDS` column. Ask the user to copy the column to a new name in the corpus and the seed. |
| Verbalized confidence missing | With `CONFIDENCE_METHOD = verbalized`, more than 5% of the labeled rows have `confidence_missing`. | A `VERBALIZED CONFIDENCE MISSING` warning, `verbalized_confidence_missing_rate` in the summary and a row in the report's certified-cutoff table. Those rows have confidence 0: with the 0.75 floor on (the default) they never auto-accept, unless `CONFIDENCE_RECALIBRATION` (the floor reads the mapped value). |
| Judge failures over the share | With `CONFIDENCE_ESTIMATOR = judge` or `panel`, more than 2% of the judge calls fail (the job's fixed limit). | A failed judge call scores 0.0 and is counted. Over the share the job fails after the labeling calls are billed; its error names the failed and asked calls. Report the counts and ask the user whether to rerun (billed again) with or without the judge. ⏸ |
| Reserved column name (option) | A `TEXT_FIELDS` entry is named `confidence_missing` with `CONFIDENCE_METHOD = verbalized`, or `raw_confidence_score` with `CONFIDENCE_RECALIBRATION`. | The run stops before any upload: the job writes that field on each labeled row. Ask the user to copy the column to a new name in the corpus and the seed. |
| Recalibration fit rows are corpus rows | `RECALIBRATION_FIT` rows that people labeled from the corpus (provenance `human_verified` or `spot_checked`, as on a cold start), or whose ids are in a local `INPUT_DATA`. | The run stops before any upload: the job refuses a fit row that is a corpus row at load. Tell the user the map cannot run on this seed and run without `CONFIDENCE_RECALIBRATION`, on their yes. ⏸ |
| Golden rows not reviewed by a person | With `GOLDEN_REVIEW`, an `EVAL_DATA` other than the copy `golden_review.py apply` wrote, or a row or label no person's return changed; a reviewed copy without `--golden-review`, on a refine round or as the scoring cell's `GT`. | The run stops before any upload. Rerun `golden_review.py route` and `apply` (`references/label-review.md`), or pass the original split. |
| Review request refused | `review_labels.py` with too many `--preds`, a missing, empty or oversize prediction or rules file, too many rows or too many rows of one text (the refusal names the limit), a judged run with no unused approval, changed inputs under a used `--run-id`, or a CreateJob refusal. | The client checks stop the run before any upload; the job may still refuse near-identical or template rows (pair and comparison budgets). After a CreateJob refusal it shows the service's message, drops the job record and logs it; no job was made, so the same `--run-id` reruns. |
| Labeling mode unavailable | The control plane rejects `DatasetOptions` (`LabelingBackendUnavailable`), the account cannot run labeling jobs, or a SageMaker, S3 or Bedrock call returns AccessDenied. | HALT with the service's message (`references/sdg-indexed-backend.md`, "When the job cannot run"); the labeling job is the only labeling path: no labeling script, no direct Bedrock call. |

**Endpoint troubleshooting.** If the job fails with "Unable to assume
the role ARN", check in this order: (1) `AWS_ENDPOINT_URL_SAGEMAKER` - if it
is set, tell the user it overrides the SageMaker endpoint and ask whether to unset it and
resubmit (billed; boto3 then uses the region's default endpoint); (2) only then check the
role trusts `sagemaker.amazonaws.com`.
