# tests/core/inspectors/index.inspector.test.ts

> 36 lines of code and 0 definitions.

Tree: Coordination tree
Language: typescript
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tests-core-inspectors-index-inspector-test-ts
Source text: https://banes-lab.com/assets/sources/source.d3c79b236a7d50a450c83e3697bbaedd063ccb051a0ee0a7efda095b71aec767.generated.txt

## Source

```typescript
import { activeSeatLetters, indexedLetters, indexedStates } from "../../../tools/core/inspectors/index.inspector.ts";
import { describe, it } from "node:test";
import assert from "node:assert/strict";

const INDEX = [
    "| letter | role | state |",
    "|---|---|---|",
    "| A | governance | ACTIVE |",
    "| B | document | INACTIVE |",
    "| SAa | subagent | ACTIVE |",
    "| C | graph | |",
    "| A | projection | ACTIVE |",
    "prose naming | Z | outside a row",
].join("\n");

describe("activeSeatLetters", () => {
    it("reads each single-letter seat marked ACTIVE, once per row", () => {
        assert.deepEqual(activeSeatLetters(INDEX), ["A", "A"]);
    });
});

describe("indexedStates", () => {
    it("maps each single-letter seat to its stated state, the last row winning", () => {
        assert.deepEqual(
            [...indexedStates(INDEX)],
            [
                ["A", "ACTIVE"],
                ["B", "INACTIVE"],
            ],
        );
    });
});

describe("indexedLetters", () => {
    it("reads every bound letter, including subagent letters, and reports each repeat binding", () => {
        const { letters, duplicates } = indexedLetters(INDEX);
        assert.deepEqual([...letters], ["A", "B", "SAa", "C"]);
        assert.deepEqual(duplicates, ["A"]);
    });
});
```
