Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(notes): summarise a plain-text transcript with checklist action items (#2666) (#2815)

Joshua8924df30c498
diff --git a/CLAUDE.md b/CLAUDE.md
index e07b8b40d..fd21d21a7 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -782,6 +782,7 @@ Rows in the `actions` table (built-ins seeded from `src/helpers/builtinActions.j
- **Templates** (`kind: 'template'`) write a note's AI summary (`enhanced_content`) from its notes, meeting context, and transcript, never from the summary they replace. A template is a context (`prompt`) plus ordered `sections` (`{heading, instruction}`); `compileTemplatePrompt` wraps sections in the shared notes rules. A template without sections keeps the request it always had after the `SOURCE_FIDELITY_RULE` prefix (the generic system prompt, or the material preamble for a standalone key). The note records the template in `enhancement_template_id` (its `client_id`), which syncs with the note, and `enhancement_prompt` the compiled system prompt
- **Actions** (`kind: 'action'`) work from the AI summary when the note has one, and from its notes and transcript otherwise (`buildNoteRunInput`). Only the built-in Make notes shorter (`shorten`) and Make notes longer (`lengthen`) actions edit that summary, selected by fixed built-in identity (`toActionItem`), never an editable name or stored `output`. A summary edit requires complete output, never splits into parts, and writes only `enhanced_content`; with no summary yet it writes one from the transcript and applies the action to it, run like a template (split into parts on a local model, the material hash recorded); every other built-in and custom action, including Write TL;DR (`addTldr`), runs in the note chat via `SendToAIOptions.requestText` (the chat shows a built-in's call to action where it has one, otherwise the action's name, and the preamble points the model at the summary or the transcript and has it answer in the chat as text in the note's language, using a tool to draft, send or post only when the action's instructions explicitly ask to send, post or file something, and leaving the note unchanged, with an asked-for edit written in the chat instead; its turn is never offered `update_note` (`keepNotesUnchanged`), so it can't change a note whatever the model decides; the note chat's other tools and attendee block otherwise apply as usual, and its transcript context names speakers only on notes known to be the user's own (`ownsNote`), never listing the unfiltered invitees)
+- **The material picks the wrapper** (`runNoteAction`): speaker segments make a meeting (`isMeetingNote`: `MEETING_SYSTEM_PROMPT` or `MEETING_INPUT_PREAMBLE`, the `## Meeting Context` block and `Speaker: text` lines); a transcript in plain text (a recording that captured no segments, one made before 1.6.6, or an upload's text when its provider returned no segments, which is saved as the note's content) is its own case (`hasPlainTranscript`: `PLAIN_TRANSCRIPT_SYSTEM_PROMPT` or `PLAIN_TRANSCRIPT_INPUT_PREAMBLE`, #2666), with no Meeting Context since nothing shows who is speaking, a part prompt without speaker labels when a local model splits it, and action items as `- [ ] Action — Owner` lines with an owner or deadline only when the transcript or the user's notes state it, never a placeholder, and never a table unless the instructions ask for one; no transcript is a personal note (`BASE_SYSTEM_PROMPT` or `NOTE_INPUT_PREAMBLE`). Both transcript cases get the custom dictionary, and their known people (the user, the invitees, and a meeting's named speakers) turn matching owners into mentions (`tagActionItemOwners`)
- The default template is the built-in AI Summary (the generic prompt, stored under the old Generate Notes key `generateNotes`), listed first, then Detailed Notes (launch re-applies the built-in order). Invariant: Detailed Notes, compiled from its sections, equals the flat 1.10.2 prompt it replaced after the `SOURCE_FIDELITY_RULE` prefix used by templates and summary actions (`sourceFidelity.js`), but for the closing rule on material with nothing to summarize (`test/helpers/templatePrompts.test.js`); a built-in's `previousPrompts` only upgrades rows that are still flat. Chat actions get the rule once, from the chat system prompt (`getAgentSystemPrompt`), and the Cloud request leaves out the leading system message that repeats `systemPrompt`, which the API prepends itself
- For material with nothing substantive (only greetings, filler or recording checks), sectioned templates, AI Summary and a summary action writing a first summary ask the model to answer `NOTHING_TO_SUMMARIZE`; custom context-only templates and flat built-ins edited before this rule keep their own rules. A reply that is the marker (bare, fenced, emphasised or after a short sentence) outside a thinking block writes nothing; a summary that merely contains it is saved, and the runner shows `notes.actions.errors.nothingToSummarize` as a neutral notice (`notice` on the error event) instead of saving a placeholder summary
- UI: `TemplatePicker` opens from the chevron in the AI Summary tab, which names the note's template; the "Generate AI Summary" callout (runs the note's template, else the default), `ActionPicker` in the collapsed ask bar (runs the last action picked from it, in place of the send button), `ActionChips` once the in-view chat opens and in the docked chat (the first five actions in docked chat; the centered row omits Make notes longer without backfilling another chip; each has its action's icon, and All actions keeps every action; hovering a chip shows its icon, title and description without a destination badge; the in-view chat pins All actions at the end, and the docked chat shows them as filled pills in one tray with its composer: All actions, then the actions, scrolling together), a `/` menu in the note composers (`slashCommands` on `ChatInput`, each row with its action's icon, or a "/" for an icon this build doesn't know; it fills the chat above the composer until a command runs, the "/" is deleted, nothing matches or the composer loses focus), and `ActionManagerDialog` (Templates | Actions). The notes list and the docked chat widen or narrow from their edge facing the note (`useResizableWidth`, `PanelResizeHandle`), and keep their width across launches (localStorage `notesSidebarWidth`, `noteChatWidth`). Anything the ask bar sends (a message, or a chat action from the picker, a chip or the `/` menu) starts a new conversation in the docked chat, which holds the conversation and its history; the in-view chat is only the chips and the composer. Destinations are fixed and described in the editor; saving never asks a model to choose one. Legacy custom summary destinations read as chat (`toActionItem`), keeping the existing IPC fields, IDs and prompts. Summary generation stays in the AI Summary tab and callout. A run that writes the summary is undoable for 6 s instead of asking first: the runner queues the fields it overwrote (`appliedEvents`) and `BackgroundActionToastListener` shows the Undo toast
diff --git a/src/components/notes/PersonalNotesView.tsx b/src/components/notes/PersonalNotesView.tsx
index 80c2167fb..9959148c3 100644
--- a/src/components/notes/PersonalNotesView.tsx
+++ b/src/components/notes/PersonalNotesView.tsx
@@ -736,12 +736,22 @@ export default function PersonalNotesView({
const noteContent = editorNote.content;
const hasNotes = !!noteContent.trim();
if (!hasNotes && !rawTranscript) return;
+ // An upload whose provider returned no segments saved its transcript as the
+ // note's text and left the transcript empty (#2666).
+ const transcriptInContent = !rawTranscript && editorNote.note_type === "upload";
+ const transcriptText = transcriptInContent ? noteContent : rawTranscript;
let formattedTranscript = "";
let meetingContext = "";
let isMeetingNote = false;
+ let hasPlainTranscript = false;
let knownPeople: MentionPerson[] = [];
- if (rawTranscript) {
+ if (transcriptText) {
+ const identity: MeetingIdentity = {
+ selfName: user?.name?.trim() || null,
+ selfEmail: user?.email?.trim() || null,
+ participants: parseNoteParticipants(editorNote.participants),
+ };
const segments = parseTranscriptSegments(rawTranscript);
if (segments.length > 0) {
isMeetingNote = true;
@@ -750,24 +760,25 @@ export default function PersonalNotesView({
const speakerMappings: Record<string, string> = {};
for (const m of mappingRows) speakerMappings[m.speaker_id] = m.display_name;
- const identity: MeetingIdentity = {
- selfName: user?.name?.trim() || null,
- selfEmail: user?.email?.trim() || null,
- participants: parseNoteParticipants(editorNote.participants),
- };
const selfLabel = identity.selfName || t("notes.speaker.you");
meetingContext = buildMeetingContext(identity, selfLabel);
formattedTranscript = buildLlmTranscript(segments, speakerMappings, selfLabel, t);
knownPeople = collectKnownPeople(identity, speakerMappings, segments);
+ } else {
+ // Plain text shows no speakers, so the run gets no Meeting Context: the model
+ // can't tell who "I" is, and an invitee list invites guessed owners. The user
+ // and the invitees still turn an owner the transcript names into a mention (#2666).
+ hasPlainTranscript = true;
+ knownPeople = collectKnownPeople(identity, {}, []);
}
if (!formattedTranscript) {
- formattedTranscript = rawTranscript;
+ formattedTranscript = transcriptText;
}
}
const { input, fromSummary, material } = buildNoteRunInput(action, {
summary: editorEnhancedContent,
- notes: noteContent,
+ notes: transcriptInContent ? "" : noteContent,
meetingContext,
transcript: formattedTranscript,
});
@@ -775,6 +786,7 @@ export default function PersonalNotesView({
isCloudMode,
modelId: effectiveModelId,
isMeetingNote,
+ hasPlainTranscript,
knownPeople,
fromSummary,
material,
diff --git a/src/helpers/builtinActions.js b/src/helpers/builtinActions.js
index 7849cd3c0..8dee3378b 100644
--- a/src/helpers/builtinActions.js
+++ b/src/helpers/builtinActions.js
@@ -394,6 +394,37 @@ export const NOTE_INPUT_PREAMBLE = `The material is the user's own notes, possib
`;
+// A transcript that is only plain text (a recording that captured no speaker
+// segments, or one made before 1.6.6) shows no speakers, so an owner or a
+// deadline can only come from what was said or written, never a guess (#2666).
+// The owner still goes last, where tagActionItemOwners reads it.
+const PLAIN_TRANSCRIPT_OWNER_RULE = `Add an owner or a deadline only when the transcript or the user's notes state it. The owner is the person named as taking the action on or being asked to: "Alice, can you fix the build by Friday?" becomes \`- [ ] Fix the build by Friday — Alice\`, with the deadline inside the action text. When no owner is named, end the line after the action, as in \`- [ ] Send the revised proposal\`. Never guess an owner from who seems to be speaking, never use "You" or "Them" as one, and never write a placeholder such as "Owner not specified" or "TBD".`;
+
+export const PLAIN_TRANSCRIPT_SYSTEM_PROMPT = `You are a professional meeting notes assistant. You will receive a meeting transcript in plain text: its lines carry no speaker labels, so it doesn't show who said what. Manual notes the user took may be included as well.
+
+Your job is to produce clean, actionable meeting notes in markdown. Follow these rules:
+
+FORMAT RULES (strict):
+- Do NOT include any preamble: no title, no "# Meeting Notes", no date/time/location, no attendee list, no topic header. Start directly with the summary.
+- Do NOT use horizontal rules or block quotes. Use a table only when the instructions ask for one.
+- NEVER guess or invent who said something; name a person only where the transcript or the user's notes name them.
+- Start with a concise 1–2 sentence summary of what the meeting was about.
+- Use clear section headings: ## Key Discussion Points, ## Decisions Made, ## Action Items, ## Follow-ups (omit any section that has no content).
+- Under Action Items, write one checkbox per item in the form \`- [ ] Action — Owner\`, never a table unless the instructions ask for one. ${PLAIN_TRANSCRIPT_OWNER_RULE}
+
+CONTENT RULES:
+- Preserve important quotes or specific commitments verbatim when they carry meaning.
+- Remove filler, small talk, false starts, and repeated/redundant content.
+- Where the same topic comes up more than once, consolidate it into a coherent point rather than listing every utterance.
+- If the user included manual notes alongside the transcript, integrate them — they represent the user's emphasis on what matters most.
+- Keep the tone professional and concise. Bias toward brevity.
+
+Instructions: `;
+
+export const PLAIN_TRANSCRIPT_INPUT_PREAMBLE = `The material is a transcript in plain text: its lines carry no speaker labels, so it doesn't show who said what. Manual notes the user took may precede the transcript. Never guess or invent who said something; name a person only where the transcript or the user's notes name them. For action items: ${PLAIN_TRANSCRIPT_OWNER_RULE} Where an instruction below says to use "You" or "Them" when no name is available, end the line after the action instead. Where an instruction below asks to attribute points by label or to each person, attribute a point only to someone the transcript or the user's notes name, and group the rest by topic. Never write "[name unclear]" in place of who said or owns something.
+
+`;
+
// A summary action rewrites the summary the note already has; the rest of the
// input is only there to keep the rewrite accurate.
export const SUMMARY_ACTION_SYSTEM_PROMPT = `You revise an existing AI summary of a note. The input starts with the current summary under "## Current Summary". The user's own notes under "## My Notes" and a "## Meeting Context" block may follow; they are reference material for accuracy, never something to reproduce.
diff --git a/src/helpers/templatePrompts.js b/src/helpers/templatePrompts.js
index c6c7406b0..65d76f839 100644
--- a/src/helpers/templatePrompts.js
+++ b/src/helpers/templatePrompts.js
@@ -13,6 +13,8 @@ import {
MEETING_INPUT_PREAMBLE,
MEETING_SYSTEM_PROMPT,
NOTE_INPUT_PREAMBLE,
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ PLAIN_TRANSCRIPT_SYSTEM_PROMPT,
SECTIONED_NOTES_FOOTER,
SECTIONED_NOTES_FORMAT,
SECTIONED_NOTES_INSTRUCTIONS,
@@ -38,15 +40,34 @@ export function normalizeSections(value) {
.filter((section) => section.heading);
}
+// Speaker segments make a meeting. A transcript in plain text has no speakers to
+// label, so it is its own case (#2666). Anything else is the user's own notes.
+const inputPreamble = ({ isMeetingNote, hasPlainTranscript }) =>
+ isMeetingNote
+ ? MEETING_INPUT_PREAMBLE
+ : hasPlainTranscript
+ ? PLAIN_TRANSCRIPT_INPUT_PREAMBLE
+ : NOTE_INPUT_PREAMBLE;
+
+const flatSystemPrompt = ({ isMeetingNote, hasPlainTranscript }) =>
+ isMeetingNote
+ ? MEETING_SYSTEM_PROMPT
+ : hasPlainTranscript
+ ? PLAIN_TRANSCRIPT_SYSTEM_PROMPT
+ : BASE_SYSTEM_PROMPT;
+
/**
* A template with sections is compiled around the shared notes rules. One with
* only a prompt keeps the request it always had after the shared fidelity rule:
* standalone built-ins get the material preamble, everything else the generic
* system prompt.
*/
-export function compileTemplatePrompt(template, { isMeetingNote = false } = {}) {
+export function compileTemplatePrompt(
+ template,
+ { isMeetingNote = false, hasPlainTranscript = false } = {}
+) {
const preamble =
- SOURCE_FIDELITY_RULE + "\n\n" + (isMeetingNote ? MEETING_INPUT_PREAMBLE : NOTE_INPUT_PREAMBLE);
+ SOURCE_FIDELITY_RULE + "\n\n" + inputPreamble({ isMeetingNote, hasPlainTranscript });
const sections = normalizeSections(template.sections);
if (sections.length > 0) {
const context = (template.prompt ?? "").trim();
@@ -72,15 +93,18 @@ export function compileTemplatePrompt(template, { isMeetingNote = false } = {})
return (
SOURCE_FIDELITY_RULE +
"\n\n" +
- (isMeetingNote ? MEETING_SYSTEM_PROMPT : BASE_SYSTEM_PROMPT) +
+ flatSystemPrompt({ isMeetingNote, hasPlainTranscript }) +
template.prompt
);
}
-export function compileSummaryActionPrompt(action, { fromSummary, isMeetingNote = false }) {
+export function compileSummaryActionPrompt(
+ action,
+ { fromSummary, isMeetingNote = false, hasPlainTranscript = false }
+) {
if (fromSummary)
return SOURCE_FIDELITY_RULE + "\n\n" + SUMMARY_ACTION_SYSTEM_PROMPT + action.prompt;
- const preamble = isMeetingNote ? MEETING_INPUT_PREAMBLE : NOTE_INPUT_PREAMBLE;
+ const preamble = inputPreamble({ isMeetingNote, hasPlainTranscript });
return (
SOURCE_FIDELITY_RULE + "\n\n" + preamble + SUMMARY_ACTION_FROM_MATERIAL_PROMPT + action.prompt
);
diff --git a/src/stores/actionProcessingStore.ts b/src/stores/actionProcessingStore.ts
index fa8191ac7..6a4701cf4 100644
--- a/src/stores/actionProcessingStore.ts
+++ b/src/stores/actionProcessingStore.ts
@@ -147,13 +147,27 @@ export const useActionProcessingStore = create<ActionProcessingStoreState>()(()
// part is asked for condensed working notes rather than the final product.
// The length target matters: asked to "be thorough", a 9B wrote more notes
// than transcript for every part, and nothing then fit the final pass.
-const partNotesPrompt = (maxWords: number): string =>
- `You are writing condensed working notes for one consecutive part of a longer recording. The material is either a transcript, where each line is prefixed with the speaker's label (a real name when known, otherwise "You" for the note owner, "Them", or "Speaker N"), or working notes already written from an earlier pass. A "## Meeting Context" block may identify the note owner and the invited participants; it is reference material, never something to reproduce.
+// A plain-text transcript has no labels to attribute by, and an owner a part
+// guessed would reach the merge as if the material had stated it (#2666).
+const partNotesPrompt = (maxWords: number, hasSpeakerLabels: boolean): string =>
+ `You are writing condensed working notes for one consecutive part of a longer recording. ${
+ hasSpeakerLabels
+ ? `The material is either a transcript, where each line is prefixed with the speaker's label (a real name when known, otherwise "You" for the note owner, "Them", or "Speaker N"), or working notes already written from an earlier pass. A "## Meeting Context" block may identify the note owner and the invited participants; it is reference material, never something to reproduce.`
+ : "The material is either a transcript in plain text, whose lines carry no speaker labels, or working notes already written from an earlier pass."
+ }
-Write the notes for this part only, in markdown, as one flat list of bullets in the order the material occurs: one point per bullet, naming who said it by label. Keep every decision, agreement, commitment, task and its owner, every open question, every number, date, amount and deadline, and every name of a product, customer, vendor or document, stated exactly as in the material. Leave out greetings, filler and repetition. Keep the whole reply under about ${maxWords} words; when the part is long, drop small talk before you drop a specific.
+Write the notes for this part only, in markdown, as one flat list of bullets in the order the material occurs: ${
+ hasSpeakerLabels
+ ? "one point per bullet, naming who said it by label. Keep every decision, agreement, commitment, task and its owner,"
+ : "one point per bullet. Keep every decision, agreement, commitment and task, with its owner only where the material names one,"
+ } every open question, every number, date, amount and deadline, and every name of a product, customer, vendor or document, stated exactly as in the material. Leave out greetings, filler and repetition. Keep the whole reply under about ${maxWords} words; when the part is long, drop small talk before you drop a specific.
Rules:
-- Refer to people only by the labels used in the material. NEVER guess or invent an identity.
+- ${
+ hasSpeakerLabels
+ ? "Refer to people only by the labels used in the material. NEVER guess or invent an identity."
+ : "Name a person only where the material names them. NEVER guess or invent who said something or who owns a task."
+ }
- Do NOT include a title, a preamble, or a summary of the whole recording; you have only seen this part.
- Do NOT use headings, tables, horizontal rules, or block quotes.
@@ -268,8 +282,8 @@ async function runInParts(
material: NoteMaterial
): Promise<string> {
const { transcript, meetingContext: context, notes: manualNotes } = material;
- // Only a diarised transcript carries "Label:" lines; a live recording's text
- // is one plain paragraph whose first colon is not a speaker.
+ // Only a diarised transcript carries "Label:" lines; a plain-text transcript
+ // is one paragraph whose first colon is not a speaker.
const hasSpeakerLabels = run.options.isMeetingNote === true;
const mergeSystemPrompt = run.systemPrompt + MERGE_ADDENDUM;
@@ -292,7 +306,7 @@ async function runInParts(
// Parts are planned against the largest allowance so they stay small enough
// for the exact tokenizer to accept them whatever share they end up with.
const fixedTokens =
- estimateNoteTokens(partNotesPrompt(PART_NOTES_MAX_TOKENS / 2)) +
+ estimateNoteTokens(partNotesPrompt(PART_NOTES_MAX_TOKENS / 2, hasSpeakerLabels)) +
estimateNoteTokens(context) +
PART_NOTES_MAX_TOKENS +
CONTEXT_RESERVE_TOKENS;
@@ -323,7 +337,7 @@ async function runInParts(
try {
notes = await reasoningService.processText(content, run.modelId, null, {
...run.requestConfig,
- systemPrompt: partNotesPrompt(Math.floor(maxTokens / 2)),
+ systemPrompt: partNotesPrompt(Math.floor(maxTokens / 2), hasSpeakerLabels),
maxTokens,
// Working notes are scaffolding: reasoning would spend the part's whole
// output budget before a line of them is written.
@@ -425,6 +439,8 @@ export interface RunActionOptions {
isCloudMode: boolean;
modelId: string;
isMeetingNote?: boolean;
+ /** The transcript is plain text, with no speaker segments to label its lines (#2666). */
+ hasPlainTranscript?: boolean;
/** Opt-in so enhancement never renames a note the user has titled. */
allowTitleGeneration?: boolean;
/** People whose names in generated action-item owners become mention tags. */
@@ -485,12 +501,17 @@ export function runBackgroundAction(
? compileSummaryActionPrompt(action, {
fromSummary: !!options.fromSummary,
isMeetingNote: options.isMeetingNote,
+ hasPlainTranscript: options.hasPlainTranscript,
})
- : compileTemplatePrompt(action, { isMeetingNote: options.isMeetingNote });
+ : compileTemplatePrompt(action, {
+ isMeetingNote: options.isMeetingNote,
+ hasPlainTranscript: options.hasPlainTranscript,
+ });
const providerOverrides = buildNoteFormattingOverrides(noteFormatting, options.isCloudMode);
const systemPrompt = appendDictionarySuffix(
instructions,
- options.isMeetingNote ? settings.customDictionary : undefined,
+ // Any transcript is speech-to-text, which misspells names.
+ options.isMeetingNote || options.hasPlainTranscript ? settings.customDictionary : undefined,
settings.uiLanguage
);
const requestConfig: ReasoningConfig = {
diff --git a/test/components/personalNotesUndoDiscard.test.js b/test/components/personalNotesUndoDiscard.test.js
index 715348a0c..bc5e891d2 100644
--- a/test/components/personalNotesUndoDiscard.test.js
+++ b/test/components/personalNotesUndoDiscard.test.js
@@ -47,7 +47,7 @@ const MOCKS = {
export const useNotesOnboarding = () => ({ isComplete: true, complete() {} });
`,
"/hooks/useTeamSpacesCapability": `export const useTeamSpacesCapability = () => false;`,
- "/hooks/useAuth": `export const useAuth = () => ({ isSignedIn: false, user: null });`,
+ "/hooks/useAuth": `export const useAuth = () => ({ isSignedIn: false, user: globalThis.__user ?? null });`,
"/stores/noteStore": `
const note = () => globalThis.__note;
export const setActiveNoteId = () => {};
@@ -274,3 +274,96 @@ for (const { name, transcribing, liveNoteId, expectLive } of [
}
});
}
+
+const AI_SUMMARY = {
+ id: 2,
+ kind: "template",
+ name: "AI Summary",
+ prompt: "Summarize",
+ sections: null,
+};
+const PARTICIPANTS = JSON.stringify([
+ { email: "[email protected]", displayName: "Sam Rivera", self: true },
+ { email: "[email protected]", displayName: "Alice Ng" },
+]);
+const USER_AND_INVITEE = [
+ { name: "Sam Rivera", email: "[email protected]" },
+ { name: "Alice Ng", email: "[email protected]" },
+];
+
+async function runSummaryOn(t, note, speakerMappings = []) {
+ const calls = await mountView(t);
+ globalThis.window.electronAPI.getSpeakerMappings = async () => speakerMappings;
+ globalThis.__noteActionCalls = [];
+ globalThis.__user = { name: "Sam Rivera", email: "[email protected]" };
+ t.after(() => {
+ delete globalThis.__noteActionCalls;
+ delete globalThis.__user;
+ });
+ globalThis.__note = { ...NOTE, ...note };
+ await calls.rerender();
+ await React.act(async () => {
+ await globalThis.__editorProps.onRunNoteAction(AI_SUMMARY);
+ });
+ assert.equal(globalThis.__noteActionCalls.length, 1);
+ const [, input, , options] = globalThis.__noteActionCalls[0];
+ return { input, options };
+}
+
+test("a transcript stored as plain text runs as one, with the user and the invitees for owner mentions", async (t) => {
+ const transcript = "Alice, can you fix the build by Friday? Sure, I'll do it.";
+ const { input, options } = await runSummaryOn(t, { transcript, participants: PARTICIPANTS });
+ assert.equal(options.hasPlainTranscript, true);
+ assert.equal(options.isMeetingNote, false, "plain text has no speaker lines to split along");
+ assert.deepEqual(options.knownPeople, USER_AND_INVITEE);
+ assert.equal(
+ input,
+ `${NOTE.content}\n\n## Meeting Transcript\n${transcript}`,
+ "no Meeting Context, and the transcript as stored"
+ );
+});
+
+test("a meeting with speakers keeps its Meeting Context, speaker lines and known people", async (t) => {
+ const transcript = JSON.stringify([
+ { source: "mic", timestamp: 100, text: "I'll send the deck." },
+ { source: "system", timestamp: 200, text: "Ship on Friday.", speaker: "speaker_0" },
+ ]);
+ const { input, options } = await runSummaryOn(t, { transcript, participants: PARTICIPANTS }, [
+ { speaker_id: "speaker_0", display_name: "Alice Ng" },
+ ]);
+ assert.equal(options.isMeetingNote, true);
+ assert.ok(!options.hasPlainTranscript);
+ assert.deepEqual(options.knownPeople, USER_AND_INVITEE);
+ assert.ok(
+ input.includes(
+ '## Meeting Context\nThe user taking these notes ("Sam Rivera" in the transcript) is Sam Rivera <[email protected]>.\nInvited participants: Alice Ng <[email protected]>.'
+ ),
+ "the owner and the invitee"
+ );
+ assert.ok(input.includes("Sam Rivera: I'll send the deck.\nAlice Ng: Ship on Friday."));
+});
+
+test("a note without a transcript keeps the personal-note run", async (t) => {
+ const { input, options } = await runSummaryOn(t, { transcript: "", participants: PARTICIPANTS });
+ assert.equal(input, NOTE.content);
+ assert.equal(options.isMeetingNote, false);
+ assert.ok(!options.hasPlainTranscript);
+ assert.deepEqual(options.knownPeople, []);
+});
+
+// An upload whose provider returned no segments saves its transcript as the
+// note's text and leaves the transcript empty, so that text is the transcript.
+test("an upload whose transcript is the note's text runs as a plain transcript", async (t) => {
+ const content = "Alice, can you fix the build by Friday? Sure.";
+ const { input, options } = await runSummaryOn(t, {
+ note_type: "upload",
+ content,
+ transcript: "",
+ participants: null,
+ });
+ assert.equal(options.hasPlainTranscript, true);
+ assert.equal(options.isMeetingNote, false);
+ assert.equal(input, `## Meeting Transcript\n${content}`, "not the user's own notes");
+ assert.deepEqual(options.material, { notes: "", meetingContext: "", transcript: content });
+ assert.deepEqual(options.knownPeople, [{ name: "Sam Rivera", email: "[email protected]" }]);
+});
diff --git a/test/config/noteFidelityPrompt.test.js b/test/config/noteFidelityPrompt.test.js
index a2903dd63..1314d8f4c 100644
--- a/test/config/noteFidelityPrompt.test.js
+++ b/test/config/noteFidelityPrompt.test.js
@@ -7,17 +7,21 @@ test("source fidelity instructions reach chat and every note-generation entry po
const { compileTemplatePrompt, compileSummaryActionPrompt, compileChatActionPrompt } =
await import("../../src/helpers/templatePrompts.js");
const prompts = [getAgentSystemPrompt([]), getAgentSystemPrompt(["get_note", "update_note"])];
- for (const isMeetingNote of [true, false]) {
- prompts.push(compileTemplatePrompt({ prompt: "Custom instructions" }, { isMeetingNote }));
+ for (const options of [
+ { isMeetingNote: true },
+ { isMeetingNote: false },
+ { hasPlainTranscript: true },
+ ]) {
+ prompts.push(compileTemplatePrompt({ prompt: "Custom instructions" }, options));
prompts.push(
compileTemplatePrompt(
{ sections: [{ heading: "Decisions", instruction: "List decisions" }] },
- { isMeetingNote }
+ options
)
);
for (const fromSummary of [true, false]) {
prompts.push(
- compileSummaryActionPrompt({ prompt: "Shorten this" }, { fromSummary, isMeetingNote })
+ compileSummaryActionPrompt({ prompt: "Shorten this" }, { fromSummary, ...options })
);
prompts.push(
getAgentSystemPrompt([]) +
diff --git a/test/helpers/templatePrompts.test.js b/test/helpers/templatePrompts.test.js
index 12c06d490..761bed0e9 100644
--- a/test/helpers/templatePrompts.test.js
+++ b/test/helpers/templatePrompts.test.js
@@ -21,6 +21,7 @@ test("Detailed Notes compiled from its sections is the prompt it replaced, but f
SOURCE_FIDELITY_RULE,
MEETING_INPUT_PREAMBLE,
NOTE_INPUT_PREAMBLE,
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
compileTemplatePrompt,
} = await load();
const detailed = BUILTIN_ACTIONS.find((action) => action.translationKey === DETAILED_NOTES_KEY);
@@ -29,11 +30,12 @@ test("Detailed Notes compiled from its sections is the prompt it replaced, but f
// answers with a marker instead of a sentence that was saved as its summary.
const body = flat.slice(0, flat.lastIndexOf("\n\n"));
- for (const [isMeetingNote, preamble] of [
- [true, MEETING_INPUT_PREAMBLE],
- [false, NOTE_INPUT_PREAMBLE],
+ for (const [options, preamble] of [
+ [{ isMeetingNote: true }, MEETING_INPUT_PREAMBLE],
+ [{ isMeetingNote: false }, NOTE_INPUT_PREAMBLE],
+ [{ hasPlainTranscript: true }, PLAIN_TRANSCRIPT_INPUT_PREAMBLE],
]) {
- const compiled = compileTemplatePrompt(seededRow(detailed), { isMeetingNote }).slice(
+ const compiled = compileTemplatePrompt(seededRow(detailed), options).slice(
(SOURCE_FIDELITY_RULE + "\n\n").length
);
assert.ok(compiled.startsWith(preamble + body), "everything before the rule is unchanged");
@@ -74,6 +76,45 @@ test("a template without sections retains its instructions after the shared fide
);
});
+test("a transcript in plain text asks for a checklist with owners and deadlines only where stated", async () => {
+ const {
+ BUILTIN_ACTIONS,
+ GENERATE_NOTES_KEY,
+ SOURCE_FIDELITY_RULE,
+ MEETING_SYSTEM_PROMPT,
+ PLAIN_TRANSCRIPT_SYSTEM_PROMPT,
+ compileTemplatePrompt,
+ } = await load();
+ const generate = BUILTIN_ACTIONS.find((action) => action.translationKey === GENERATE_NOTES_KEY);
+ const prompt = compileTemplatePrompt(seededRow(generate), { hasPlainTranscript: true });
+
+ assert.match(prompt, /`- \[ \] Action — Owner`/);
+ assert.match(prompt, /never a table unless the instructions ask for one/);
+ assert.match(prompt, /only when the transcript or the user's notes state it/);
+ assert.match(prompt, /`- \[ \] Fix the build by Friday — Alice`/);
+ assert.match(prompt, /`- \[ \] Send the revised proposal`/);
+ assert.match(prompt, /never write a placeholder such as "Owner not specified" or "TBD"/);
+ assert.doesNotMatch(
+ prompt,
+ /Do NOT list or guess participant names/,
+ "not the personal-note rule"
+ );
+ assert.doesNotMatch(
+ prompt,
+ /speaker's label|Meeting Context/,
+ "no labels or context it doesn't have"
+ );
+ assert.equal(
+ prompt,
+ SOURCE_FIDELITY_RULE + "\n\n" + PLAIN_TRANSCRIPT_SYSTEM_PROMPT + generate.prompt
+ );
+ assert.equal(
+ compileTemplatePrompt(seededRow(generate), { isMeetingNote: true, hasPlainTranscript: true }),
+ SOURCE_FIDELITY_RULE + "\n\n" + MEETING_SYSTEM_PROMPT + generate.prompt,
+ "speaker segments win"
+ );
+});
+
test("a sectioned template puts its context before the format rules and keeps section order", async () => {
const { SECTIONED_NOTES_FORMAT, compileTemplatePrompt } = await load();
const prompt = compileTemplatePrompt(
@@ -178,6 +219,68 @@ test("a summary action revises the summary, or writes one from the material firs
);
});
+test("standalone templates and a first summary describe a plain transcript instead of claiming there is none", async () => {
+ const {
+ DETAILED_NOTES_KEY,
+ SOURCE_FIDELITY_RULE,
+ MEETING_INPUT_PREAMBLE,
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ SUMMARY_ACTION_FROM_MATERIAL_PROMPT,
+ compileTemplatePrompt,
+ compileSummaryActionPrompt,
+ } = await load();
+ assert.match(PLAIN_TRANSCRIPT_INPUT_PREAMBLE, /no speaker labels/);
+ assert.match(
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ /Never guess or invent who said something/,
+ "sections that attribute by speaker can't guess one"
+ );
+ assert.match(
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ /only when the transcript or the user's notes state it/
+ );
+ assert.match(
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ /Where an instruction below says to use "You" or "Them" when no name is available, end the line after the action instead/,
+ "it outranks the Action Items section's You or Them fallback"
+ );
+ assert.match(
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ /Where an instruction below asks to attribute points by label or to each person, attribute a point only to someone the transcript or the user's notes name, and group the rest by topic/,
+ "it outranks sections that attribute by label, such as Stand-up's Updates by Person"
+ );
+ assert.match(
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE,
+ /Never write "\[name unclear\]" in place of who said or owns something/,
+ "the unclear-name rule never becomes an owner or a heading"
+ );
+ assert.doesNotMatch(PLAIN_TRANSCRIPT_INPUT_PREAMBLE, /There is no transcript/);
+
+ const editedDetailed = { prompt: "My own notes rules.", translation_key: DETAILED_NOTES_KEY };
+ assert.equal(
+ compileTemplatePrompt(editedDetailed, { hasPlainTranscript: true }),
+ SOURCE_FIDELITY_RULE + "\n\n" + PLAIN_TRANSCRIPT_INPUT_PREAMBLE + editedDetailed.prompt
+ );
+ assert.equal(
+ compileTemplatePrompt(editedDetailed, { isMeetingNote: true, hasPlainTranscript: true }),
+ SOURCE_FIDELITY_RULE + "\n\n" + MEETING_INPUT_PREAMBLE + editedDetailed.prompt,
+ "speaker segments win"
+ );
+ assert.equal(
+ compileSummaryActionPrompt(ACTION, { fromSummary: false, hasPlainTranscript: true }),
+ SOURCE_FIDELITY_RULE +
+ "\n\n" +
+ PLAIN_TRANSCRIPT_INPUT_PREAMBLE +
+ SUMMARY_ACTION_FROM_MATERIAL_PROMPT +
+ ACTION.prompt
+ );
+ assert.equal(
+ compileSummaryActionPrompt(ACTION, { fromSummary: true, hasPlainTranscript: true }),
+ compileSummaryActionPrompt(ACTION, { fromSummary: true }),
+ "rewriting an existing summary never reads the transcript"
+ );
+});
+
test("a chat action works from the summary when there is one, and the transcript when there isn't", async () => {
const { compileChatActionPrompt } = await load();
const action = { prompt: "List the to-dos." };
diff --git a/test/stores/actionProcessingChunked.test.js b/test/stores/actionProcessingChunked.test.js
index 9dbce6ef2..09c5ea928 100644
--- a/test/stores/actionProcessingChunked.test.js
+++ b/test/stores/actionProcessingChunked.test.js
@@ -154,6 +154,7 @@ test("refused material is summarised in parts, then merged with the action promp
/this part only/i.test(call.config.systemPrompt),
"part prompt is the part-notes prompt"
);
+ assert.match(call.config.systemPrompt, /naming who said it by label/);
assert.ok(call.config.maxTokens <= 2048);
});
assert.ok(
@@ -688,12 +689,17 @@ test("only the whole-note request refuses a reply the window clipped", async (t)
test("a transcript without speaker labels is packed without a prose prefix", async (t) => {
const { store, calls, updates } = await loadStore(t, { failFirst: true });
- // A note summarised while it is still recording carries the live transcript:
- // one space-joined paragraph, no "Label:" lines, and a colon in the first clause.
+ // A transcript stored as plain text (a recording that captured no speaker
+ // segments): one space-joined paragraph, no "Label:" lines, and a colon in the first clause.
const transcript =
"Meeting at 10:30 we discussed the rollout plan. " +
"Then we covered the budget and the hiring plan. ".repeat(600).trim();
- run(store, 21, { notes: "", meetingContext: "", transcript }, { isMeetingNote: false });
+ run(
+ store,
+ 21,
+ { notes: "", meetingContext: "", transcript },
+ { isMeetingNote: false, hasPlainTranscript: true }
+ );
await waitForResult(store, updates);
assert.deepEqual(store.consumeErrorEvents(), []);
assert.equal(updates.length, 1);
@@ -706,6 +712,104 @@ test("a transcript without speaker labels is packed without a prose prefix", asy
.split("Meeting at 10:").length - 1,
1
);
+ // A part told every line has a label would attribute by guess, and the merge
+ // would take its guessed owner as stated (#2666).
+ for (const part of parts) {
+ assert.match(
+ part.config.systemPrompt,
+ /a transcript in plain text, whose lines carry no speaker labels/
+ );
+ assert.match(part.config.systemPrompt, /with its owner only where the material names one/);
+ assert.match(
+ part.config.systemPrompt,
+ /NEVER guess or invent who said something or who owns a task/
+ );
+ assert.doesNotMatch(part.config.systemPrompt, /speaker's label|by label|Meeting Context/);
+ }
+ const { compileTemplatePrompt } = await import("../../src/helpers/templatePrompts.js");
+ assert.ok(
+ calls
+ .at(-1)
+ .config.systemPrompt.startsWith(compileTemplatePrompt(ACTION, { hasPlainTranscript: true })),
+ "the merge pass carries the plain-transcript rule"
+ );
+});
+
+test("a transcript in plain text gets its own prompt and the dictionary, and owners it names become mentions", async (t) => {
+ const { compileTemplatePrompt, compileSummaryActionPrompt } =
+ await import("../../src/helpers/templatePrompts.js");
+ const reply = [
+ "## Action Items",
+ "- [ ] Fix the build by Friday — Alice",
+ "- [ ] Book the room — Priya",
+ "- [ ] Send the revised proposal",
+ ].join("\n");
+ const { store, calls, updates } = await loadStore(t, {
+ budget: BIG_BUDGET,
+ storage: { customDictionary: JSON.stringify(["Alice Ng"]) },
+ processText: () => reply,
+ });
+ const plainOptions = { isMeetingNote: false, hasPlainTranscript: true };
+ const plainMaterial = {
+ notes: "",
+ meetingContext: "",
+ transcript: "Alice, can you fix the build by Friday? Sure.",
+ };
+
+ run(store, 40, plainMaterial, {
+ ...plainOptions,
+ knownPeople: [{ name: "Alice Ng", email: "[email protected]" }],
+ });
+ await waitFor(() => updates.length === 1, "the plain transcript's save");
+ const instructions = compileTemplatePrompt(ACTION, plainOptions);
+ assert.equal(updates[0].payload.enhancement_prompt, instructions);
+ assert.ok(calls[0].config.systemPrompt.startsWith(instructions));
+ assert.ok(
+ calls[0].config.systemPrompt.endsWith("Alice Ng"),
+ "a transcript gets the custom dictionary"
+ );
+ assert.equal(
+ updates[0].payload.enhanced_content,
+ [
+ "## Action Items",
+ "- [ ] Fix the build by Friday — [@Alice Ng](mention:alice%40example.com)",
+ "- [ ] Book the room — Priya",
+ "- [ ] Send the revised proposal",
+ ].join("\n")
+ );
+
+ run(store, 41, longMaterial(2));
+ await waitFor(() => updates.length === 2, "the meeting's save");
+ assert.ok(
+ calls.at(-1).config.systemPrompt.endsWith("Alice Ng"),
+ "a meeting keeps the dictionary"
+ );
+
+ run(
+ store,
+ 42,
+ { notes: "My notes", meetingContext: "", transcript: "" },
+ { isMeetingNote: false }
+ );
+ await waitFor(() => updates.length === 3, "the personal note's save");
+ assert.equal(
+ calls.at(-1).config.systemPrompt,
+ compileTemplatePrompt(ACTION),
+ "a personal note is unchanged"
+ );
+
+ // A summary action on a note with no summary yet writes one from the material.
+ const shorten = { id: 2, kind: "action", output: "summary", prompt: "Make it shorter." };
+ run(store, 43, plainMaterial, { ...plainOptions, fromSummary: false }, shorten);
+ await waitFor(() => updates.length === 4, "the summary action's save");
+ assert.ok(
+ calls
+ .at(-1)
+ .config.systemPrompt.startsWith(
+ compileSummaryActionPrompt(shorten, { fromSummary: false, ...plainOptions })
+ ),
+ "a first summary from a summary action gets the plain-transcript preamble"
+ );
});
test("parts never spend their output budget on thinking", async (t) => {