Skip to content
Astera Technology

Attach each document footnote to its marked field

Footnotes are flattened into a global restriction on every row.

Download complete case notes and answer keys ↓

Define the local evaluation task

A synthetic options sheet supplies row IDs with explicit footnote markers and a marker-to-text dictionary. Attach only each row’s own markers, preserving their order. An unknown marker or missing/nontext note content makes that row unresolved; explicit empty text remains a supplied literal, without inferred meaning; an unmarked row receives no inferred qualification. Repeated markers on a row count once.

  1. Read each row’s marker list
  2. Resolve each distinct marker in the dictionary
  3. Keep unresolved markers with their own row

A marker missing from the dictionary remains unresolved.

Use the filled cases

Original synthetic input and literal answer key
CaseSupplied inputExpected structured outputDecision and reason
One row marked, one unmarked{"notes":{"*":"review"},"rows":[{"id":"A","markers":["*"]},{"id":"B","markers":[]}]}[{"id":"A","notes":["review"],"unknown":[],"resolved":true},{"id":"B","notes":[],"unknown":[],"resolved":true}]Review attaches to A only; B has no supplied qualifier.
Marker text missing{"notes":{},"rows":[{"id":"A","markers":["*"]}]}[{"id":"A","notes":[],"unknown":["*"],"resolved":false}]Retain the missing marker rather than inventing its meaning.
Marker has null rather than text{"notes":{"*":null},"rows":[{"id":"A","markers":["*"]}]}[{"id":"A","notes":[],"unknown":["*"],"resolved":false}]The marker key exists but does not supply its required text channel.
Explicit empty note text{"notes":{"*":""},"rows":[{"id":"A","markers":["*"]}]}[{"id":"A","notes":[""],"unknown":[],"resolved":true}]An explicitly supplied empty string is retained as text; no qualification is invented.
Same marker repeated on one row{"notes":{"*":"review"},"rows":[{"id":"A","markers":["*","*"]}]}[{"id":"A","notes":["review"],"unknown":[],"resolved":true}]The same anchor adds one footnote, not two independent conditions.
Download editable CSV ↓

Work the repeated-marker case. Which output is required, and why?

Show the worked answer

[{"id":"A","notes":["review"],"unknown":[],"resolved":true}] — The same anchor adds one footnote, not two independent conditions.

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){
 return x.rows.map(r=>{const markers=[...new Set(r.markers)],usable=m=>Object.hasOwn(x.notes,m)&&typeof x.notes[m]==='string',unknown=markers.filter(m=>!usable(m));return {id:r.id,notes:markers.filter(m=>usable(m)).map(m=>x.notes[m]),unknown,resolved:unknown.length===0};});
}

const cases = [
  {
    "id": "marked-and-unmarked",
    "input": {
      "notes": {
        "*": "review"
      },
      "rows": [
        {
          "id": "A",
          "markers": [
            "*"
          ]
        },
        {
          "id": "B",
          "markers": []
        }
      ]
    },
    "expected": [
      {
        "id": "A",
        "notes": [
          "review"
        ],
        "unknown": [],
        "resolved": true
      },
      {
        "id": "B",
        "notes": [],
        "unknown": [],
        "resolved": true
      }
    ]
  },
  {
    "id": "unknown-marker",
    "input": {
      "notes": {},
      "rows": [
        {
          "id": "A",
          "markers": [
            "*"
          ]
        }
      ]
    },
    "expected": [
      {
        "id": "A",
        "notes": [],
        "unknown": [
          "*"
        ],
        "resolved": false
      }
    ]
  },
  {
    "id": "nontext-note-content",
    "input": {
      "notes": {
        "*": null
      },
      "rows": [
        {
          "id": "A",
          "markers": [
            "*"
          ]
        }
      ]
    },
    "expected": [
      {
        "id": "A",
        "notes": [],
        "unknown": [
          "*"
        ],
        "resolved": false
      }
    ]
  },
  {
    "id": "explicit-empty-note-text",
    "input": {
      "notes": {
        "*": ""
      },
      "rows": [
        {
          "id": "A",
          "markers": [
            "*"
          ]
        }
      ]
    },
    "expected": [
      {
        "id": "A",
        "notes": [
          ""
        ],
        "unknown": [],
        "resolved": true
      }
    ]
  },
  {
    "id": "repeated-marker",
    "input": {
      "notes": {
        "*": "review"
      },
      "rows": [
        {
          "id": "A",
          "markers": [
            "*",
            "*"
          ]
        }
      ]
    },
    "expected": [
      {
        "id": "A",
        "notes": [
          "review"
        ],
        "unknown": [],
        "resolved": true
      }
    ]
  }
];
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 ↓

Save row/anchor/text associations as evidence for later interpretation. A successful attachment does not decide whether the wording grants eligibility or permission.

Related resources