# tools/core/strings/index.strings.ts

> 54 lines of code and 12 definitions.

Tree: Coordination tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tools-core-strings-index-strings-ts
Source text: https://banes-lab.com/assets/sources/source.0ce6f6372c05369408b87441d2a320a59c45a46fda2be08106183306d0f7bcd2.generated.txt

## Definitions

- `foreignWithoutReason` (lexical_declaration, line 1, exported)
- `unknownState` (lexical_declaration, line 10, exported)
- `unboundLetter` (lexical_declaration, line 17, exported)
- `malformedRow` (lexical_declaration, line 24, exported)
- `alreadyInState` (lexical_declaration, line 31, exported)
- `stateChanged` (lexical_declaration, line 35, exported)
- `rowAdded` (lexical_declaration, line 55, exported)
- `recorded` (lexical_declaration, line 36, exported)
- `ROLE_MISSING` (lexical_declaration, line 43, exported)
- `ROW_SECTION_MISSING` (lexical_declaration, line 47, exported)
- `LETTERS_EXHAUSTED` (lexical_declaration, line 51, exported)
- `INDEX_CONTENDED` (lexical_declaration, line 62, exported)

## Used by

- [tools/core/runners/index.runner.ts](https://banes-lab.com/source/coordination/tools/core/runners/index.runner.ts.md)

## Source

```typescript
export const foreignWithoutReason = function foreignWithoutReason(by: string, letter: string): string {
    return (
        `REFUSED  ${by} is changing the state of ${letter}, which is another seat, and gave no reason. A seat may ` +
        "change another seat's state, for example when that seat left without marking itself inactive. The index " +
        "then records who made the change and why, so a reader can tell it apart from a change the seat made itself. " +
        'Add `--ref "<reason>"` and run the command again.\n'
    );
};

export const unknownState = function unknownState(state: string, states: readonly string[]): string {
    return (
        `REFUSED  ${state} is not a seat state. The states are ${states.join(", ")}, and every tool that reads this ` +
        "column matches one of them, so any other value would be ignored everywhere.\n"
    );
};

export const unboundLetter = function unboundLetter(letter: string): string {
    return (
        `REFUSED  ${letter} has no row in the index, so it has no state to change. A letter is claimed by adding ` +
        'its row with `--index "<role>"`. Add the row first.\n'
    );
};

export const malformedRow = function malformedRow(letter: string): string {
    return (
        `REFUSED  The row for ${letter} does not have the index's three columns (letter, role, state), so the tool ` +
        "cannot find the state. Correct the row by hand, then run the command again.\n"
    );
};

export const alreadyInState = function alreadyInState(letter: string, state: string): string {
    return `CLEAR  ${letter} is already ${state}. Nothing was written.\n`;
};

export const stateChanged = function stateChanged(letter: string, state: string, by: string | null): string {
    const recorded = by === null ? "" : ` The change is recorded under the row, with ${by}'s reason.`;
    return (
        `STATE  ${letter} is now ${state}.${recorded} Every tool that reads seat states uses the new state from its ` +
        "next run. A seat that is not active no longer needs a role document.\n"
    );
};

export const ROLE_MISSING =
    "REFUSED  A new row needs a role, and none was given. The role states what the letter stands for, as a concern " +
    'rather than a task list, for example `--index "coverage of the governance walks"`.\n';

export const ROW_SECTION_MISSING =
    "REFUSED  The index has no row section (the table under the INDEX heading), so the tool has nowhere to add the " +
    "row. Restore the section from the index template, then run the command again.\n";

export const LETTERS_EXHAUSTED =
    "REFUSED  Every letter in the naming scheme is taken. Letters are never reused, because older items and " +
    "citations still point to them.\n";

export const rowAdded = function rowAdded(letter: string, role: string): string {
    return (
        `ROW  ${letter} is bound to "${role}" and marked ACTIVE. Use this letter for every write from now on. The ` +
        "row is permanent: the letter keeps this role, and it is never given to another.\n"
    );
};

export const INDEX_CONTENDED =
    "CONTENDED  The index changed between the read and the write, so nothing was written. Run the command again; " +
    "the tool reads the current index first.\n";
```
