# Issue triage

> Label each new issue with its kind and owning team as it arrives, and leave only the ones decisio is unsure about for a maintainer.

Source: https://opendecisio.com/docs/use-cases/issue-triage/

It sorts issues well untaught: the script asks for the issue’s kind and applies the label only when the answer is certified:

 

[Figure: The model judges the input; your code chooses the action. Input: An issue description. Question: What kind of issue is this?. Typed answer: An issue kind and probabilities. Your code: Apply the label for a certified answer; otherwise ask a maintainer..]

 

## TL;DR

 

Save the [complete caller](https://opendecisio.com/examples/recipes/issue-triage.py) as `issue-triage.py` and run it with Python 3.12 or later. Set `DECISIO_BASE_URL` to your server, or leave the local default. Until you register and certify this [question](https://opendecisio.com/docs/glossary/#question), the caller sends answers to review.

 python

```
import json
import os
import urllib.error
import urllib.request

QUESTION = {
    "type": "choice",
    "instructions": "What kind of issue is this?",
    "criteria": {
        "bug": "Something is broken",
        "feature": "A request for something new",
        "docs": "The documentation is wrong or missing",
        "question": "A question about how to use it",
        "other": "Anything else"
    }
}
BASE_URL = os.environ.get("DECISIO_BASE_URL", "http://127.0.0.1:8000").rstrip("/")
TIMEOUT = 15
REVIEW = "to a maintainer"

def route(text):
    request = urllib.request.Request(
        BASE_URL + "/v1/systemone",
        data=json.dumps({"state": text, "questions": {"kind": QUESTION}}).encode(),
        headers={"Content-Type": "application/json"},
    )
    try:
        with urllib.request.urlopen(request, timeout=TIMEOUT) as response:
            answer = json.load(response)["answers"]["kind"]
        if not isinstance(answer, dict) or answer.get("type") != QUESTION["type"]:
            return REVIEW
        if not (answer.get("choice") in QUESTION["criteria"]):
            return REVIEW
        # A gold certificate is about correctness; agreement alone is insufficient.
        if (answer.get("certified") is True
                and answer.get("certificate_kind") == "gold"
                and isinstance(answer.get("certificate"), str)
                and answer["certificate"]):
            return f"label {answer['choice']}"
        return f"to a maintainer, {answer['choice']} suggested"
    except (urllib.error.URLError, TimeoutError, OSError, ValueError, KeyError, TypeError):
        return REVIEW

if __name__ == "__main__":
    print(route("The scheduler crashes when a pod has no resource limits."))
```

 Output

```
to a maintainer, bug suggested
```

 

## Is it a good fit?

 

Good fit

- The kind of an issue, and the team that owns it: both work untaught.

Not a good fit

- Priority: the measured run below is right about half the time, taught or not.
- Whether an issue needs more information from its reporter: teaching lowers it slightly.

 

 

## 1 Write the question

 

One `choice` question per label family: one for the kind, one for the owning team. Ask them in the same request, so the issue is read once ([Scale](https://opendecisio.com/docs/scale/)).

 

 

## 2 Teach it and certify it

 

They work untaught, so there is little to teach; certify each question on labelled issues, so that each label says whether it can be applied on its own.

 

Send at least 118 labelled issues. The server holds back half to certify, and a 5% certificate needs 59 of those. More examples certify a larger share.

 

Prepare `issue-triage-labels.jsonl` with one JSON object per line, containing `state` and `answer`. Use real inputs and labels chosen by a person; each answer is one of the question’s [option](https://opendecisio.com/docs/glossary/#option) keys. The code below builds complete requests using the same question as the caller.

 python

```
import json
import os
import urllib.request

QUESTION = {
    "type": "choice",
    "instructions": "What kind of issue is this?",
    "criteria": {
        "bug": "Something is broken",
        "feature": "A request for something new",
        "docs": "The documentation is wrong or missing",
        "question": "A question about how to use it",
        "other": "Anything else"
    }
}
# One JSON object per line: state and the answer chosen by a person.
with open("issue-triage-labels.jsonl", encoding="utf-8") as source:
    rows = [json.loads(line) for line in source if line.strip()]
examples = [
    {"request": {"state": row["state"], "questions": {"kind": QUESTION}},
     "answer": row["answer"]}
    for row in rows
]
body = {"id": "issue-triage", "examples": examples, "certify": {"alpha": 0.05}}
base_url = os.environ.get("DECISIO_BASE_URL", "http://127.0.0.1:8000").rstrip("/")
request = urllib.request.Request(
    base_url + "/v1/tasks", data=json.dumps(body).encode(),
    headers={"Content-Type": "application/json"},
)
# Registration reads all your examples; allow more time than an ordinary decision.
with urllib.request.urlopen(request, timeout=300) as response:
    record = json.load(response)
print(json.dumps(record.get("certificate"), indent=2))
```

 

Needs the reader’s own human-labelled JSONL file.

 

Save the [registration script](https://opendecisio.com/examples/recipes/issue-triage-register.py) beside the labels file and run it with Python. Registration replaces a [task](https://opendecisio.com/docs/glossary/#task) of the same id. Check the returned certificate: a `null` [threshold](https://opendecisio.com/docs/glossary/#threshold) means no answer can be certified.

 

[Certify answers](https://opendecisio.com/docs/tasks/certify/#2-teach-the-task-with-a-certificate) runs this call on a server, with its answer.

 

## 3 Route on the certificate

 

The caller acts only when `certified` is `true` and `certificate_kind` is `gold`, with a certificate id. A learned table’s `agreement` certificate measures agreement with the model, so it goes to review in this recipe.

 

- A [certified answer](https://opendecisio.com/docs/glossary/#certified-answer) applies its label.
- Everything else waits for a maintainer, with decisio’s suggestion beside it.
- If the issues change, a new component or a new kind of report, certification is suspended until you certify again ([Watch for drift](https://opendecisio.com/docs/tasks/drift/)).

 

## What it did

 

- **85.1%** right on the kind of an issue (macro-F1 81.2%) and **85.3%** on its owning SIG, the 12 most frequent (macro-F1 81.0%), by Gemma 4 31B, untaught, on 1,000 real kubernetes/kubernetes issues.
- It works out of the box: teaching changed accuracy by under a point, except on the owning SIG at 1,000 examples, 85.3% to 85.9% (macro-F1 81.0% to 82.4%).
- Priority is 51.0% right, and needs-information has a balanced accuracy of 61.3%, which teaching lowers slightly.
- These figures are fitted offline on the readouts the server returns; the live server's head gave the same answer on every item we compared.
- Issues from kubernetes/kubernetes (Apache-2.0), created 2018-01-01 to 2026-09-30 and fetched through the GitHub API on 2026-10-14; used under the repository's licence (GitHub Terms of Service D.6: content added to a repository containing a licence notice is licensed under the same terms). No issue text, user name or e-mail address is shown or stored here; the results are aggregates.

Read through decisio v0.11.1 on vLLM 0.30.0, on one NVIDIA RTX PRO 6000 Blackwell Workstation Edition (600 W, AMD EPYC 9534 64-Core Processor, driver 595.104.02), on 2026-10-14 and 2026-10-15 (the session ran from 2026-10-14T19:34Z to 2026-10-15T03:38Z); the 31B is tachara-ai/decisio-gemma-4-31b at the recorded revision (fp8_e4m3 weights of google/gemma-4-31B-it), the 12B is tachara-ai/decisio-gemma-4-12b at the recorded revision (bfloat16 weights of google/gemma-4-12B-it); the teaching was fitted offline on the readouts afterwards.

 

 

## Limits

 

- An HTTP error, timeout or invalid response goes to the review path, like an uncertified answer ([Handle review and service failures](https://opendecisio.com/docs/use-cases/#handle-review-and-service-failures)).
- Keep the question and options stable after registration, and certify again after changing the task or [serving setup](https://opendecisio.com/docs/glossary/#serving-setup) ([Keep a certificate valid](https://opendecisio.com/docs/production/#keep-a-certificate-valid)).

 

## What next

 

- [Support routing](https://opendecisio.com/docs/use-cases/support-routing/): the same recipe on a support inbox.
- [Certify answers](https://opendecisio.com/docs/tasks/certify/): the promise, and how to choose the [error target](https://opendecisio.com/docs/glossary/#error-target).
- [Use cases](https://opendecisio.com/docs/use-cases/): the other recipes.
