/** * Canonical v0.5 LLM-judge rubric prompt. * * Per ADR-19 §1 (rubric design — 4 axes, 0-3 scale, worked-example * anchored) + §3 (anonymization, format-ignoring instruction, * anti-RLHF-bias discipline). Rubric DESIGN locked at Step 1; rubric * PROMPT TEXT commits here at Step 3 per F1 two-lock-point pattern. * * Two exported constants per Step 3 design lock: * - RUBRIC_PROMPT_SINGLE: single-mode framing + shared body. Used * by gradeSingle (Step 6 calibration; within-judge consistency * regrade; Travis-intuition correlation). * - RUBRIC_PROMPT_PAIRED: paired-mode framing + shared body. Used * by gradePair (Step 8 production grading; A/B comparison). * * Pre-composed (not built at runtime) per ADR-02 EXTRACTION_PROMPT * single-source-of-truth precedent. Callers import the mode-specific * constant explicitly; judge-client.ts treats rubricPrompt as opaque * input (no magic defaults). * * Anchor provenance (honest labeling per Step 3 design lock): * - "ALPHA H4 (real output)" + "CA H4 (real output)" inline are * verbatim alpha vs ca opening fragments from Phase 5 §5.1 * h4-validator-typeflow trial outputs. Real grading substrate. * - Axis 4 score-0 anchor is labeled "hypothetical-illustrative" * per ADR-19 §1: real v0.3+v0.4 trial outputs did not produce * score-0-level fabrication; the example shows what fabrication * detection would catch, not what was observed. Disclosed * transparently here AND in phase-9 reference doc. * - Phase 5 §3.3 h6-fetch-signature pattern referenced in Axis 3 * trick-bucket override; pattern description sufficient (no * verbatim quote — real h6 substrate too long for prompt body). * * Refinements to this canonical text require calibration evidence * parallel to v0.3 Step 9 docstring-prompt-calibration discipline. * Step 6 calibration ($10-25 envelope) is the canonical rubric's * empirical test. The prompt content, axis taxonomy, scale, and * anchor framing are frozen per ADR-19; call signatures and parsing * around it (in judge-client.ts) evolve with the harness. * * See: * - docs/adr/ADR-19-llm-judge-methodology.md (rubric design + §3 * anonymization + format-ignoring instruction verbatim) * - docs/adr/ADR-02-extraction-sole-api-caller.md (amended 2026-04-30 * to permit src/grading/ as second Anthropic API caller; single- * source-of-truth pattern this module mirrors) * - ContextAtlas-benchmarks/research/phase-5-reference-run.md §5.1 * (h4-validator-typeflow alpha vs ca opening fragments; rubric * anchor substrate provenance) + §3.3 (h6-fetch-signature * trick-bucket pattern; Axis 3 override anchor) */ /** * Single-mode canonical rubric prompt — framing prefix + body + schema. * * Used by gradeSingle for Step 6 calibration. Token budget: ~730. * Pre-composed; do not construct at runtime. */ export declare const RUBRIC_PROMPT_SINGLE = "You will grade an answer against a rubric. Score substance, not\npresentation.\n\nCRITICAL: ignore all of the following \u2014 none are quality signals:\nmarkdown formatting choices; length alone (a tightly-precise short\nanswer can score equal to a thoroughly-explained long answer);\ntone, voice, formality, hedging style; whether file references are\ninline or grouped; whether ADR references appear in prose or block\nquotes.\n\nEvaluate substance against the rubric: factual correctness;\ncompleteness; actionability; hallucination. Score each axis 0-3\nper the rubric anchors.\n\nRUBRIC\n\nScore the answer on four axes, each 0-3. The four axes isolate\ndistinct quality failure modes; score each independently.\n\nAXES:\n1. factual_correctness: Are asserted facts about the code or\n architecture accurate?\n2. completeness: Does the answer cover the prompt's actual scope?\n3. actionability: Can the user proceed from this answer toward the\n change or understanding the prompt asks for?\n4. hallucination: Does the answer assert specific items (files,\n symbols, ADRs, line numbers) that don't exist?\n\nWORKED ANCHORS (Phase 5 h4-validator-typeflow real output substrate):\n\nThe two fragments below are verbatim opening lines from real Phase\n5 \u00A75.1 trial outputs. Both are answering the same prompt: how does\na validator's type flow through a handler's c.req.valid() and on\nto the RPC client?\n\nALPHA H4 (real output):\n\"Using a validator (e.g. `@hono/zod-validator`'s `zValidator` or\nthe reference implementation in `src/validator/validator.test.ts:\n36-61`) attaches types that flow from the schema \u2192 handler's\n`c.req.valid()` \u2192 RPC client. Here's the chain:\"\n\nCA H4 (real output):\n\"The whole system is governed by **ADR-04** (documented in the\nintent registry): the type-inference chain from route registration\n\u2192 handler Context \u2192 typed client must be preserved end-to-end,\nwith no codegen.\"\n\nBoth fragments are score 3 on factual_correctness AND score 3 on\nhallucination \u2014 every asserted item (file:line in ALPHA H4; ADR-04\nin CA H4) is verifiable. They DIFFER on actionability: CA H4 names\nthe governing constraint (ADR-04); ALPHA H4 describes the mechanism\nwithout architectural framing. Per-axis anchors below reference\nthese fragments by label.\n\nPER-AXIS SCALE ANCHORS:\n\n[axis 1: factual_correctness]\n0 = absent or wrong: asserts facts that contradict the codebase or\n referenced ADRs.\n1 = partial: some correct facts mixed with errors; key claims\n undermined by inaccuracies.\n2 = mostly correct: claims accurate but with one minor inaccuracy\n or unsupported inference.\n3 = exemplary: like ALPHA H4 (cites verifiable file:line) OR like\n CA H4 (names verifiable ADR-04). All asserted facts verifiable.\n\n[axis 2: completeness]\n0 = misses central thing: prompt's primary question unaddressed.\n1 = major omissions: covers a fragment but leaves the prompt's\n primary scope unanswered.\n2 = minor gaps: covers main scope; one secondary aspect\n underspecified.\n3 = full coverage: CA H4 demonstrates the architectural framing;\n full coverage requires both the architectural anchor AND the\n mechanical flow (route registration \u2192 handler Context \u2192 typed\n client \u2192 end-to-end with no codegen). Prompt scope fully\n addressed on both substantive dimensions.\n\n[axis 3: actionability]\n0 = no concrete pointers: vague guidance without actionable handles\n (no files, no symbols, no governing constraints).\n1 = vague: gestures at next steps without naming specific files,\n symbols, or constraints the user can act on.\n2 = concrete but missing why: like ALPHA H4 (concrete file:line\n pointers; describes mechanism without governing constraint\n framing).\n3 = concrete + governing constraint cited: like CA H4 (file or\n symbol references PLUS named governing ADR or architectural\n constraint that explains why).\n\nTRICK-BUCKET OVERRIDE (axis 3): For trivial-lookup prompts (e.g.,\n\"what is the signature of X?\" \u2014 h6-fetch-signature pattern from\nPhase 5), score actionability \u2264 1 if the answer carries irrelevant\nADR context that buries the lookup answer in over-extraction. A\nfactually-correct-but-bloated answer must NOT score 3 on\nactionability; the over-extraction failure mode is what this\noverride surfaces.\n\n[axis 4: hallucination]\n0 = \u22652 fabrications (HYPOTHETICAL-ILLUSTRATIVE \u2014 real v0.3+v0.4\n trial outputs did not produce this level; example below shows\n what fabrication detection would catch, not what was observed):\n e.g., \"as documented in ADR-99\" when ADR-99 doesn't exist;\n \"see `validator.fabricatedMethod()` at line 142\" when no such\n symbol or line exists.\n1 = one fabrication: a single specific item (file path, line\n number, ADR reference, symbol name) asserted that doesn't\n exist in the codebase or ADR set.\n2 = slight overclaim: marginal extension beyond what evidence\n supports without explicit fabrication of specific items.\n3 = all references verifiable: like ALPHA H4 (real file:line) OR\n like CA H4 (real ADR-04 referenced). No fabricated items.\n\nEDGE CASES:\n\nTruncated outputs: score what shipped. Truncation IS a quality\nfailure mode \u2014 typically lowers completeness, may lower\nactionability. Do not infer-and-fill on truncated content.\n\nNon-English content: out of v0.5 scope. Flag in notes if\nencountered; score conservatively without full grading.\n\nFormat anomaly (markdown wrapping where unexpected; mixed\nprose/code; unusual structure): handled by the format-ignoring\ninstruction in the framing above. Score substance, not\npresentation.\n\nPartial-right + partial-wrong: axes are scored INDEPENDENTLY. A\nvague-but-correct answer scores high on factual_correctness and\nhigh on hallucination, low on actionability. Do not average across\naxes.\n\nNo-answer / honest refusal (\"I don't know without more context\"):\nscore factual_correctness 3 (refused honestly; no false claims);\nhallucination 3 (no fabrication); completeness 0 (no scope\ncoverage); actionability 0 or 1 depending on whether the refusal\npoints at what additional context would help.\n\nTied outputs: no special handling. The 4-axis rubric IS the\ninstrument designed to surface ties at the call/token efficiency\nlayer with quality differences underneath (per ADR-19 \u00A71). Apply\nper-axis criteria as written; if substance genuinely matches, the\nscores match.\n\nOUTPUT FORMAT:\n\nOutput ONLY a JSON object with exactly four keys mapping to\ninteger 0-3. No prose, no markdown fencing, no commentary.\n\nSchema:\n{\"factual_correctness\": 0|1|2|3, \"completeness\": 0|1|2|3, \"actionability\": 0|1|2|3, \"hallucination\": 0|1|2|3}"; /** * Paired-mode canonical rubric prompt — framing prefix (ADR-19 §3 * verbatim) + body + paired schema. * * Used by gradePair for Step 8 production grading. Token budget: * ~780. Includes the "do not invent distinctions to break ties" * anti-RLHF discipline (paired-mode-specific; protects the rubric's * primary tied-outputs purpose per ADR-19 §1). * * Pre-composed; do not construct at runtime. */ export declare const RUBRIC_PROMPT_PAIRED = "You will grade two answers (presented as A and B) against a\nrubric. Both answers respond to the same prompt; they may use\ndifferent formatting, phrasing, or structure. Score substance,\nnot presentation.\n\nCRITICAL: ignore all of the following \u2014 none are quality signals:\nmarkdown formatting choices; length alone (a tightly-precise short\nanswer can score equal to a thoroughly-explained long answer);\ntone, voice, formality, hedging style; whether file references are\ninline or grouped; whether ADR references appear in prose or block\nquotes.\n\nEvaluate substance against the rubric: factual correctness;\ncompleteness; actionability; hallucination. Score each axis 0-3\nper the rubric anchors.\n\nIf A and B are substantively equivalent, score them equally \u2014 do\nnot invent distinctions to break ties.\n\nRUBRIC\n\nScore each answer on four axes, each 0-3. The four axes isolate\ndistinct quality failure modes; score each independently.\n\nAXES:\n1. factual_correctness: Are asserted facts about the code or\n architecture accurate?\n2. completeness: Does the answer cover the prompt's actual scope?\n3. actionability: Can the user proceed from this answer toward the\n change or understanding the prompt asks for?\n4. hallucination: Does the answer assert specific items (files,\n symbols, ADRs, line numbers) that don't exist?\n\nWORKED ANCHORS (Phase 5 h4-validator-typeflow real output substrate):\n\nThe two fragments below are verbatim opening lines from real Phase\n5 \u00A75.1 trial outputs. Both are answering the same prompt: how does\na validator's type flow through a handler's c.req.valid() and on\nto the RPC client?\n\nALPHA H4 (real output):\n\"Using a validator (e.g. `@hono/zod-validator`'s `zValidator` or\nthe reference implementation in `src/validator/validator.test.ts:\n36-61`) attaches types that flow from the schema \u2192 handler's\n`c.req.valid()` \u2192 RPC client. Here's the chain:\"\n\nCA H4 (real output):\n\"The whole system is governed by **ADR-04** (documented in the\nintent registry): the type-inference chain from route registration\n\u2192 handler Context \u2192 typed client must be preserved end-to-end,\nwith no codegen.\"\n\nBoth fragments are score 3 on factual_correctness AND score 3 on\nhallucination \u2014 every asserted item (file:line in ALPHA H4; ADR-04\nin CA H4) is verifiable. They DIFFER on actionability: CA H4 names\nthe governing constraint (ADR-04); ALPHA H4 describes the mechanism\nwithout architectural framing. Per-axis anchors below reference\nthese fragments by label.\n\nPER-AXIS SCALE ANCHORS:\n\n[axis 1: factual_correctness]\n0 = absent or wrong: asserts facts that contradict the codebase or\n referenced ADRs.\n1 = partial: some correct facts mixed with errors; key claims\n undermined by inaccuracies.\n2 = mostly correct: claims accurate but with one minor inaccuracy\n or unsupported inference.\n3 = exemplary: like ALPHA H4 (cites verifiable file:line) OR like\n CA H4 (names verifiable ADR-04). All asserted facts verifiable.\n\n[axis 2: completeness]\n0 = misses central thing: prompt's primary question unaddressed.\n1 = major omissions: covers a fragment but leaves the prompt's\n primary scope unanswered.\n2 = minor gaps: covers main scope; one secondary aspect\n underspecified.\n3 = full coverage: CA H4 demonstrates the architectural framing;\n full coverage requires both the architectural anchor AND the\n mechanical flow (route registration \u2192 handler Context \u2192 typed\n client \u2192 end-to-end with no codegen). Prompt scope fully\n addressed on both substantive dimensions.\n\n[axis 3: actionability]\n0 = no concrete pointers: vague guidance without actionable handles\n (no files, no symbols, no governing constraints).\n1 = vague: gestures at next steps without naming specific files,\n symbols, or constraints the user can act on.\n2 = concrete but missing why: like ALPHA H4 (concrete file:line\n pointers; describes mechanism without governing constraint\n framing).\n3 = concrete + governing constraint cited: like CA H4 (file or\n symbol references PLUS named governing ADR or architectural\n constraint that explains why).\n\nTRICK-BUCKET OVERRIDE (axis 3): For trivial-lookup prompts (e.g.,\n\"what is the signature of X?\" \u2014 h6-fetch-signature pattern from\nPhase 5), score actionability \u2264 1 if the answer carries irrelevant\nADR context that buries the lookup answer in over-extraction. A\nfactually-correct-but-bloated answer must NOT score 3 on\nactionability; the over-extraction failure mode is what this\noverride surfaces.\n\n[axis 4: hallucination]\n0 = \u22652 fabrications (HYPOTHETICAL-ILLUSTRATIVE \u2014 real v0.3+v0.4\n trial outputs did not produce this level; example below shows\n what fabrication detection would catch, not what was observed):\n e.g., \"as documented in ADR-99\" when ADR-99 doesn't exist;\n \"see `validator.fabricatedMethod()` at line 142\" when no such\n symbol or line exists.\n1 = one fabrication: a single specific item (file path, line\n number, ADR reference, symbol name) asserted that doesn't\n exist in the codebase or ADR set.\n2 = slight overclaim: marginal extension beyond what evidence\n supports without explicit fabrication of specific items.\n3 = all references verifiable: like ALPHA H4 (real file:line) OR\n like CA H4 (real ADR-04 referenced). No fabricated items.\n\nEDGE CASES:\n\nTruncated outputs: score what shipped. Truncation IS a quality\nfailure mode \u2014 typically lowers completeness, may lower\nactionability. Do not infer-and-fill on truncated content.\n\nNon-English content: out of v0.5 scope. Flag in notes if\nencountered; score conservatively without full grading.\n\nFormat anomaly (markdown wrapping where unexpected; mixed\nprose/code; unusual structure): handled by the format-ignoring\ninstruction in the framing above. Score substance, not\npresentation.\n\nPartial-right + partial-wrong: axes are scored INDEPENDENTLY. A\nvague-but-correct answer scores high on factual_correctness and\nhigh on hallucination, low on actionability. Do not average across\naxes.\n\nNo-answer / honest refusal (\"I don't know without more context\"):\nscore factual_correctness 3 (refused honestly; no false claims);\nhallucination 3 (no fabrication); completeness 0 (no scope\ncoverage); actionability 0 or 1 depending on whether the refusal\npoints at what additional context would help.\n\nTied outputs: no special handling. The 4-axis rubric IS the\ninstrument designed to surface ties at the call/token efficiency\nlayer with quality differences underneath (per ADR-19 \u00A71). Apply\nper-axis criteria as written; if substance genuinely matches, the\nscores match.\n\nOUTPUT FORMAT:\n\nOutput ONLY a JSON object with exactly two keys \"A\" and \"B\", each\nmapping to an object with the four axis keys mapping to integer\n0-3. No prose, no markdown fencing, no commentary.\n\nSchema:\n{\"A\": {\"factual_correctness\": 0|1|2|3, \"completeness\": 0|1|2|3, \"actionability\": 0|1|2|3, \"hallucination\": 0|1|2|3}, \"B\": {\"factual_correctness\": 0|1|2|3, \"completeness\": 0|1|2|3, \"actionability\": 0|1|2|3, \"hallucination\": 0|1|2|3}}"; //# sourceMappingURL=rubric-prompt.d.ts.map