generate-evidence-directive.ts
32 lines · scripts/resolvers/preamble/generate-evidence-directive.ts at 3f79d81
1import type { TemplateContext } from '../types';
3/**
4 * Claims Need Evidence: the preamble's honesty kernel (fork port wave 2, D1;
5 * extended by docs/designs/HONEST_WORK_GATE_INTEGRITY.md W4).
6 *
7 * Started as one directive: a claimed limitation ("the API can't do this")
8 * needs the verbatim error, documented statement or live probe, because nine
9 * App Store release failures in two days shared that one root. W4 widened it
10 * to a five-bullet kernel covering claimed executions, evidence kinds, failure
11 * disclosure and null results. It is a correctness rule, not prose style, so
12 * it renders for every tier that composes it (2–4) and for `terse` builds;
13 * tier 1 skills have no evidence claim to make. The bullets stay at or under
14 * KERNEL_MAX_BYTES; test/honesty-kernel.test.ts pins that budget.
15 */
16export const KERNEL_MAX_BYTES = 800;
18export const EVIDENCE_KERNEL_HEADING = '## Claims Need Evidence';
20export const EVIDENCE_KERNEL_BULLETS = [
21 'A claimed limitation ("the API can\'t", "X needs a credential") needs the verbatim error, documented statement or live probe; probe before asking or blocking.',
22 'A claimed execution ran and you saw its result: name the command and the revision or content fingerprint; never cite a command whose stderr was silenced.',
23 'State the evidence kind (static read, unit test, fixture/replay, live run, production) and never pass one off as another: a mock is not a live check.',
24 'Disclose any failure or missing coverage that would change the reader\'s conclusion; "done, unverified" is not "done".',
25 'A checked null result ("ran X, found nothing material") is a success; an unsupported positive claim is worse than silence. Agreeing agents, or repeated reads of one source, are one datum.',
26] as const;
28export function generateEvidenceDirective(_ctx?: TemplateContext): string {
29 return `${EVIDENCE_KERNEL_HEADING}
31${EVIDENCE_KERNEL_BULLETS.map(bullet => `- ${bullet}`).join('\n')}`;
32}