|
1 | 1 | import { createHash } from "node:crypto"; |
2 | | -import { renderSessionReferencesBlock, selectSeeds, type ReferenceCompartment } from "../../src/hooks/magic-context/reference-retrieval"; |
| 2 | +import { renderSessionRefCompartment, selectSeeds, type ReferenceCompartment } from "../../src/hooks/magic-context/reference-retrieval"; |
3 | 3 | import { REFERENCE_SEEDS } from "../../src/hooks/magic-context/reference-seeds.generated"; |
4 | 4 | import { isNoContentCompartment } from "../../src/features/magic-context/no-content-compartment"; |
5 | 5 |
|
@@ -59,9 +59,9 @@ export function selectD(history: HistoricalReference[], session: string, start: |
59 | 59 | } |
60 | 60 | export function variantD(prompt: string, history: HistoricalReference[], session: string, start: number) { |
61 | 61 | const selected = selectD(history, session, start); |
62 | | - // The production renderer caps a whole block at six. Render one at a time |
63 | | - // to preserve its escaping/tier behavior while admitting D's seven refs. |
64 | | - const body = selected.references.map(c => renderSessionReferencesBlock([c]).replace(/^<session_references>\n|\n<\/session_references>$/g, "")).join("\n\n"); |
| 62 | + // D as trialled showed importance on all seven references. Render each with |
| 63 | + // the production per-compartment renderer (escaping and tiers), scores on. |
| 64 | + const body = selected.references.map(c => renderSessionRefCompartment(c, true)).join("\n\n"); |
65 | 65 | const seeds = `<compartment_examples_from_other_projects>\n${selected.seeds.map(s => s.block).join("\n\n")}\n</compartment_examples_from_other_projects>`; |
66 | 66 | // Callback replacement preserves literal $& / $` strings in historical code. |
67 | 67 | return { prompt: prompt.replace(/<compartment_examples_from_other_projects>[\s\S]*?<\/compartment_examples_from_other_projects>/, () => seeds).replace(/<session_references>[\s\S]*?<\/session_references>/, () => `<session_references>\n${body}\n</session_references>`), selected }; |
|
0 commit comments