/** * The shape in the command that the gate's parser could not resolve. * * These are FORMS, not judgements — nothing here says a command is dangerous, and nothing here is a * rating. They exist to select the sentence the rater is shown. */ export type AbstentionMechanism = /** A git commit carrying an inline message that contains an executing substitution. */ 'commit-message-substitution' /** More than one command: `;`, `&`, `&&`, `|`, `||`, or a line break. */ | 'composition' /** Command / variable / process substitution: `$(…)`, backticks, `${…}`, `<(…)`. */ | 'substitution' /** A stream redirect: `>`, `>>`, `<`, `2>`, `&>`. */ | 'redirect' /** None of the above — an unbalanced quote, an empty command, or no resolvable program name. */ | 'unparseable'; /** What the parser saw in a command it could not resolve: the shapes, and the note for each. */ export interface AbstentionDefect { /** The most specific mechanism found — what the note leads with. */ mechanism: AbstentionMechanism; /** Every mechanism found, in note order. A command may carry more than one. */ mechanisms: AbstentionMechanism[]; /** One note per mechanism, in the same order. Never empty. */ notes: string[]; } /** * **The per-family note text — one distinct string per {@link AbstentionMechanism}.** * * Typed as a total `Record`, so adding a mechanism is a COMPILE ERROR until someone writes its * sentence. A family that silently fell back to another family's note would be the failure this * table exists to prevent: [[QA-17]] measured that the note's effect is family-specific, and * `docs/test-sessions/qa-17-substitution-note-2026-08-03/` records a narrowing by family name that * was FALSIFIED — `gh pr comment 42 --body "…"` carrying an executing substitution classifies as * generic `substitution`, and three of three hosted raters called it safe unassisted. * * Every entry states a fact about what THE SHELL does, and then asks a question. Neither is a * verdict about the command in front of the rater, which is what keeps the note neutral while still * carrying the mechanism that the measurement showed is load-bearing. */ export declare const MECHANISM_NOTES: Readonly>; /** * Classify a command the gate's parser could not resolve, or return `null` when it resolves. * * **The `null` arm is the guard, and it is structural on purpose.** Every mechanism below is a * regex, and `unparseable` is the fallback — so without this gate the function would classify `ls * -la` as `unparseable` and a note would be attached to every command in the session. The predicate * is {@link classifyCommand}'s own, not a second reading of it, so the note appears on exactly the * set of commands the gate could not resolve and on no others. * * Detection runs on the NORMALIZED command (the same form `classifyCommand` refused), so obfuscation * that the normalizer collapses cannot hide a mechanism from the note — while the command shown to * the rater stays the one the rater is being asked about, fenced by its own caller. * * The line-break check reads the RAW command, exactly as `classifyCommand` does: the normalizer is * not required to preserve that separator, and EXT-55 is the node about what happens when a caller * assumes it did. * * **Order is note order, most specific first**, and `commit-message-substitution` SUPPRESSES the * generic substitution note it is a special case of — telling the rater the same thing twice about * one `$(…)` spends attention on a repetition. * * @param command The raw command string as the model proposed it. * @returns What the parser saw, or `null` when the command's target statically resolves. */ export declare function describeAbstention(command: string): AbstentionDefect | null; /** * The opening line of the preflight note: **what this is, and what it is not.** * * It says the finding is about OUR PARSER rather than about the command, and that nothing has been * judged. Both halves are load-bearing. The first stops the rater reading the note as a report of * something found — the failure mode a bare observation produced, where a rater treats our * uncertainty as evidence and either inflates or explains it away. The second is what keeps this * note out of the open-world note's register: that one may say the command *"has ALREADY been * floored deterministically and will be shown to the user whatever you return"*, and here that * sentence would simply be false. */ export declare const PARSER_NOTE_PREAMBLE: string; /** * Build the neutral preflight note for a command, or `null` when the gate resolved it. * * One note per mechanism the command carries, most specific first, bulleted when there is more than * one — a command can compose AND substitute AND redirect, and a note that mentioned only the first * would leave the rater reasoning about a fragment of the shape. * * @param command The raw command string as the model proposed it. */ export declare function buildParserPreflightNote(command: string): string | null;