agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
70 lines • 3.9 kB
TypeScript
/**
* phrases — the prose grammar's CLOSED phrase packs: data, versioned and hashed.
*
* Pattern: plain frozen data. The matcher (`matcher.ts · matchPhrase`) is the only code that reads
* it, and the hash pins every number measured with it to the grammar it measured
* (`bench/negative/RULE.md`).
* Role: integrity/ layer (L3), read by `detect.ts` (claims, code and language notes) and
* `containment.ts` (source and window markers, unbounded words), and by the free
* replay (`bench/negative/`). The answer bench keeps its own registered readers, frozen;
* the hedge and source packs began as its lists.
*
* A phrase is a list of SLOTS matched against consecutive tokens of one unit, with only spaces
* between them (so "No, the deploy…" is not "no the"):
* - `a|b|c` — one token, any of the alternatives (tokens are NFC, case-folded);
* - a trailing `?` — the slot may be skipped;
* - `<word>` — any token that starts with a letter;
* - `!a|b` — any letter token EXCEPT these;
* - `<num>` — digits, or a number word (`two` … `twenty`);
* - `<dur>` — a look-back spelling (`24h`, `7d`);
* - `^` — only at the start of the unit (first slot only).
*
* The packs:
* - `none` and `complete` — the CLAIMS: non-existence, and completeness in a frame only
* (never a bare "every" or "zero");
* - `unbounded` — words that make any claim wider than any search ("never", "anywhere");
* - `source` — words that put the negative on the lookup ("the lookup returned nothing"),
* which scope a claim to the source, as a `source.said` word does;
* - `window` — the window a claim names ("in the last 2 hours");
* - `hedge` — words that voice doubt. They are NOT scope: a hedged claim is still a flat claim
* (design § 5.2). The pack exists so that law is data a test can walk.
*/
/** One phrase: an id (`<pack>.<name>`) and its slots. */
export interface ClaimPhrase {
readonly id: string;
readonly words: readonly string[];
/** App extensions are literal tokens, never the built-in slot language. */
readonly literal?: true;
}
/** The six packs, by name. */
export interface NegativeClaimPhrasePacks {
readonly none: readonly ClaimPhrase[];
readonly complete: readonly ClaimPhrase[];
readonly unbounded: readonly ClaimPhrase[];
readonly source: readonly ClaimPhrase[];
readonly window: readonly ClaimPhrase[];
readonly hedge: readonly ClaimPhrase[];
}
/** Bump with ANY edit to the packs or to what a slot means — the test pins version → hash. */
export declare const NEGATIVE_CLAIM_PHRASES_VERSION = "1";
/** The built-in packs — closed and frozen, independent of app extensions. */
export declare const NEGATIVE_CLAIM_PHRASES: NegativeClaimPhrasePacks;
/** sha256 of the packs' stable JSON — what a measured number names. */
export declare const NEGATIVE_CLAIM_PHRASES_HASH: string;
/** Additional literal negative phrases. These extend observation only, never enforcement. */
export interface NegativeClaimPhraseExtensions {
readonly none?: readonly string[];
readonly complete?: readonly string[];
}
/** @internal Validated, detached and frozen effective phrase packs. */
export interface ResolvedNegativeClaimPhrases {
readonly packs: NegativeClaimPhrasePacks;
readonly version: string;
readonly hash: string;
}
/** Resolve at configuration time. At most 32 literal phrases of 128 UTF-16
* units each; regexes and the built-in slot DSL are rejected as patterns.
* The full effective-pack hash names any extension without changing the
* built-in version/hash or introducing executable predicates. */
export declare function resolveNegativeClaimPhrases(extensions?: NegativeClaimPhraseExtensions): ResolvedNegativeClaimPhrases;
//# sourceMappingURL=phrases.d.ts.map