UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

47 lines • 2.61 kB
/** * search/statementText — the rule for declaration text that can reach a * statement the library writes (`statement-text-refused`). * * Pattern: one pure rule, asked by `declaration.ts` at `defineTool` (an * ERROR: `search` is a new API, so no consumer breaks), over the ONE * list of texts that reach a statement (`statementTextsOf`). * Role: semantics/ layer, pure. * Emits: N/A. * * A declaration is untrusted text from the tool author, and a statement of a * negative claim is built from it — the source, the subject, each fixed * qualifier and default as `name: value`, each argument's name, each gap's * `what` and `why`. Three layers hold it, and only the last is the boundary: * * 1. SHAPE — one line of at most {@link MAX_STATEMENT_TEXT} characters, in a * stated character class: letters, combining marks, digits, spaces and * `. , : ; ' ( ) - _ / & % + # @`. No format character (zero-width, a * bidi override), no control, no quote mark, backtick or bracket a * renderer could be broken out of. * 2. A HEURISTIC — the instruction phrases ("do not", "always", "tell the * user", …), scanned after NFKC folding with format characters removed, * so a fullwidth or zero-width-split phrase is caught. A denylist is * never complete (confusables pass it); it catches the honest mistake. * 3. THE BOUNDARY — the statement renders declaration text as QUOTED DATA * ATTRIBUTED TO THE TOOL, never as library-authored prose: * `source (as the tool names it): "the incident store"`. Whatever the * words say, the person reads them as the tool's, in quotes. The * statement writer (the negative-claim checker's `statement.ts`) owns * that rendering; this rule only bounds what it is handed. */ /** The longest declaration text a statement carries. */ export declare const MAX_STATEMENT_TEXT = 120; /** * The instructing phrases — the design's `declaration-instructs` list, plus * the plain imperatives a model obeys. Matched case-folded, on whole words, * after NFKC folding (layer 2: a heuristic, not the boundary). */ export declare const STATEMENT_INSTRUCTION_PHRASES: readonly string[]; /** The instructing phrase `text` carries, or `undefined`. */ export declare function instructionIn(text: string): string | undefined; /** * Why `text` (declared under `field`) cannot reach a statement, or * `undefined` when it can. */ export declare function statementTextProblem(field: string, text: string): string | undefined; //# sourceMappingURL=statementText.d.ts.map