// What digest-context.spec.ts reviews (lib/digestContextReview.mjs; the page // /tools/digest-context): two candidate channel context notes in the fixture's // corpus -- testchan and testchan-odysee, channels make-fixture.mjs already // makes, so no other spec's channel count moves -- and a plan file of the real // one's shape (plans/digest-context-review.md) naming their evidence, which the // app reads through E2E_DIGEST_CONTEXT_PLAN. Never the real corpus or plan. import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import path from "node:path"; export const DIGEST_NOTES = { testchan: "This channel belongs to Test Host, who streams alone.\n\nRecurring segments:\n\n- \"Test News\" — a news-reaction segment\n", "testchan-odysee": "The Odysee mirror of testchan: the same streams, re-uploaded.\n", }; export const DIGEST_PLAN = `# Channel context notes — candidates awaiting review (fixture) ## Why these channels, in this order | # | Channel | Chunks remaining | Note | | ---: | --- | ---: | --- | | 1 | \`testchan\` | 1,234 | drafted | | 2 | \`testchan-odysee\` | 56 | drafted | ## Evidence behind each note ### \`testchan\` — **check this one first** - **Claims the host streams alone.** Rests on: "Test Host" in 150/150 descriptions. - "Test News" in 12 of 150 titles. ### \`testchan-odysee\` - Same streams as \`testchan\`: 40 of 50 titles match. ## What to check before promoting 1. **Identity claims** — testchan = Test Host's channel. 2. **Cast lists** — a one-off guest listed as a regular. ## What promoting one costs, and how to tell it worked Promoting a note changes that channel's \`contextHash\`, so **every digest already generated for that channel becomes stale and regenerates.** `; /** Write (or put back) the two notes and the plan; nothing decided. */ export function makeDigestContextFixture({ dest, channels }) { for (const [slug, text] of Object.entries(DIGEST_NOTES)) { const dir = path.join(channels, slug); mkdirSync(dir, { recursive: true }); for (const f of ["digest-context.md", "digest-context.suggested.refused.json"]) rmSync(path.join(dir, f), { force: true }); writeFileSync(path.join(dir, "digest-context.suggested.md"), text); } const plan = path.join(dest, "digest-context-review.md"); writeFileSync(plan, DIGEST_PLAN); return { plan }; }