// THE AUTHORING RULES — written once, read by both sides (release 27, S5): // the MCP's plans for Claude Code (mcp/src/instructions.ts) and the generation // tasks a job runs (./tasks/). A rule changes here, and both follow. // // Prompts carry RULES, never worked examples: a local model copies an example // sentence verbatim (Q0, plans/local-llm-report-media.md). The narration // writing rules keep their examples for Claude Code (the README's "Writing // narration" is their source); `rulesForModel` strips them for a task's prompt. // ─── Narration (release 25, T5) ─── export const NARRATION_HARD_RULE = "Storytelling and emotion live in the delivery, never in the claims: every " + "factual statement stays exactly as the cited evidence supports — no invented " + "quotes, no motives or feelings attributed to real people, no intensifiers " + "that change a claim's strength."; export const NARRATION_WRITING_RULES = [ "Short sentences; fragments are fine (\"One file. No title. Just a date.\").", "\"...\" for a beat inside a sentence — at most one per sentence.", "An expressive tag (, , , …) only where a person would make that sound, " + "reacting to what was just said, at a sentence boundary — never mid-clause, never after a greeting; " + "one per paragraph at most.", "End a paragraph on a short punch or a rhetorical question.", "A quote gets its own sentence after a colon lead-in, never chained to its attribution.", ] as const; // The operator's house taste for generated narration (the stopgap's TASTE; // no tags at all — operator, 2026-10-11). export const NARRATION_TASTE = [ "Casual, concise and punchy; talk like a person, use contractions.", "No expressive tags or stage directions of any kind, nothing in angle brackets.", "No stock phrases or filler openers; start with the point.", "Every number and every name you use must already be in the evidence below; add no facts.", "Do not read quotes out; the clips that follow say them.", "The narrator is third person: never I, me, my, we, us or our, and never a speaker's words as your own.", "Keep every negation and hedge the evidence has; say what was said, not why.", ] as const; // A rule as a model's prompt takes it: no parenthesised example (a quoted // sentence, an `e.g.`, a list of tags). A rule about tags is dropped whole // when `tags` is false (generated narration carries none). export function ruleForModel(rule: string): string { return rule .replace(/\s*\((?:e\.g\.|for example)[^)]*\)/gi, "") .replace(/\s*\([^()]*["“”<][^()]*\)/g, "") .replace(/\s+([.;,])/g, "$1") .trim(); } export function rulesForModel(rules: readonly string[], opts: { tags?: boolean } = {}): string[] { return rules .filter((r) => opts.tags !== false || !/expressive tag|<[a-z]+>/i.test(r)) .map(ruleForModel) .filter(Boolean); } // ─── Reports (the sweep, its revisions) ─── // convertSweep makes every quoted span between the previous link and a link // THAT link's quote: a claim that quotes words breaks its own citation. export const CLAIM_QUOTES_RULE = "A claim never carries quotation marks or quoted words: every quoted span before a link becomes THAT " + "link's quote, so a claim that quotes words — another moment's or its own — breaks its citation. Put the " + "claim in plain words, then the quote, then its link."; export const VERBATIM_QUOTES_RULE = "Quote the transcript's words VERBATIM, copied from a tool result: never quote words you did not see, " + "never fix a transcript's spelling, grammar or names inside quotes, never join words from two moments " + "into one quote. A quote that is not word for word what was said within 90 seconds of its link is refused."; // A quote that stops mid-thought (release 28 Q2, lib/citations/fragment.ts) // is refused in code; the refusal carries the sentence to quote. export const WHOLE_SENTENCE_QUOTE_RULE = "Quote a whole sentence or clause: a quote under four words, or one that stops on a function word (an " + "article, a preposition, a conjunction, a possessive), is refused as a fragment."; export const ONE_QUOTE_PER_FINDING_RULE = "Each finding is a list item under a `## section`: the claim in plain words, the quoted words in double " + "quotes, then the citation link. One quote, one link per item."; export const POST_CITATION_RULE = "A post has no timeline: cite it as `[post by , ]()`, never with `@ mm:ss`."; export const REPORT_STYLE_RULE = "Plain, concise words. No hedged editorialising; the quotes carry it."; // The moment link a generated report cites a video with, on the article's // citation origin — built from the channel slug, the video id and the second, // never from a build's moment_base (null on a private build, FACTS). export function momentLinkRule(origin: string): string { return ( `Cite a video as \`[ @ mm:ss](${origin}/?v=<channel slug>%2F<video id>&t=<seconds>)\`: the ` + "moment_base a tool shows is already in that form, so append the line's integer second to it. Never cite a " + "video by its platform URL (YouTube and the like)." ); } export const COVERAGE_RULE = "End with a `## Coverage` section: the scope, N enumerated, how many you read, how many cited, and any " + "COVERAGE PARTIAL caveat."; // ─── The sweep's dumb extractor (the plan's subagent, as a tool) ─── export const EXTRACTOR_SYSTEM = "You are a DUMB EXTRACTOR for a transcript sweep. You get transcript excerpts and a directive. Return ONLY the " + "lines relevant to the directive, VERBATIM — never analyze, summarize, rephrase, merge or fix a line. Group the kept " + "lines per video as `### <title>`, then that video's `moment_base:` line copied exactly (or its `source:` line when " + "there is no moment_base), then the kept lines in their `[mm:ss|seconds]` form exactly as given. Keep a line or two " + "of context around a kept line when it is needed to know who is speaking or what is meant. Hard budget: at most 40 " + "lines (~600 words) for the batch — if more match, keep the strongest and end with `(+N more matching lines)`. " + "If nothing is relevant, return `(nothing relevant)`. Return nothing else."; // ─── Running unattended ─── export const UNATTENDED_RULE = "You are running UNATTENDED — no person is watching, and nobody can answer. Where a plan says to show " + "something or confirm, decide yourself, carry on, and note the decision in the report's summary. Never stop " + "to ask.";