Skip to content
Astera Technology

Resolve a supplied abbreviation only in its document context

One team glossary silently expands another team’s abbreviation.

Download complete case notes and answer keys ↓

Define the local evaluation task

A synthetic knowledge task supplies the current document context, an abbreviation token and separate context glossaries. Resolve only the exact token in the selected glossary; the same token in another glossary supplies no fallback. The result keeps its context so a caller can see where the expansion came from.

  1. Select the supplied document context
  2. Look up the token only in its glossary
  3. Return expansion with provenance or a gap

Missing context or token stays unresolved, even if another glossary has a match.

Use the filled cases

Original synthetic input and literal answer key
CaseSupplied inputExpected structured outputDecision and reason
Warehouse CT{"context":"warehouse","token":"CT","glossaries":{"warehouse":{"CT":"carton"},"training":{"CT":"class time"}}}{"status":"resolved","context":"warehouse","expanded":"carton"}The warehouse glossary supports carton; training has a different expansion.
Training CT{"context":"training","token":"CT","glossaries":{"warehouse":{"CT":"carton"},"training":{"CT":"class time"}}}{"status":"resolved","context":"training","expanded":"class time"}The selected training context changes the applicable expansion.
Selected glossary lacks token{"context":"warehouse","token":"LT","glossaries":{"warehouse":{"CT":"carton"},"training":{"LT":"lesson time"}}}{"status":"unknown-token","context":"warehouse"}Training’s LT cannot fill a missing warehouse entry.
Download editable CSV ↓

Work the no-token-fallback case. Which output is required, and why?

Show the worked answer

{"status":"unknown-token","context":"warehouse"} — Training’s LT cannot fill a missing warehouse entry.

Run the self-contained evaluator

Save as .mjs and run with Node.js; supplied fixtures only
import assert from 'node:assert/strict';

function evaluate(x){
 if(!Object.hasOwn(x.glossaries,x.context))return {status:'unknown-context'};
 const g=x.glossaries[x.context];return Object.hasOwn(g,x.token)?{status:'resolved',context:x.context,expanded:g[x.token]}:{status:'unknown-token',context:x.context};
}

const cases = [
  {
    "id": "warehouse-ct",
    "input": {
      "context": "warehouse",
      "token": "CT",
      "glossaries": {
        "warehouse": {
          "CT": "carton"
        },
        "training": {
          "CT": "class time"
        }
      }
    },
    "expected": {
      "status": "resolved",
      "context": "warehouse",
      "expanded": "carton"
    }
  },
  {
    "id": "training-ct",
    "input": {
      "context": "training",
      "token": "CT",
      "glossaries": {
        "warehouse": {
          "CT": "carton"
        },
        "training": {
          "CT": "class time"
        }
      }
    },
    "expected": {
      "status": "resolved",
      "context": "training",
      "expanded": "class time"
    }
  },
  {
    "id": "no-token-fallback",
    "input": {
      "context": "warehouse",
      "token": "LT",
      "glossaries": {
        "warehouse": {
          "CT": "carton"
        },
        "training": {
          "LT": "lesson time"
        }
      }
    },
    "expected": {
      "status": "unknown-token",
      "context": "warehouse"
    }
  }
];
for (const c of cases) assert.deepEqual(evaluate(c.input), c.expected, c.id);
console.log(JSON.stringify({checked:cases.length,caseIds:cases.map(c=>c.id)}));
Download runnable example ↓

Record context selection with each evaluated answer. This fixture tests retrieval-conditioned glossary choice and deliberately supplies canonical labels; it does not infer industry meanings from a bare abbreviation.

Related resources