open-agreements
Version:
Open-source legal template filling CLI and library
33 lines • 1.71 kB
TypeScript
/**
* Shared advice-language guard for every memo family.
*
* A memo is operational information about template fields and cited sources —
* it is not legal advice. Every memo family reuses these rules so a new family
* cannot ship with a weaker guard than the employment memo that established
* them. `applyAdviceLanguageGuard` rewrites prescriptive phrasing; the memo
* generators then assert with `hasProhibitedAdviceLanguage` that nothing
* prescriptive survived into the emitted artifact.
*/
export declare function applyAdviceLanguageGuard(input: string): string;
export declare function hasProhibitedAdviceLanguage(input: string): boolean;
/**
* Every string reachable in a finished memo artifact, including the ones the
* fill supplied verbatim.
*
* Enumerating sections by hand is how prohibited language escaped once already:
* a citation echoed back from a field value was emitted but never checked. This
* walks the artifact instead, so a section added later is covered without anyone
* remembering to add it to a list.
*/
export declare function collectEmittedStrings(value: unknown, out?: string[]): string[];
/**
* Throw if any emitted memo string carries prescriptive advice language.
*
* A value the fill supplied verbatim is REJECTED rather than rewritten: silently
* editing a citation would misquote the record it names, which is worse than
* refusing to emit it.
*/
export declare function assertNoProhibitedAdviceLanguage(texts: readonly string[]): void;
/** Assert over every string reachable in the finished artifact. */
export declare function assertMemoArtifactHasNoProhibitedAdviceLanguage(memo: unknown): void;
//# sourceMappingURL=advice-language.d.ts.map