# configuration/strings/idiom.strings.ts

> 57 lines of code and 6 definitions.

Tree: Site tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/tree#file-configuration-strings-idiom-strings-ts
Source text: https://banes-lab.com/assets/sources/source.776c0809e8082a66fbb12f149445a2c2626a93b068f99dd6641f894fc4f38924.generated.txt

## Definitions

- `INPUT_SAMPLE` (lexical_declaration, line 6)
- `OUTPUT_SAMPLE` (lexical_declaration, line 9)
- `CONTROL_SAMPLE` (lexical_declaration, line 12)
- `GUARANTEE_DIAGRAM` (lexical_declaration, line 15)
- `PREPOSITION_DIAGRAM` (lexical_declaration, line 18)
- `IDIOM_SECTION` (lexical_declaration, line 21, exported)

## Source

```typescript
import { IDIOM_SECTION_ICON } from "#configuration/icons/grammar.icons";
import { IDIOM_SECTION_ID } from "#core/ids/grammar.ids";
import { PAG_LANGUAGE } from "#configuration/constants/code.constants";
import type { Section } from "#types/document.types";

const INPUT_SAMPLE =
    'READ <file> FROM <path> INTO <content>        # non-destructive · the source is unchanged\nLOAD <settings> FROM <file>                    # acquisition with parsing\nEXTRACT <fields> FROM <record> INTO <values>   # isolation · the source keeps its meaning\nFIND <pattern> IN <scope> INTO <found>          # existence · boolean, non-invasive\nGLOB "<pattern>" INTO <files>                  # discovery by shape\nGREP "<term>" IN <path> INTO <matches>          # discovery by content';

const OUTPUT_SAMPLE =
    "WRITE <content> TO <file>                       # idempotent where it overwrites\nCREATE <report> FROM <data> USING <template>     # a candidate set or an artifact\nAPPEND <item> TO <collection>                    # growth without retraction\nREPORT <status>                                  # a statement to a reader, never a state\n\nCONVERT <data> TO <format>\nFILTER <items> TO <kept> WHERE <condition>       # removes, preserves order\nMERGE <sources> INTO <target>\nSPLIT <data> BY <delimiter> INTO <segments>";

const CONTROL_SAMPLE =
    'VALIDATE <data> AGAINST <schema>                 # conformance\nVERIFY <condition>                               # a boolean, non-modifying\nANALYZE <state> FOR <errors> INTO <found>        # deep examination, may delegate\nCOMPARE <actual> AGAINST <expected> INTO <diff>\nRANK <candidates> BY <score> INTO <ordered>       # score-driven ordering\n\nEXECUTE <command> WITH <params>                  # side effects possible\nTASK "<objective>" WITH agent: <role> → <result>\nSEND <message> TO <recipient>\nAWAIT <response> INTO <result>\nSET <state> = <value>                            # assignment · idempotent\nLINK <source> TO <target>                        # a bidirectional association';

const GUARANTEE_DIAGRAM =
    'flowchart TB\n    verb["A verb"]\n    guarantee["Its semantic contract · what it promises about the source and the result"]\n    reader["A reader relies on the contract"]\n    model["The model is asked to complete the pattern the contract names"]\n    check["A scan can hold the contract · a READ that mutates is a defect"]\n    verb --> guarantee\n    guarantee --> reader\n    guarantee --> model\n    guarantee --> check';

const PREPOSITION_DIAGRAM =
    'flowchart LR\n    from["FROM · the origin"]\n    in["IN · the container searched"]\n    into["INTO · the destination bound"]\n    to["TO · the destination intended"]\n    using["USING · the mechanism"]\n    against["AGAINST · the reference"]\n    for["FOR · the purpose"]\n    with["WITH · the parameters"]\n    from ~~~ in ~~~ into ~~~ to\n    using ~~~ against ~~~ for ~~~ with';

export const IDIOM_SECTION: Section = {
    icon: IDIOM_SECTION_ICON,
    id: IDIOM_SECTION_ID,
    intro: "This section covers the verbs and prepositions a document is written with. Each verb carries a semantic contract, and a document relies on that contract rather than on what a particular tool happens to do; a read, for example, leaves its source unchanged whichever tool performs it. <cite>input verbs</cite> lists what each input verb promises about its source, <cite>output verbs</cite> what each output verb promises about its result, and <cite>control verbs</cite> what each control verb promises about its effects. <cite>three readers</cite> shows who a contract serves, and <cite>the prepositions</cite> declares the relations the prepositions carry between the operands. A verb's contract together with its preposition is the whole meaning of a line.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, a read is used when the source must survive, an extract when its meaning must, a find when only existence matters, a filter when order must hold, and an execute when a side effect is the point. The operands are bound with the preposition that names their relation, and the guarantee is relied on downstream.",
                    boundary:
                        "A contract is a promise the grammar makes about the intent; whether the model or the tool executing the line keeps it is what verification is for.",
                    cause: "A verb the model has seen carry one guarantee across many contexts is likely to carry it into the completion; a verb used loosely carries every meaning it has ever had.",
                    decision:
                        "The verb is chosen by the guarantee the line needs, rather than by the tool that will perform it.",
                    failureMode:
                        "A document says process the items, the model reads, filters, writes and deletes under that one word, and the reviewer cannot say which of those the author meant.",
                    kind: "lesson",
                    principle:
                        "For this reason every line relies on its verb's contract and its preposition's relation, and a line whose behaviour breaks them is a defect in the line.",
                    problem: "A verb with no stated guarantee means whatever the model completes it as.",
                    validation:
                        "To check this, read a line and state what it promises about its source and its result. A line whose promise you cannot state uses its verb loosely, and the repair is the verb whose guarantee matches the intent.",
                },
                {
                    kind: "text",
                    text: "A contract promises one of three things: what happens to the source, what the result is, or what effects the line may have. Two contracts carry the most weight. An execute may have side effects, and saying so is what keeps each of them from being a hidden side effect. A report is a statement to a reader, never a state that anything later reads as the truth.",
                },
                {
                    kind: "text",
                    text: "A line with the wrong preposition puts its operands in the wrong relation, and the model is asked to complete the relation it was given.",
                },
                { code: INPUT_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "input verbs" },
                { code: OUTPUT_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "output verbs" },
                { code: CONTROL_SAMPLE, kind: "code", language: PAG_LANGUAGE, title: "control verbs" },
                { caption: "three readers", kind: "mermaid", text: GUARANTEE_DIAGRAM },
                { caption: "the prepositions", kind: "mermaid", text: PREPOSITION_DIAGRAM },
            ],
            title: "Verbs and their contracts",
        },
    ],
    title: "Instruction patterns",
};
```
