/** * Phrase dictionaries. * * These lists are DATA, not user interface: they are the vocabulary Trazum * looks for inside the prompts it optimises. Real prompts mix languages, so * the dictionaries deliberately cover English and Spanish at the same time and * a single prompt can trigger entries from both. * * Adding a language here means adding entries to these lists — it is unrelated * to the report language, which lives in `src/i18n/`. * * Every entry earns its place by preserving meaning. Anything whose removal * could change what the prompt asks for belongs in the `aggressive` level, or * does not belong here at all. */ /** * Languages the trimming dictionaries below actually cover. * * Exported because the report has to be able to say so. Until this existed, * a French or German prompt came back with `No rule found anything to trim` — * which reads as "your prompt is already efficient" and meant "I do not speak * your language". Same class of mistake as the one `--reorder` had: the tool * knew something it was not telling the reader. * * `phrases.test.js` asserts this list matches the languages the dictionaries are * actually grouped under, so adding a dictionary without listing it — or listing * one without the entries — fails rather than misleads. */ export declare const PHRASE_LANGUAGES: readonly string[]; /** Long phrases and their shorter equivalent. */ export declare const VERBOSE_PHRASES: ReadonlyArray; /** Courtesy: adds nothing for the model and costs tokens on every call. */ export declare const POLITENESS: readonly string[]; /** Filler and throat-clearing with no content. */ export declare const FILLER: readonly string[]; /** Intensifiers: they rarely change the task and almost always add tokens. */ /** * Words that add emphasis and nothing else, so dropping one cannot change what * the prompt asks for. * * **A quantifier is not an intensifier**, and the distinction is not visible in * a dictionary translated word by word. Spanish gets `muy` and deliberately not * `mucho`; the first draft of the other five languages did not keep that line * and shipped `muito`, `molto` and `heel`, each of which does both jobs: * * Hai molto tempo per rispondere. → Hai tempo per rispondere. * * "You have much time" became "you have time". Caught by running the five * languages through the rules rather than by reading the list, and pinned by a * test that keeps those three words out. */ export declare const INTENSIFIERS: readonly string[]; /** Hedges that weaken the instruction without adding information. */ export declare const HEDGES: readonly string[]; /** * Self-verification instructions. * * On current models these trigger over-verification: the model already checks * its own work, and asking explicitly fires extra steps paid for in output * tokens. Aggressive level because some workflows do want explicit * verification. * * The full forms come first on purpose: removing only the core phrase would * leave a dangling fragment such as "Before answering." — worse than leaving * the sentence alone. * * That includes whatever introduces the instruction. "You MUST double-check * your answer before responding" reduced to "You must." for exactly this * reason: the phrase matched, the subject and modal in front of it did not, * and what survived was a sentence that says nothing. Anything that can open * one of these instructions belongs in the list, ahead of the bare form. */ export declare const SELF_CHECK: readonly string[]; /** Words shouted in capitals that cost fewer tokens in lowercase. */ export declare const SHOUTED_WORDS: readonly string[]; /** Emphasis prefixes at the start of a line. */ export declare const EMPHASIS_PREFIXES: readonly string[]; /** * Vocabulary suggesting the task needs a more capable model. * Multilingual for the same reason as the dictionaries above. */ export declare const COMPLEX_SIGNALS: readonly string[]; /** Vocabulary suggesting a cheaper model would do. */ export declare const SIMPLE_SIGNALS: readonly string[]; /** * Phrases that refer *backwards* to something earlier in the prompt, by language. * * These are what makes reordering unsafe. "Summarise the text above" is correct * where it sits and nonsense if moved in front of the text it points at, so a * block containing one of these must stay where it is — and so must everything * after it, because moving a later block past a pinned one changes their order * relative to each other. * * Deliberately generous. A false positive costs a saving that was available; a * false negative silently changes what the prompt asks for, which is the one * thing this project will not trade for tokens. * * **Grouped by language rather than kept as one flat list, because the flat list * hid a hole.** It held English and Spanish and was applied to every prompt, so * a French, German or Japanese author ran `--reorder` with no protection at all: * every refusal this module is built on silently did not apply to them, and * "Résumez le texte ci-dessus" was hoisted above the text and reported as a * saving. A list per language makes the coverage a thing you can look at, and * lets `UNCOVERED_SCRIPTS` below refuse what is still missing rather than * pretending. * * Every language is matched against every prompt. Language detection would be * one more thing to get wrong, and the cost of checking a French prompt for * German phrases is a missed saving, which is the direction this module errs in * anyway. */ export interface BackwardReferenceSet { /** * Whether a match must sit on a word boundary. * * True for anything written with spaces, so "aboveboard" does not pin a block. * False for Japanese and Chinese, which have no word boundaries at all — the * boundary test asks whether the neighbouring character is a letter, and in * 上記のテキスト it always is, so a boundary-matched CJK phrase would never * fire. A list that cannot match is worse than no list: it reads like cover. */ wordBoundaries: boolean; phrases: readonly string[]; } export declare const BACKWARD_REFERENCES_BY_LANGUAGE: Readonly>; /** * Every phrase, flattened. Kept for callers that only need the words. */ export declare const BACKWARD_REFERENCES: readonly string[]; /** * Scripts this module has no backward-reference phrases for. * * The point of naming them is that the alternative is what used to happen: * rearranging a Russian or Arabic prompt with nothing to stop it, and calling * the result a saving. `reorderForCache` refuses when it sees one of these, * which turns a silent hazard into a message somebody can act on — and into a * short list of pull requests, since adding a language is adding an array. * * Matched on the script, not the language: the question is not "which language * is this" but "is there any chance my phrase lists apply to it". */ export declare const UNCOVERED_SCRIPTS: ReadonlyArray<{ name: string; pattern: RegExp; }>; /** * Phrases that mark a block as the *output contract* rather than as data. * * Needed because a fenced JSON block in a prompt is one of two completely * different things, and confusing them is the one way this analysis could do * harm. `Output format: {...}` describes what the model must return, and a * provider that accepts a response schema takes it as a request parameter * instead — those tokens leave the prompt on every call. `Input: {...}` inside a * few-shot example is *data the prompt needs*, and advising anyone to move it * would break their prompt. * * Nothing here guesses. A schema block with no such phrase before it is left * alone, because "probably an output format" is not good enough when being wrong * costs somebody a working prompt. * * Seven languages, the same set the rules cover. A prompt in a language absent * here raises nothing, which is a false negative and states itself as one — the * alternative is matching an English cue inside Japanese prose and calling the * result a saving. */ export declare const OUTPUT_CUES_BY_LANGUAGE: Readonly>; /** Every output cue, flattened. Order is not significant. */ export declare const OUTPUT_CUES: readonly string[]; //# sourceMappingURL=phrases.d.ts.map