From 65b1e80710cab0d02bd78b9cad132439d09c624a Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:50:52 +0100 Subject: [PATCH 01/17] test(live-answers): parse real local-model outputs - prose refusals, stray NO_ANSWER, citation and preamble clean-up, shortening, no false truncation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixture: 99 recorded mistral 7B outputs from the live answers probe with the excerpts the model received (invented meeting content). - 12 prose refusals are declined, 13 real answers (several with a negation) stay answers (green today). - NO_ANSWER inside the text: its line is dropped; refusal when only a 'not a question' remark is left. - Timestamps and malformed tags are removed or turned into [Sn] chips; 'User's response:', 'User:', 'Answer:', 'Réponse :' never head the answer. - More than three bullets: shortened flag, and the block that cites a provided excerpt is kept (the en3-a#1 answer was lost). - A last line without a final period is not truncated; the old mid-word fixture now ends on a function word (no length signal exists). Red: 31 cases plus the new shortened file (missing ParsedAnswer.shortened). --- .../live_answers/answer_parser_test.dart | 6 +- .../live_answers_service_test.dart | 8 +- .../recorded_outputs_shortened_test.dart | 92 + .../live_answers/recorded_outputs_test.dart | 259 +++ .../live_answers_panel_test.dart | 4 +- .../live_answers/mistral_probe_outputs.json | 1530 +++++++++++++++++ .../app_macos/test/helpers/probe_outputs.dart | 67 + 7 files changed, 1957 insertions(+), 9 deletions(-) create mode 100644 apps/app_macos/test/application/services/live_answers/recorded_outputs_shortened_test.dart create mode 100644 apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart create mode 100644 apps/app_macos/test/fixtures/live_answers/mistral_probe_outputs.json create mode 100644 apps/app_macos/test/helpers/probe_outputs.dart diff --git a/apps/app_macos/test/application/services/live_answers/answer_parser_test.dart b/apps/app_macos/test/application/services/live_answers/answer_parser_test.dart index 33d553ce..07107c8d 100644 --- a/apps/app_macos/test/application/services/live_answers/answer_parser_test.dart +++ b/apps/app_macos/test/application/services/live_answers/answer_parser_test.dart @@ -178,16 +178,16 @@ void main() { 'réponse tronquée (fin du flux sans erreur, au milieu d\'une phrase)', () { test( - 'coupée au milieu d\'un mot : montrée telle quelle, marquée tronquée', + 'coupée sur un mot outil : montrée telle quelle, marquée tronquée', () { final ParsedAnswer a = parseAnswer( - 'La livraison est prévue pour le lot 1 au début du mo', + 'La livraison est prévue pour le lot 1 au début du', const [], ); expect(a.truncated, isTrue); expect( a.text, - 'La livraison est prévue pour le lot 1 au début du mo', + 'La livraison est prévue pour le lot 1 au début du', ); }, ); diff --git a/apps/app_macos/test/application/services/live_answers/live_answers_service_test.dart b/apps/app_macos/test/application/services/live_answers/live_answers_service_test.dart index 646ef8a5..b3b6dada 100644 --- a/apps/app_macos/test/application/services/live_answers/live_answers_service_test.dart +++ b/apps/app_macos/test/application/services/live_answers/live_answers_service_test.dart @@ -430,7 +430,7 @@ void main() { h.hear(q); async.flushMicrotasks(); h.llm.last.reply( - 'La livraison est prévue pour le lot 1 au début du mo', + 'La livraison est prévue pour le lot 1 au début du', ); async.flushMicrotasks(); @@ -438,7 +438,7 @@ void main() { expect(h.only.truncated, isTrue); expect( h.only.answer, - 'La livraison est prévue pour le lot 1 au début du mo', + 'La livraison est prévue pour le lot 1 au début du', ); }); }); @@ -972,7 +972,7 @@ void main() { h.hear(q); async.flushMicrotasks(); h.llm.last.reply( - 'La livraison est prévue pour le lot 1 au début du mo', + 'La livraison est prévue pour le lot 1 au début du', ); async.flushMicrotasks(); @@ -980,7 +980,7 @@ void main() { expect(saved.truncated, isTrue); expect( saved.answer, - 'La livraison est prévue pour le lot 1 au début du mo', + 'La livraison est prévue pour le lot 1 au début du', ); }); }); diff --git a/apps/app_macos/test/application/services/live_answers/recorded_outputs_shortened_test.dart b/apps/app_macos/test/application/services/live_answers/recorded_outputs_shortened_test.dart new file mode 100644 index 00000000..611debf4 --- /dev/null +++ b/apps/app_macos/test/application/services/live_answers/recorded_outputs_shortened_test.dart @@ -0,0 +1,92 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/live_answers/answer_parser.dart'; +import 'package:ici_transcript/application/services/live_answers/live_question.dart'; + +import '../../../helpers/probe_outputs.dart'; + +/// (Suite de recorded_outputs_test.dart : raccourcissement, API nouvelle.) +/// Sorties RÉELLES d'un modèle local (mistral 7B, 96 générations de la +/// sonde, contenu inventé), lues par `parseAnswer` avec les extraits que le +/// modèle avait reçus. Le modèle n'a jamais émis `NO_ANSWER` seul, refuse en +/// prose, cite dans de mauvais formats, ajoute des préambules et dépasse les +/// trois puces. +/// +/// API supposée (answer_parser.dart, en plus de PR #20) : +/// - `ParsedAnswer.declined` couvre aussi le refus en prose et le jeton au +/// milieu du texte (même état que `NO_ANSWER`). +/// - `ParsedAnswer.shortened` (bool) : des lignes reçues ne sont pas +/// montrées (au-delà de la tête et de trois puces) ; l'écran le dit. +/// - Citations : dans `text`, seules des marques canoniques `[S]` vers un +/// extrait fourni, reportées dans `sources`. +/// +/// Règles choisies : +/// - Refus en prose : la phrase qui répond dit que l'information manque +/// (« not (explicitly) given/provided/stated/indicated/mentioned/ +/// specified », « the documents/excerpts do not mention/contain », « the +/// user did not specify », « no specific information/cost … given/ +/// available », « n'est pas donné/indiqué/précisé/mentionné », « n'ont pas +/// été mentionnés », « non spécifié/indiqué/précisé », « ne connaît pas », +/// « aucune information ») ou que le texte n'est pas une question pour +/// l'utilisateur (« the question is a comment, not a question »). La phrase +/// qui répond = la première phrase de la tête ; si la tête est un titre +/// (sans ponctuation finale, ou finie par « : », suivi de puces), toute +/// ligne compte. Un état du monde (« not yet approved », « yet to be +/// confirmed », « does not include ») reste une réponse. +/// - Jeton `NO_ANSWER` (avec ou sans crochets) ailleurs qu'en tête : la ligne +/// qui le porte est retirée ; s'il ne reste rien de substantiel (seulement +/// un préambule ou une remarque « pas une question »), c'est un refus. +/// - Groupe entre crochets ou parenthèses qui contient des tags `S` et/ou +/// des heures (`[S1, S4]`, `[02:23 S1]`, `([S1])`, `[S1: 00:00:39]`) et +/// « document S1 » : remplacés par les `[S]` fournis, le reste retiré ; +/// heures seules (`[00:00:52]`, `[S0:00:13]`, `[User, 00:02:36]`, +/// `(User, 00:00:01)`) : retirées. +/// - Préambule (« User's response: », « User: », « Answer: », « Response: », +/// « Réponse : ») : retiré, jamais pris pour la tête. +/// - Plus de trois puces : tête + trois puces (les lignes suivantes, puces +/// ou non), `shortened`. Si la sortie a plusieurs blocs (séparés par une +/// ligne vide, chacun commençant par une ligne qui n'est pas une puce), le +/// bloc gardé est le premier qui cite un extrait fourni, sinon le premier. +/// - Tronquée : seulement si la dernière ligne finit sur un signe de suite, +/// un mot outil, une parenthèse ouverte ou une puce vide ; une dernière +/// ligne sans point final n'est pas tronquée (pas de signal de longueur du +/// fournisseur). +void main() { + ParsedAnswer parse(String key) { + final ProbeOutput o = probe(key); + return parseAnswer(o.raw, o.excerpts); + } + + group('4. plus de trois puces', () { + for (final String key in [ + 'contract/fr1-c#0', + 'contract/fr2-d#0', + 'contract/en2-d#0', + 'contract/en2-d#2', + ]) { + test('$key : plus de trois puces : tête + trois puces, raccourcie, ' + 'avec sa tête', () { + final ParsedAnswer a = parse(key); + expect(a.declined, isFalse); + expect(a.headline, isNotEmpty); + expect(a.bullets, hasLength(kMaxBullets)); + expect(a.shortened, isTrue); + }); + } + + test('contract/en3-a#1 : la réponse (13 mois, [S3]) est dans le 3e bloc : ' + 'c\'est ce bloc qui est gardé, raccourci', () { + final ParsedAnswer a = parse('contract/en3-a#1'); + expect(a.text, contains('13 months')); + expect(a.sources.map((AnswerSource s) => s.title), [ + 'Data retention policy', + ]); + expect(a.shortened, isTrue); + expect(a.bullets.length, lessThanOrEqualTo(kMaxBullets)); + }); + + test('réponse courte : pas raccourcie', () { + expect(parse('contract/en1-a1#0').shortened, isFalse); + expect(parse('contract/fr1-a2#0').shortened, isFalse); + }); + }); +} diff --git a/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart b/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart new file mode 100644 index 00000000..fd55e351 --- /dev/null +++ b/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart @@ -0,0 +1,259 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/live_answers/answer_parser.dart'; +import 'package:ici_transcript/application/services/live_answers/live_question.dart'; + +import '../../../helpers/probe_outputs.dart'; + +/// Sorties RÉELLES d'un modèle local (mistral 7B, 96 générations de la +/// sonde, contenu inventé), lues par `parseAnswer` avec les extraits que le +/// modèle avait reçus. Le modèle n'a jamais émis `NO_ANSWER` seul, refuse en +/// prose, cite dans de mauvais formats, ajoute des préambules et dépasse les +/// trois puces. +/// +/// API supposée (answer_parser.dart, en plus de PR #20) : +/// - `ParsedAnswer.declined` couvre aussi le refus en prose et le jeton au +/// milieu du texte (même état que `NO_ANSWER`). +/// - `ParsedAnswer.shortened` (bool) : des lignes reçues ne sont pas +/// montrées (au-delà de la tête et de trois puces) ; l'écran le dit. +/// - Citations : dans `text`, seules des marques canoniques `[S]` vers un +/// extrait fourni, reportées dans `sources`. +/// +/// Règles choisies : +/// - Refus en prose : la phrase qui répond dit que l'information manque +/// (« not (explicitly) given/provided/stated/indicated/mentioned/ +/// specified », « the documents/excerpts do not mention/contain », « the +/// user did not specify », « no specific information/cost … given/ +/// available », « n'est pas donné/indiqué/précisé/mentionné », « n'ont pas +/// été mentionnés », « non spécifié/indiqué/précisé », « ne connaît pas », +/// « aucune information ») ou que le texte n'est pas une question pour +/// l'utilisateur (« the question is a comment, not a question »). La phrase +/// qui répond = la première phrase de la tête ; si la tête est un titre +/// (sans ponctuation finale, ou finie par « : », suivi de puces), toute +/// ligne compte. Un état du monde (« not yet approved », « yet to be +/// confirmed », « does not include ») reste une réponse. +/// - Jeton `NO_ANSWER` (avec ou sans crochets) ailleurs qu'en tête : la ligne +/// qui le porte est retirée ; s'il ne reste rien de substantiel (seulement +/// un préambule ou une remarque « pas une question »), c'est un refus. +/// - Groupe entre crochets ou parenthèses qui contient des tags `S` et/ou +/// des heures (`[S1, S4]`, `[02:23 S1]`, `([S1])`, `[S1: 00:00:39]`) et +/// « document S1 » : remplacés par les `[S]` fournis, le reste retiré ; +/// heures seules (`[00:00:52]`, `[S0:00:13]`, `[User, 00:02:36]`, +/// `(User, 00:00:01)`) : retirées. +/// - Préambule (« User's response: », « User: », « Answer: », « Response: », +/// « Réponse : ») : retiré, jamais pris pour la tête. +/// - Plus de trois puces : tête + trois puces (les lignes suivantes, puces +/// ou non), `shortened`. Si la sortie a plusieurs blocs (séparés par une +/// ligne vide, chacun commençant par une ligne qui n'est pas une puce), le +/// bloc gardé est le premier qui cite un extrait fourni, sinon le premier. +/// - Tronquée : seulement si la dernière ligne finit sur un signe de suite, +/// un mot outil, une parenthèse ouverte ou une puce vide ; une dernière +/// ligne sans point final n'est pas tronquée (pas de signal de longueur du +/// fournisseur). +void main() { + ParsedAnswer parse(String key) { + final ProbeOutput o = probe(key); + return parseAnswer(o.raw, o.excerpts); + } + + group('1. refus en prose : même état que NO_ANSWER', () { + for (final String key in [ + 'contract/fr3-c#0', + 'contract/fr3-d#0', + 'contract/en2-c#0', + 'contract/en3-c#0', + 'contract/fr3-c#1', + 'contract/en2-c#1', + 'contract/fr3-c#2', + 'contract/en2-c#2', + 'contract/en3-c#2', + 'clean/fr1-c#0', + 'clean/en3-c#0', + 'contract/fr2-d#2', + ]) { + test('$key : refus, rien d\'affiché', () { + final ParsedAnswer a = parse(key); + expect(a.declined, isTrue, reason: probe(key).raw); + expect(a.text, isEmpty); + expect(a.sources, isEmpty); + }); + } + + for (final String key in [ + // Réponses qui contiennent une négation : elles restent des réponses. + 'contract/en2-a#1', + 'contract/fr3-b#2', + 'clean/fr1-a2#0', + 'contract/en1-c#0', + 'contract/en1-c#2', + 'clean/en1-c#0', + 'contract/fr1-c#2', + 'contract/en3-c#1', + // Réponses simples. + 'contract/en1-a1#0', + 'contract/fr1-a2#2', + 'clean/fr3-a#0', + 'contract/en3-a#0', + 'contract/fr3-b#0', + ]) { + test('$key : reste une réponse', () { + final ParsedAnswer a = parse(key); + expect(a.declined, isFalse, reason: probe(key).raw); + expect(a.headline, isNotEmpty); + }); + } + }); + + group('2. NO_ANSWER au milieu du texte : jamais affiché', () { + test('contract/fr3-b#1 : réponse avant le jeton, la ligne du jeton est ' + 'retirée', () { + final ParsedAnswer a = parse('contract/fr3-b#1'); + expect(a.declined, isFalse); + expect(a.text, contains('18 tickets')); + expect(a.text, isNot(contains('NO_ANSWER'))); + expect(a.text, isNot(contains('No new tickets were answered'))); + }); + + test('clean/fr3-b#0 : idem, la phrase finale qui porte le jeton part', () { + final ParsedAnswer a = parse('clean/fr3-b#0'); + expect(a.declined, isFalse); + expect(a.text, contains('18 tickets')); + expect(a.text, isNot(contains('NO_ANSWER'))); + expect(a.text, isNot(contains('15 tickets'))); + }); + + test('clean/fr2-d#0 : seulement une remarque « pas une question » avant ' + 'le jeton (sans crochets) : refus', () { + final ParsedAnswer a = parse('clean/fr2-d#0'); + expect(a.declined, isTrue); + expect(a.text, isEmpty); + }); + }); + + group('3. nettoyage avant affichage', () { + for (final (String key, String expected) in <(String, String)>[ + ( + 'contract/en3-b#0', + 'Two engineers are assigned to the warehouse migration full time.', + ), + ( + 'contract/en2-b#1', + 'Average first response time last month was four hours.', + ), + ]) { + test('$key : heure en guise de citation retirée', () { + final ParsedAnswer a = parse(key); + expect(a.text, expected); + expect(a.sources, isEmpty); + }); + } + + test('contract/fr2-b#2 et contract/en2-b#2 : « [User, 00:02:36] », ' + '« (User, 00:00:01) » retirés', () { + expect(parse('contract/fr2-b#2').text, isNot(contains('00:02:36'))); + final ParsedAnswer b = parse('contract/en2-b#2'); + expect(b.text, isNot(contains('00:00:01'))); + expect(b.text, isNot(contains('(User'))); + }); + + test('contract/en3-d#1 : liste d\'heures retirée', () { + expect(parse('contract/en3-d#1').text, isNot(contains('00:00:'))); + }); + + test( + 'contract/fr3-d#1 : « [S1, S4] » sans aucun extrait fourni : retiré', + () { + final ParsedAnswer a = parse('contract/fr3-d#1'); + expect(a.text, isNot(contains('S1'))); + expect(a.text, isNot(contains('S4'))); + expect(a.sources, isEmpty); + }, + ); + + test('contract/fr2-c#0 : « document S1 » devient la citation [S1] de ' + 'l\'extrait fourni', () { + final ParsedAnswer a = parse('contract/fr2-c#0'); + expect(a.text, isNot(contains('document S1'))); + expect(a.text, contains('[S1]')); + expect(a.sources.map((AnswerSource s) => s.title), [ + 'Informations du gîte', + ]); + }); + + test( + 'contract/fr1-c#2 : « ([S1]) » devient [S1], sans parenthèses vides', + () { + final ParsedAnswer a = parse('contract/fr1-c#2'); + expect(a.text, isNot(contains('('))); + expect(a.text, contains('[S1]')); + expect(a.sources.map((AnswerSource s) => s.title), [ + 'Planning du projet', + ]); + }, + ); + + test('cold/en1-b#2 : « [02:23 S1] » devient [S1] ; le préambule « User\'s ' + 'response: » n\'est pas la tête', () { + final ParsedAnswer a = parse('cold/en1-b#2'); + expect( + a.headline, + 'The new building provides twenty-five parking spaces. [S1]', + ); + expect(a.sources.map((AnswerSource s) => s.title), [ + 'Floor plan notes', + ]); + }); + + test('contract/en1-b#0 : « User\'s response: » sur sa ligne : retiré', () { + expect( + parse('contract/en1-b#0').headline, + 'The new building offers 25 parking spaces. [S1]', + ); + }); + + test('clean/en1-b#0 : « User: » en tête de ligne retiré ; [S2] non ' + 'fourni retiré', () { + final ParsedAnswer a = parse('clean/en1-b#0'); + expect(a.headline, 'The new building has 25 parking spaces.'); + expect(a.sources, isEmpty); + }); + + for (final String raw in [ + 'Answer: The notice period is 90 days [S1].', + 'Réponse : Le préavis est de 90 jours [S1].', + 'Réponse :\nLe préavis est de 90 jours [S1].', + ]) { + test( + 'préambule « ${raw.split(':').first} : » jamais pris pour la tête', + () { + final ParsedAnswer a = parseAnswer( + raw, + probe('contract/fr1-a1#0').excerpts, + ); + expect(a.headline, isNot(startsWith('Answer'))); + expect(a.headline, isNot(startsWith('Réponse'))); + expect(a.headline, contains('90')); + }, + ); + } + + test('contract/fr2-b#0 : citations [S3], [S39] sans extrait fourni : ' + 'retirées', () { + final ParsedAnswer a = parse('contract/fr2-b#0'); + expect(a.text, isNot(contains('[S'))); + expect(a.sources, isEmpty); + }); + }); + + group('4. troncature', () { + for (final String key in [ + 'contract/fr1-b#0', + 'contract/en3-b#0', + 'contract/en3-b#1', + 'contract/en2-b#1', + ]) { + test('$key : dernière ligne sans point final : PAS tronquée', () { + expect(parse(key).truncated, isFalse, reason: probe(key).raw); + }); + } + }); +} diff --git a/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart b/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart index de4ce73f..c628e7be 100644 --- a/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart +++ b/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart @@ -283,10 +283,10 @@ void main() { ) async { await pumpLive(tester); await ask(tester); - h.llm.last.reply('La livraison est prévue pour le lot 1 au début du mo'); + h.llm.last.reply('La livraison est prévue pour le lot 1 au début du'); await settle(tester); - expect(find.textContaining('au début du mo'), findsOneWidget); + expect(find.textContaining('au début du'), findsOneWidget); expect(find.text('live_answers.truncated'.tr()), findsOneWidget); }); diff --git a/apps/app_macos/test/fixtures/live_answers/mistral_probe_outputs.json b/apps/app_macos/test/fixtures/live_answers/mistral_probe_outputs.json new file mode 100644 index 00000000..45faafe9 --- /dev/null +++ b/apps/app_macos/test/fixtures/live_answers/mistral_probe_outputs.json @@ -0,0 +1,1530 @@ +{ + "source": "mistral 7B via Ollama, live answers probe, 2026-11-23 (invented meeting content)", + "outputs": [ + { + "key": "contract/fr1-a1#0", + "kind": "a", + "lang": "fr", + "question": "Est-ce que tu sais quel est le préavis de résiliation du contrat d'hébergement de l'ancien outil ?", + "excerpts": [ + { + "documentId": "fr1-a1-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + }, + { + "documentId": "fr1-a1-S2", + "documentTitle": "Contrat d'hébergement", + "text": "Le contrat est conclu pour une durée d'un an, renouvelable tacitement. Chaque partie peut le résilier par lettre recommandée avec un préavis de 90 jours avant l'échéance." + } + ], + "raw": " The user can find the notice period for termination of the old tool's hosting contract in the contract document.\n\n- The hosting contract is for a duration of one year [S2]\n- The termination notice period is 90 days [S2]" + }, + { + "key": "contract/fr1-a2#0", + "kind": "a", + "lang": "fr", + "question": "Et la nouvelle offre, elle coûte combien par utilisateur ?", + "excerpts": [ + { + "documentId": "fr1-a2-S1", + "documentTitle": "Grille tarifaire du prestataire", + "text": "Offre standard : 4,20 € par utilisateur et par mois, facturés à l'année. La formation initiale et la fiche de prise en main sont incluses." + }, + { + "documentId": "fr1-a2-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " The new offer costs 4.20 euros per user and per month, billed annually [S1].\n\n- The cost per user is stated in the tariff grid provided by the vendor.\n- The cost includes initial training and a user guide.\n- The annual billing is based on a 12-month period." + }, + { + "key": "contract/fr1-b#0", + "kind": "b", + "lang": "fr", + "question": "Tu me rappelles combien de personnes participent au pilote ?", + "excerpts": [ + { + "documentId": "fr1-b-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " Participants in the pilot: 40 people, divided between the 2nd and 3rd floor [S1]" + }, + { + "key": "contract/fr1-c#0", + "kind": "c", + "lang": "fr", + "question": "Quelle est la date prévue pour la recette avec le prestataire ?", + "excerpts": [ + { + "documentId": "fr1-c-S1", + "documentTitle": "Planning du projet", + "text": "La recette aura lieu après la phase pilote, à une date à confirmer avec le prestataire. La généralisation suivra la recette." + }, + { + "documentId": "fr1-c-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " Meeting Recap: New Room Booking Tool\n- The meeting is about discussing the replacement of the current room booking tool.\n- The main criticism of the current tool is that it does not export reservations to calendars.\n- A demo of the new tool was shown last week, and the export to calendars works, but only one-way.\n- The pilot test will include 40 people from the second and third floors.\n- Three short training sessions will be held a week before the launch, each session lasts half an hour.\n- The meeting with the supplier to discuss the implementation details will happen after the pilot phase, date to be confirmed.\n- The goal is to replace the current tool before the end of the year. [S2]\n- The budget per user needs to be determined before generalizing the new tool. [S1]" + }, + { + "key": "contract/fr2-a#0", + "kind": "a", + "lang": "fr", + "question": "Le gîte demande combien d'acompte à la signature du devis ?", + "excerpts": [ + { + "documentId": "fr2-a-S1", + "documentTitle": "Devis du gîte", + "text": "Hébergement de 45 personnes maximum et location de la grande salle pour deux jours : 5 500 €. Un acompte de 30 %, soit 1 650 €, est demandé à la signature." + }, + { + "documentId": "fr2-a-S2", + "documentTitle": "Programme provisoire", + "text": "Jeudi : arrivée à 10 h, atelier l'après-midi. Vendredi : matinée libre, dîner de clôture." + } + ], + "raw": " The gîte requires a 30% deposit, or 1650€, at the signature of the devis. [S1]" + }, + { + "key": "contract/fr2-b#0", + "kind": "b", + "lang": "fr", + "question": "On a combien de participants confirmés pour l'instant ?", + "excerpts": [], + "raw": " Confirmations: Thirty-five participants confirmed [S3]\nResponse: Thirty-five participants have confirmed their attendance so far. [S3]\n[S39] The gîte can accommodate up to forty-five people, so there is room for more. [S2]\n\nIf needed: There are still some responses awaiting [S3] and the total number of participants might increase. [S39]" + }, + { + "key": "contract/fr2-c#0", + "kind": "c", + "lang": "fr", + "question": "Quel traiteur on a retenu pour le dîner du vendredi ?", + "excerpts": [ + { + "documentId": "fr2-c-S1", + "documentTitle": "Informations du gîte", + "text": "Restauration : le gîte tient à disposition une liste de traiteurs partenaires. Le choix du traiteur doit être communiqué au plus tard un mois avant l'arrivée." + } + ], + "raw": " Choosing the caterer for the Friday dinner\n- The user should check the list of partner caterers provided by the lodge, as stated in document S1.\n- The choice of the caterer must be communicated at least one month before arrival.\n- The user should confirm the selected caterer and communicate it to the group." + }, + { + "key": "contract/fr2-d#0", + "kind": "d", + "lang": "fr", + "question": "Franchement, qui aurait cru qu'on arriverait un jour à caler une date avec tout le monde ?", + "excerpts": [], + "raw": " Who managed to schedule a date with everyone?\n\n- The team has confirmed the dates for the seminar: Thursday 12th and Friday 13th of June\n- Thirty-five participants have confirmed their attendance, with more responses pending\n- The user is arranging transportation by car and expects to receive two quotes by the following week\n- The team needs to decide on a caterer for the Friday dinner\n- The user has saved the quote from the gîte for accommodation and room rental in a shared folder\n- A first version of the program will be prepared and sent by the user in the upcoming week\n- The user reminds that the gîte's reservation is not guaranteed unless the invoice is signed before the end of the month" + }, + { + "key": "contract/fr3-a#0", + "kind": "a", + "lang": "fr", + "question": "Tu sais quelle est la taille maximale autorisée pour les pièces jointes ?", + "excerpts": [ + { + "documentId": "fr3-a-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + }, + { + "documentId": "fr3-a-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + }, + { + "documentId": "fr3-a-S3", + "documentTitle": "Politique de sécurité mobile", + "text": "Les pièces jointes envoyées depuis l'application sont limitées à 15 Mo par fichier. Les fichiers exécutables sont refusés." + } + ], + "raw": " Taille maximale autorisée pour les pièces jointes : 15 Mo par fichier [S3]\n- The policy on mobile security restricts file sizes for attachments sent from the application.\n- The limit is 15 MB per file.\n- This information can be found in the mobile security policy document." + }, + { + "key": "contract/fr3-b#0", + "kind": "b", + "lang": "fr", + "question": "Combien de tickets l'équipe a fermés sur ce sprint ?", + "excerpts": [ + { + "documentId": "fr3-b-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + } + ], + "raw": " L'équipe a fermé dix-huit tickets dans le dernier sprint [S1]." + }, + { + "key": "contract/fr3-c#0", + "kind": "c", + "lang": "fr", + "question": "Quel est le taux de crash de la version 2.4 en production ?", + "excerpts": [ + { + "documentId": "fr3-c-S1", + "documentTitle": "Suivi qualité", + "text": "Le taux de crash est mesuré chaque semaine sur la version en production et présenté au point qualité mensuel." + }, + { + "documentId": "fr3-c-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + } + ], + "raw": " Taux de crash de la version 2.4 en production\n- Le taux de crash est mesuré chaque semaine sur la version en production.\n- Il sera présenté au point qualité mensuel.\n- Les chiffres n'ont pas été mentionnés dans le contexte de la réunion." + }, + { + "key": "contract/fr3-d#0", + "kind": "d", + "lang": "fr", + "question": "Comment on a corrigé le bug de synchro je vous le montre juste après sur l'écran partagé", + "excerpts": [], + "raw": " How to address the bug of synchronization:\n- The user mentioned that the corrective for the synchronization bug is ready and is currently under review.\n- The user did not specify the details of how the corrective was made.\n- The user will show the solution to the bug after the current presentation. [S2]" + }, + { + "key": "contract/en1-a1#0", + "kind": "a", + "lang": "en", + "question": "Do you know how much notice we have to give on the current lease?", + "excerpts": [ + { + "documentId": "en1-a1-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a1-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " Notice on the current lease requires six months [S2]." + }, + { + "key": "contract/en1-a2#0", + "kind": "a", + "lang": "en", + "question": "How many meeting rooms does the new floor have?", + "excerpts": [ + { + "documentId": "en1-a2-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a2-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " The new floor has nine meeting rooms [S1]." + }, + { + "key": "contract/en1-b#0", + "kind": "b", + "lang": "en", + "question": "Remind me, how many parking spaces did we get in the new building?", + "excerpts": [ + { + "documentId": "en1-b-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " User's response:\nThe new building offers 25 parking spaces. [S1]" + }, + { + "key": "contract/en1-c#0", + "kind": "c", + "lang": "en", + "question": "What's the total budget approved for the new furniture?", + "excerpts": [ + { + "documentId": "en1-c-S1", + "documentTitle": "Furniture plan", + "text": "Quotes for desks and chairs are expected from three suppliers by the end of the month. The furniture budget will then be approved by the steering group." + }, + { + "documentId": "en1-c-S2", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " Approved furniture budget is not determined yet [S1]." + }, + { + "key": "contract/en2-a#0", + "kind": "a", + "lang": "en", + "question": "What does our support policy say about weekend coverage?", + "excerpts": [ + { + "documentId": "en2-a-S1", + "documentTitle": "Support policy", + "text": "Weekend coverage is limited to priority-one incidents. These receive a first response within 8 hours on Saturdays and Sundays." + }, + { + "documentId": "en2-a-S2", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Our support policy states weekend coverage is limited to priority-one incidents. [S1]" + }, + { + "key": "contract/en2-b#0", + "kind": "b", + "lang": "en", + "question": "What was our average first response time last month?", + "excerpts": [ + { + "documentId": "en2-b-S1", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Average first response time last month was four hours [S2]." + }, + { + "key": "contract/en2-c#0", + "kind": "c", + "lang": "en", + "question": "How much does the chatbot vendor charge per conversation?", + "excerpts": [ + { + "documentId": "en2-c-S1", + "documentTitle": "Chatbot pilot brief", + "text": "The pilot covers billing questions only. Pricing is usage-based; the vendor will share its price list at the end of the pilot." + } + ], + "raw": " Chatbot Vendor Pricing [S1]\n- The cost per conversation is not provided in the given excerpt.\n- The vendor will share its price list at the end of the pilot.\n- It is recommended to wait for the full pilot data before making decisions on extending or evaluating the cost." + }, + { + "key": "contract/en2-d#0", + "kind": "d", + "lang": "en", + "question": "Can everyone see the shared dashboard on their side now?", + "excerpts": [], + "raw": " User: Yes, here's how to access it:\n- Open the shared folder on the collaboration platform\n- Look for the document named \"Shared Dashboard\"\n- Click on the link to open the dashboard\n- If prompted, sign in with your work credentials\n- Refresh the page if needed for the latest data to load." + }, + { + "key": "contract/en3-a#0", + "kind": "a", + "lang": "en", + "question": "How long do we keep raw event data according to the policy?", + "excerpts": [ + { + "documentId": "en3-a-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + }, + { + "documentId": "en3-a-S2", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + }, + { + "documentId": "en3-a-S3", + "documentTitle": "Data retention policy", + "text": "Raw event data is kept for 13 months and then deleted. Aggregated data is kept for five years." + } + ], + "raw": " We keep raw event data for 13 months according to the data retention policy [S3]." + }, + { + "key": "contract/en3-b#0", + "kind": "b", + "lang": "en", + "question": "How many engineers are assigned to the warehouse migration?", + "excerpts": [ + { + "documentId": "en3-b-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + } + ], + "raw": " Two engineers are assigned to the warehouse migration full time. [00:00:52]" + }, + { + "key": "contract/en3-c#0", + "kind": "c", + "lang": "en", + "question": "What will the new warehouse cost us per terabyte?", + "excerpts": [ + { + "documentId": "en3-c-S1", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + } + ], + "raw": " The new warehouse cost per terabyte is not explicitly stated in the provided information. [S1] mentions that the detailed rate card is an annex of the contract, so the cost per terabyte can be found there." + }, + { + "key": "contract/en3-d#0", + "kind": "d", + "lang": "en", + "question": "What I want us to remember from this quarter is that the migration comes first", + "excerpts": [], + "raw": " Migration is the top priority this quarter.\n- The goal is to move everything to the new warehouse by the end of the second quarter.\n- Two engineers are assigned to the warehouse migration full time, with the analytics team assisting with testing." + }, + { + "key": "contract/fr1-a1#1", + "kind": "a", + "lang": "fr", + "question": "Est-ce que tu sais quel est le préavis de résiliation du contrat d'hébergement de l'ancien outil ?", + "excerpts": [ + { + "documentId": "fr1-a1-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + }, + { + "documentId": "fr1-a1-S2", + "documentTitle": "Contrat d'hébergement", + "text": "Le contrat est conclu pour une durée d'un an, renouvelable tacitement. Chaque partie peut le résilier par lettre recommandée avec un préavis de 90 jours avant l'échéance." + } + ], + "raw": " The contract notice period for the old tool's hosting agreement is 90 days.\n- [S2] indicates the contract duration and termination notice\n- The contract is for a year, renewable tacitly\n- Each party can terminate the contract with a 90-day notice before the end date." + }, + { + "key": "contract/fr1-a2#1", + "kind": "a", + "lang": "fr", + "question": "Et la nouvelle offre, elle coûte combien par utilisateur ?", + "excerpts": [ + { + "documentId": "fr1-a2-S1", + "documentTitle": "Grille tarifaire du prestataire", + "text": "Offre standard : 4,20 € par utilisateur et par mois, facturés à l'année. La formation initiale et la fiche de prise en main sont incluses." + }, + { + "documentId": "fr1-a2-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " The cost of the new offer is 4.20 € per user per month, billed annually, as per the pricing grid of the provider [S1]." + }, + { + "key": "contract/fr1-b#1", + "kind": "b", + "lang": "fr", + "question": "Tu me rappelles combien de personnes participent au pilote ?", + "excerpts": [ + { + "documentId": "fr1-b-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " The user's pilot involves 40 participants, divided between the second and third floors. [S1]" + }, + { + "key": "contract/fr1-c#1", + "kind": "c", + "lang": "fr", + "question": "Quelle est la date prévue pour la recette avec le prestataire ?", + "excerpts": [ + { + "documentId": "fr1-c-S1", + "documentTitle": "Planning du projet", + "text": "La recette aura lieu après la phase pilote, à une date à confirmer avec le prestataire. La généralisation suivra la recette." + }, + { + "documentId": "fr1-c-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " Date of meeting with vendor for review [S1]\n- The meeting with the vendor for review is scheduled after the pilot phase, date to be confirmed with the vendor.\n- The generalization of the new tool follows the review.\n- The current plan aims to replace the current booking tool by the end of the year [S2]." + }, + { + "key": "contract/fr2-a#1", + "kind": "a", + "lang": "fr", + "question": "Le gîte demande combien d'acompte à la signature du devis ?", + "excerpts": [ + { + "documentId": "fr2-a-S1", + "documentTitle": "Devis du gîte", + "text": "Hébergement de 45 personnes maximum et location de la grande salle pour deux jours : 5 500 €. Un acompte de 30 %, soit 1 650 €, est demandé à la signature." + }, + { + "documentId": "fr2-a-S2", + "documentTitle": "Programme provisoire", + "text": "Jeudi : arrivée à 10 h, atelier l'après-midi. Vendredi : matinée libre, dîner de clôture." + } + ], + "raw": " The gîte demands a 30% deposit, which is 1650 €, at the signature of the devis [S1]." + }, + { + "key": "contract/fr2-b#1", + "kind": "b", + "lang": "fr", + "question": "On a combien de participants confirmés pour l'instant ?", + "excerpts": [], + "raw": " Confirmed participants: Thirty-five\n[00:00:39] Speaker 1: Côté inscriptions, j'ai relancé tout le monde lundi. Pour l'instant on a trente-cinq participants confirmés, et quelques réponses en attente." + }, + { + "key": "contract/fr2-c#1", + "kind": "c", + "lang": "fr", + "question": "Quel traiteur on a retenu pour le dîner du vendredi ?", + "excerpts": [ + { + "documentId": "fr2-c-S1", + "documentTitle": "Informations du gîte", + "text": "Restauration : le gîte tient à disposition une liste de traiteurs partenaires. Le choix du traiteur doit être communiqué au plus tard un mois avant l'arrivée." + } + ], + "raw": " Choosing a caterer for the Friday dinner\n- Refer to document [S1] for the list of partner caterers\n- Decision on the caterer should be made at least one month before arrival\n- User should communicate the chosen caterer as soon as possible" + }, + { + "key": "contract/fr2-d#1", + "kind": "d", + "lang": "fr", + "question": "Franchement, qui aurait cru qu'on arriverait un jour à caler une date avec tout le monde ?", + "excerpts": [], + "raw": " Who managed to coordinate a date with everyone?\n\n- The team successfully agreed on the dates for the seminar: Thursday 12th and Friday 13th of June\n- The devis for the lodge's accommodation and meeting room is in the shared folder\n- It is important to sign the lodge's devis before the end of the month to secure the reservation" + }, + { + "key": "contract/fr3-a#1", + "kind": "a", + "lang": "fr", + "question": "Tu sais quelle est la taille maximale autorisée pour les pièces jointes ?", + "excerpts": [ + { + "documentId": "fr3-a-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + }, + { + "documentId": "fr3-a-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + }, + { + "documentId": "fr3-a-S3", + "documentTitle": "Politique de sécurité mobile", + "text": "Les pièces jointes envoyées depuis l'application sont limitées à 15 Mo par fichier. Les fichiers exécutables sont refusés." + } + ], + "raw": " Taille maximale pour les pièces jointes : 15 Mo par fichier [S3]\n- The maximum size for attached files is 15 MB per file.\n- Files executables are refused in the mobile security policy.\n- This limit is stated in the \"Politique de sécurité mobile\"." + }, + { + "key": "contract/fr3-b#1", + "kind": "b", + "lang": "fr", + "question": "Combien de tickets l'équipe a fermés sur ce sprint ?", + "excerpts": [ + { + "documentId": "fr3-b-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + } + ], + "raw": " Number of tickets the team has closed in this sprint:\n- 18 tickets [S1]\n- Three tickets were postponed for the next sprint [00:00:13]\n- No new tickets were answered since the question was not addressed to the user [NO_ANSWER]" + }, + { + "key": "contract/fr3-c#1", + "kind": "c", + "lang": "fr", + "question": "Quel est le taux de crash de la version 2.4 en production ?", + "excerpts": [ + { + "documentId": "fr3-c-S1", + "documentTitle": "Suivi qualité", + "text": "Le taux de crash est mesuré chaque semaine sur la version en production et présenté au point qualité mensuel." + }, + { + "documentId": "fr3-c-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + } + ], + "raw": " Taux de crash de la version 2.4 en production n'est pas donné ici [S1]. Il sera présenté au prochain point qualité mensuel [S1]." + }, + { + "key": "contract/fr3-d#1", + "kind": "d", + "lang": "fr", + "question": "Comment on a corrigé le bug de synchro je vous le montre juste après sur l'écran partagé", + "excerpts": [], + "raw": " How to explain the fix for the synchronization bug:\n- Mention the cause found yesterday [S2]\n- Explain that the fix is currently under review [S2]\n- Show the fix during the presentation on the shared screen [S1, S4]" + }, + { + "key": "contract/en1-a1#1", + "kind": "a", + "lang": "en", + "question": "Do you know how much notice we have to give on the current lease?", + "excerpts": [ + { + "documentId": "en1-a1-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a1-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " Notice for current lease is six months [S2]." + }, + { + "key": "contract/en1-a2#1", + "kind": "a", + "lang": "en", + "question": "How many meeting rooms does the new floor have?", + "excerpts": [ + { + "documentId": "en1-a2-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a2-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " The new floor has nine meeting rooms. [S1]" + }, + { + "key": "contract/en1-b#1", + "kind": "b", + "lang": "en", + "question": "Remind me, how many parking spaces did we get in the new building?", + "excerpts": [ + { + "documentId": "en1-b-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " Number of parking spaces in the new building: 25 [00:01:18]\n- The building manager provided this information last week.\n- This was mentioned during the meeting.\n- It is stated in the floor plan notes of the user's documents." + }, + { + "key": "contract/en1-c#1", + "kind": "c", + "lang": "en", + "question": "What's the total budget approved for the new furniture?", + "excerpts": [ + { + "documentId": "en1-c-S1", + "documentTitle": "Furniture plan", + "text": "Quotes for desks and chairs are expected from three suppliers by the end of the month. The furniture budget will then be approved by the steering group." + }, + { + "documentId": "en1-c-S2", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " The total budget approved for the new furniture is not yet available. [S1]" + }, + { + "key": "contract/en2-a#1", + "kind": "a", + "lang": "en", + "question": "What does our support policy say about weekend coverage?", + "excerpts": [ + { + "documentId": "en2-a-S1", + "documentTitle": "Support policy", + "text": "Weekend coverage is limited to priority-one incidents. These receive a first response within 8 hours on Saturdays and Sundays." + }, + { + "documentId": "en2-a-S2", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Our support policy covers weekend service with a first response within 8 hours for priority-one incidents only [S1].\n\n- The support policy does not specify general weekend coverage for all inquiries.\n- Priority-one incidents are the only inquiries guaranteed a response during weekends.\n- It is important to clarify this when addressing customer inquiries about weekend service." + }, + { + "key": "contract/en2-b#1", + "kind": "b", + "lang": "en", + "question": "What was our average first response time last month?", + "excerpts": [ + { + "documentId": "en2-b-S1", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Average first response time last month was four hours. [S0:00:13]" + }, + { + "key": "contract/en2-c#1", + "kind": "c", + "lang": "en", + "question": "How much does the chatbot vendor charge per conversation?", + "excerpts": [ + { + "documentId": "en2-c-S1", + "documentTitle": "Chatbot pilot brief", + "text": "The pilot covers billing questions only. Pricing is usage-based; the vendor will share its price list at the end of the pilot." + } + ], + "raw": " Chatbot Vendor Pricing [S1]\n- The pricing for the chatbot vendor is usage-based.\n- The vendor will share its price list at the end of the pilot.\n- No specific information about the cost per conversation is available yet." + }, + { + "key": "contract/en2-d#1", + "kind": "d", + "lang": "en", + "question": "Can everyone see the shared dashboard on their side now?", + "excerpts": [], + "raw": " Everyone can see the shared dashboard now.\n\n- Check that the dashboard is visible for all participants\n- Confirm if any issues are reported\n- If any, address and ensure visibility for all" + }, + { + "key": "contract/en3-a#1", + "kind": "a", + "lang": "en", + "question": "How long do we keep raw event data according to the policy?", + "excerpts": [ + { + "documentId": "en3-a-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + }, + { + "documentId": "en3-a-S2", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + }, + { + "documentId": "en3-a-S3", + "documentTitle": "Data retention policy", + "text": "Raw event data is kept for 13 months and then deleted. Aggregated data is kept for five years." + } + ], + "raw": " Warehouse migration priority [00:00:26]\n- Two engineers and the analytics team assigned\n- Goal: complete by the end of the second quarter\n\nPipeline cleanup [00:01:44]\n- List forty jobs and give two weeks for teams to claim ownership\n- Deprecated reporting dashboard in April\n\nData retention policy [S3]\n- Keep raw event data for 13 months and then delete\n- Aggregated data kept for five years" + }, + { + "key": "contract/en3-b#1", + "kind": "b", + "lang": "en", + "question": "How many engineers are assigned to the warehouse migration?", + "excerpts": [ + { + "documentId": "en3-b-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + } + ], + "raw": " Two engineers are assigned to the warehouse migration full time. [00:00:52]" + }, + { + "key": "contract/en3-c#1", + "kind": "c", + "lang": "en", + "question": "What will the new warehouse cost us per terabyte?", + "excerpts": [ + { + "documentId": "en3-c-S1", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + } + ], + "raw": " The new warehouse cost per terabyte can be found in the detailed rate card, which is an annex of the contract. [S1]" + }, + { + "key": "contract/en3-d#1", + "kind": "d", + "lang": "en", + "question": "What I want us to remember from this quarter is that the migration comes first", + "excerpts": [], + "raw": " Migration is the top priority for this quarter.\n- Focus on the warehouse migration first.\n- Goal: Move everything to the new warehouse by the end of the second quarter.\n- Two engineers and the analytics team are assigned to the migration. [00:00:26, 00:00:39, 00:00:52]" + }, + { + "key": "contract/fr1-a1#2", + "kind": "a", + "lang": "fr", + "question": "Est-ce que tu sais quel est le préavis de résiliation du contrat d'hébergement de l'ancien outil ?", + "excerpts": [ + { + "documentId": "fr1-a1-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + }, + { + "documentId": "fr1-a1-S2", + "documentTitle": "Contrat d'hébergement", + "text": "Le contrat est conclu pour une durée d'un an, renouvelable tacitement. Chaque partie peut le résilier par lettre recommandée avec un préavis de 90 jours avant l'échéance." + } + ], + "raw": " The user knows the notice period for termination of the old tool's hosting contract.\n- The contract duration is one year, renewable tacitly.\n- Each party can terminate the contract with a 90-day notice before the expiration date [S2]." + }, + { + "key": "contract/fr1-a2#2", + "kind": "a", + "lang": "fr", + "question": "Et la nouvelle offre, elle coûte combien par utilisateur ?", + "excerpts": [ + { + "documentId": "fr1-a2-S1", + "documentTitle": "Grille tarifaire du prestataire", + "text": "Offre standard : 4,20 € par utilisateur et par mois, facturés à l'année. La formation initiale et la fiche de prise en main sont incluses." + }, + { + "documentId": "fr1-a2-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " La nouvelle offre coûte 4,20 € par utilisateur et par mois, facturés à l'année [S1]." + }, + { + "key": "contract/fr1-b#2", + "kind": "b", + "lang": "fr", + "question": "Tu me rappelles combien de personnes participent au pilote ?", + "excerpts": [ + { + "documentId": "fr1-b-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " Number of participants in the pilot: 40 people\n\n- The pilot involves 40 users, distributed between the second and third floors.\n- The list of participants will be shared after the meeting.\n- The information is found in the project alignment note [S1]." + }, + { + "key": "contract/fr1-c#2", + "kind": "c", + "lang": "fr", + "question": "Quelle est la date prévue pour la recette avec le prestataire ?", + "excerpts": [ + { + "documentId": "fr1-c-S1", + "documentTitle": "Planning du projet", + "text": "La recette aura lieu après la phase pilote, à une date à confirmer avec le prestataire. La généralisation suivra la recette." + }, + { + "documentId": "fr1-c-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " Date of the meeting with the vendor ([S1]) is yet to be confirmed." + }, + { + "key": "contract/fr2-a#2", + "kind": "a", + "lang": "fr", + "question": "Le gîte demande combien d'acompte à la signature du devis ?", + "excerpts": [ + { + "documentId": "fr2-a-S1", + "documentTitle": "Devis du gîte", + "text": "Hébergement de 45 personnes maximum et location de la grande salle pour deux jours : 5 500 €. Un acompte de 30 %, soit 1 650 €, est demandé à la signature." + }, + { + "documentId": "fr2-a-S2", + "documentTitle": "Programme provisoire", + "text": "Jeudi : arrivée à 10 h, atelier l'après-midi. Vendredi : matinée libre, dîner de clôture." + } + ], + "raw": " The gîte requires a 30% deposit, or 1,650 €, at the signature of the devis [S1]." + }, + { + "key": "contract/fr2-b#2", + "kind": "b", + "lang": "fr", + "question": "On a combien de participants confirmés pour l'instant ?", + "excerpts": [], + "raw": " Participants Confirmed\n- The user mentioned 35 participants are confirmed.\n- A few more responses are awaited.\n- The user suggested signing the gîte's reservation before the end of the month to ensure confirmation. [User, 00:02:36]" + }, + { + "key": "contract/fr2-c#2", + "kind": "c", + "lang": "fr", + "question": "Quel traiteur on a retenu pour le dîner du vendredi ?", + "excerpts": [ + { + "documentId": "fr2-c-S1", + "documentTitle": "Informations du gîte", + "text": "Restauration : le gîte tient à disposition une liste de traiteurs partenaires. Le choix du traiteur doit être communiqué au plus tard un mois avant l'arrivée." + } + ], + "raw": " Choosing a caterer for the Friday dinner\n- The user should check their documents for a list of partner caterers [S1]\n- They should communicate the choice of caterer to the gite at least one month before the arrival\n- The user should send the decision to the group for confirmation" + }, + { + "key": "contract/fr2-d#2", + "kind": "d", + "lang": "fr", + "question": "Franchement, qui aurait cru qu'on arriverait un jour à caler une date avec tout le monde ?", + "excerpts": [], + "raw": " The question is a comment, not a question. Here's a possible response for the user if they wanted to respond:\n\n- Achieving a consensus on the dates took some time\n- Everyone's schedules had to be coordinated\n- The agreed-upon dates are June 12th and 13th, with arrival on the 12th at 10:00 AM\n\n[S1: 00:00:39, 00:00:26]" + }, + { + "key": "contract/fr3-a#2", + "kind": "a", + "lang": "fr", + "question": "Tu sais quelle est la taille maximale autorisée pour les pièces jointes ?", + "excerpts": [ + { + "documentId": "fr3-a-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + }, + { + "documentId": "fr3-a-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + }, + { + "documentId": "fr3-a-S3", + "documentTitle": "Politique de sécurité mobile", + "text": "Les pièces jointes envoyées depuis l'application sont limitées à 15 Mo par fichier. Les fichiers exécutables sont refusés." + } + ], + "raw": " The maximum authorized size for attached files is 15 MB, according to the Mobile Security Policy [S3]." + }, + { + "key": "contract/fr3-b#2", + "kind": "b", + "lang": "fr", + "question": "Combien de tickets l'équipe a fermés sur ce sprint ?", + "excerpts": [ + { + "documentId": "fr3-b-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + } + ], + "raw": " The number of tickets the team closed in this sprint is eighteen. [S1] does not contain the answer." + }, + { + "key": "contract/fr3-c#2", + "kind": "c", + "lang": "fr", + "question": "Quel est le taux de crash de la version 2.4 en production ?", + "excerpts": [ + { + "documentId": "fr3-c-S1", + "documentTitle": "Suivi qualité", + "text": "Le taux de crash est mesuré chaque semaine sur la version en production et présenté au point qualité mensuel." + }, + { + "documentId": "fr3-c-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + } + ], + "raw": " Taux de crash de la version 2.4 en production\n- Ne connaît pas le taux actuel [00:02:36]\n- Le taux est mesuré chaque semaine [S1]\n- Le taux sera vu au prochain point [00:02:49]" + }, + { + "key": "contract/fr3-d#2", + "kind": "d", + "lang": "fr", + "question": "Comment on a corrigé le bug de synchro je vous le montre juste après sur l'écran partagé", + "excerpts": [], + "raw": " Solution has been prepared, currently under review\n\n- The bug of synchronization was found to be caused by two recordings arriving out of order.\n- A corrective has been prepared and is currently under review.\n- It will be demonstrated after the current presentation on the shared screen." + }, + { + "key": "contract/en1-a1#2", + "kind": "a", + "lang": "en", + "question": "Do you know how much notice we have to give on the current lease?", + "excerpts": [ + { + "documentId": "en1-a1-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a1-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " Notice period for the current lease is six months. [S2]" + }, + { + "key": "contract/en1-a2#2", + "kind": "a", + "lang": "en", + "question": "How many meeting rooms does the new floor have?", + "excerpts": [ + { + "documentId": "en1-a2-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a2-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " The new floor has nine meeting rooms [S1]." + }, + { + "key": "contract/en1-b#2", + "kind": "b", + "lang": "en", + "question": "Remind me, how many parking spaces did we get in the new building?", + "excerpts": [ + { + "documentId": "en1-b-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " Number of parking spaces in the new building: 25 [00:01:18]\n\n- The building manager informed about the parking spaces last week.\n- Twenty-five spaces are available in the underground car park.\n- The user mentioned this information earlier in the meeting." + }, + { + "key": "contract/en1-c#2", + "kind": "c", + "lang": "en", + "question": "What's the total budget approved for the new furniture?", + "excerpts": [ + { + "documentId": "en1-c-S1", + "documentTitle": "Furniture plan", + "text": "Quotes for desks and chairs are expected from three suppliers by the end of the month. The furniture budget will then be approved by the steering group." + }, + { + "documentId": "en1-c-S2", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " Total budget for new furniture is not yet approved. [S1]" + }, + { + "key": "contract/en2-a#2", + "kind": "a", + "lang": "en", + "question": "What does our support policy say about weekend coverage?", + "excerpts": [ + { + "documentId": "en2-a-S1", + "documentTitle": "Support policy", + "text": "Weekend coverage is limited to priority-one incidents. These receive a first response within 8 hours on Saturdays and Sundays." + }, + { + "documentId": "en2-a-S2", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Support policy states weekend coverage is limited to priority-one incidents [S1]." + }, + { + "key": "contract/en2-b#2", + "kind": "b", + "lang": "en", + "question": "What was our average first response time last month?", + "excerpts": [ + { + "documentId": "en2-b-S1", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Average first response time last month was four hours [S1] (User, 00:00:01)" + }, + { + "key": "contract/en2-c#2", + "kind": "c", + "lang": "en", + "question": "How much does the chatbot vendor charge per conversation?", + "excerpts": [ + { + "documentId": "en2-c-S1", + "documentTitle": "Chatbot pilot brief", + "text": "The pilot covers billing questions only. Pricing is usage-based; the vendor will share its price list at the end of the pilot." + } + ], + "raw": " Chatbot Vendor Charges per Usage [S1]\n- The pricing for the chatbot is usage-based\n- The vendor will share its price list at the end of the pilot\n- No specific cost per conversation is given yet." + }, + { + "key": "contract/en2-d#2", + "kind": "d", + "lang": "en", + "question": "Can everyone see the shared dashboard on their side now?", + "excerpts": [], + "raw": " User: Yes, everyone should be able to see the shared dashboard now.\n[00:02:49] Speaker 1: Can everyone see the shared dashboard on their side now?\n- The shared dashboard is accessible.\n- It contains the customer support tooling review data.\n- Everyone can follow the progress of the chatbot pilot." + }, + { + "key": "contract/en3-a#2", + "kind": "a", + "lang": "en", + "question": "How long do we keep raw event data according to the policy?", + "excerpts": [ + { + "documentId": "en3-a-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + }, + { + "documentId": "en3-a-S2", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + }, + { + "documentId": "en3-a-S3", + "documentTitle": "Data retention policy", + "text": "Raw event data is kept for 13 months and then deleted. Aggregated data is kept for five years." + } + ], + "raw": " Data Retention Policy Length [S3]\n- Raw event data is kept for 13 months and then deleted." + }, + { + "key": "contract/en3-b#2", + "kind": "b", + "lang": "en", + "question": "How many engineers are assigned to the warehouse migration?", + "excerpts": [ + { + "documentId": "en3-b-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + } + ], + "raw": " Two engineers are assigned to the warehouse migration [S1]." + }, + { + "key": "contract/en3-c#2", + "kind": "c", + "lang": "en", + "question": "What will the new warehouse cost us per terabyte?", + "excerpts": [ + { + "documentId": "en3-c-S1", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + } + ], + "raw": " New warehouse cost per terabyte not provided in the provided excerpts.\n\n- Review the detailed rate card in the contract for the storage cost per terabyte.\n- The pricing summary only provides a summary, not the actual table.\n- Share the detailed rate card with the necessary team members to obtain the required cost information." + }, + { + "key": "contract/en3-d#2", + "kind": "d", + "lang": "en", + "question": "What I want us to remember from this quarter is that the migration comes first", + "excerpts": [], + "raw": " Migration is the top priority for this quarter.\n- The goal is to move everything to the new warehouse by the end of the second quarter.\n- Two engineers are assigned full time to the warehouse migration, with the analytics team providing assistance for testing." + }, + { + "key": "clean/fr1-a1#0", + "kind": "a", + "lang": "fr", + "question": "Est-ce que tu sais quel est le préavis de résiliation du contrat d'hébergement de l'ancien outil ?", + "excerpts": [ + { + "documentId": "fr1-a1-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + }, + { + "documentId": "fr1-a1-S2", + "documentTitle": "Contrat d'hébergement", + "text": "Le contrat est conclu pour une durée d'un an, renouvelable tacitement. Chaque partie peut le résilier par lettre recommandée avec un préavis de 90 jours avant l'échéance." + } + ], + "raw": " The user knows the notice period for termination of the old tool's hosting contract.\n\n- The term is 90 days, according to the Hosting Contract document [S2].\n- The user should check the specific notice requirements in the contract.\n- The new tool's pilot is scheduled for March 14th." + }, + { + "key": "clean/fr1-a2#0", + "kind": "a", + "lang": "fr", + "question": "Et la nouvelle offre, elle coûte combien par utilisateur ?", + "excerpts": [ + { + "documentId": "fr1-a2-S1", + "documentTitle": "Grille tarifaire du prestataire", + "text": "Offre standard : 4,20 € par utilisateur et par mois, facturés à l'année. La formation initiale et la fiche de prise en main sont incluses." + }, + { + "documentId": "fr1-a2-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " The new offer costs 4.20 € per user per month, billed annually according to the pricing grid of the provider [S1].\n\n- The cost includes initial training and a user guide.\n- The per-user cost does not include any additional fees for the pilot or further training sessions.\n- The cost is subject to annual billing." + }, + { + "key": "clean/fr1-b#0", + "kind": "b", + "lang": "fr", + "question": "Tu me rappelles combien de personnes participent au pilote ?", + "excerpts": [ + { + "documentId": "fr1-b-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " User participates in the pilot with 40 people, split between the 2nd and 3rd floor [S1]." + }, + { + "key": "clean/fr1-c#0", + "kind": "c", + "lang": "fr", + "question": "Quelle est la date prévue pour la recette avec le prestataire ?", + "excerpts": [ + { + "documentId": "fr1-c-S1", + "documentTitle": "Planning du projet", + "text": "La recette aura lieu après la phase pilote, à une date à confirmer avec le prestataire. La généralisation suivra la recette." + }, + { + "documentId": "fr1-c-S2", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + } + ], + "raw": " Date de la recette avec le prestataire non spécifiée, à confirmer [S1].\n- La recette aura lieu après la phase pilote.\n- La généralisation du nouveau outil de réservation de salles suivra la recette." + }, + { + "key": "clean/fr2-a#0", + "kind": "a", + "lang": "fr", + "question": "Le gîte demande combien d'acompte à la signature du devis ?", + "excerpts": [ + { + "documentId": "fr2-a-S1", + "documentTitle": "Devis du gîte", + "text": "Hébergement de 45 personnes maximum et location de la grande salle pour deux jours : 5 500 €. Un acompte de 30 %, soit 1 650 €, est demandé à la signature." + }, + { + "documentId": "fr2-a-S2", + "documentTitle": "Programme provisoire", + "text": "Jeudi : arrivée à 10 h, atelier l'après-midi. Vendredi : matinée libre, dîner de clôture." + } + ], + "raw": " The gîte requires a deposit of 1650 € at the signing of the devis. [S1]" + }, + { + "key": "clean/fr2-b#0", + "kind": "b", + "lang": "fr", + "question": "On a combien de participants confirmés pour l'instant ?", + "excerpts": [], + "raw": " Confirmation of Participants:\n- Thirty-five participants have confirmed their attendance.\n- Some responses are still pending.\n- The total capacity of the lodge is forty-five people, leaving room for more attendees." + }, + { + "key": "clean/fr2-c#0", + "kind": "c", + "lang": "fr", + "question": "Quel traiteur on a retenu pour le dîner du vendredi ?", + "excerpts": [ + { + "documentId": "fr2-c-S1", + "documentTitle": "Informations du gîte", + "text": "Restauration : le gîte tient à disposition une liste de traiteurs partenaires. Le choix du traiteur doit être communiqué au plus tard un mois avant l'arrivée." + } + ], + "raw": " The user has not chosen a caterer for the dinner on Friday. [S1]\n\n- User needs to choose a caterer from the list provided by the lodge.\n- The choice of caterer should be communicated to the lodge at least one month before arrival.\n- User should communicate the decision to the group as soon as possible." + }, + { + "key": "clean/fr2-d#0", + "kind": "d", + "lang": "fr", + "question": "Franchement, qui aurait cru qu'on arriverait un jour à caler une date avec tout le monde ?", + "excerpts": [], + "raw": " The question is a comment, not a question directed to the user.\n\n* NO_ANSWER\n* No answer is needed as it is a comment expressing surprise that everyone could agree on a date." + }, + { + "key": "clean/fr3-a#0", + "kind": "a", + "lang": "fr", + "question": "Tu sais quelle est la taille maximale autorisée pour les pièces jointes ?", + "excerpts": [ + { + "documentId": "fr3-a-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + }, + { + "documentId": "fr3-a-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + }, + { + "documentId": "fr3-a-S3", + "documentTitle": "Politique de sécurité mobile", + "text": "Les pièces jointes envoyées depuis l'application sont limitées à 15 Mo par fichier. Les fichiers exécutables sont refusés." + } + ], + "raw": " La taille maximale autorisée pour les pièces jointes est de 15 Mo par fichier [S3]." + }, + { + "key": "clean/fr3-b#0", + "kind": "b", + "lang": "fr", + "question": "Combien de tickets l'équipe a fermés sur ce sprint ?", + "excerpts": [ + { + "documentId": "fr3-b-S1", + "documentTitle": "Charte de développement", + "text": "Chaque correctif passe en relecture par une deuxième personne avant d'être fusionné. Les tickets reportés sont revus au début du sprint suivant." + } + ], + "raw": " Number of tickets closed by the team in this sprint\n- User mentioned that 18 tickets were closed [00:00:13]\n- Three tickets were postponed to the next sprint [00:00:26]\n- Therefore, 15 tickets were actually closed during this sprint [NO_ANSWER]" + }, + { + "key": "clean/fr3-c#0", + "kind": "c", + "lang": "fr", + "question": "Quel est le taux de crash de la version 2.4 en production ?", + "excerpts": [ + { + "documentId": "fr3-c-S1", + "documentTitle": "Suivi qualité", + "text": "Le taux de crash est mesuré chaque semaine sur la version en production et présenté au point qualité mensuel." + }, + { + "documentId": "fr3-c-S2", + "documentTitle": "Notes de version 2.4", + "text": "Nouveau formulaire de saisie, mode sombre, amélioration de la recherche. Version en test interne." + } + ], + "raw": " Taux de crash de la version 2.4 en production non disponible pour le moment [S1]. Il sera présenté au prochain point de suivi qualité. [S1]" + }, + { + "key": "clean/fr3-d#0", + "kind": "d", + "lang": "fr", + "question": "Comment on a corrigé le bug de synchro je vous le montre juste après sur l'écran partagé", + "excerpts": [], + "raw": " The bug of synchronization was corrected\n- The cause was found yesterday\n- A fix is ready and currently under review\n- It will be demonstrated shortly during the screen share" + }, + { + "key": "clean/en1-a1#0", + "kind": "a", + "lang": "en", + "question": "Do you know how much notice we have to give on the current lease?", + "excerpts": [ + { + "documentId": "en1-a1-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a1-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " Notice for the current lease requires six months [S2]." + }, + { + "key": "clean/en1-a2#0", + "kind": "a", + "lang": "en", + "question": "How many meeting rooms does the new floor have?", + "excerpts": [ + { + "documentId": "en1-a2-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + }, + { + "documentId": "en1-a2-S2", + "documentTitle": "Lease summary", + "text": "The lease runs until the end of next year. Either party may terminate it early with six months' written notice to the other party." + } + ], + "raw": " The new floor has nine meeting rooms. [S1]" + }, + { + "key": "clean/en1-b#0", + "kind": "b", + "lang": "en", + "question": "Remind me, how many parking spaces did we get in the new building?", + "excerpts": [ + { + "documentId": "en1-b-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " User: The new building has 25 parking spaces. [S2]" + }, + { + "key": "clean/en1-c#0", + "kind": "c", + "lang": "en", + "question": "What's the total budget approved for the new furniture?", + "excerpts": [ + { + "documentId": "en1-c-S1", + "documentTitle": "Furniture plan", + "text": "Quotes for desks and chairs are expected from three suppliers by the end of the month. The furniture budget will then be approved by the steering group." + }, + { + "documentId": "en1-c-S2", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " Total budget for new furniture is not yet approved. [S1]" + }, + { + "key": "clean/en2-a#0", + "kind": "a", + "lang": "en", + "question": "What does our support policy say about weekend coverage?", + "excerpts": [ + { + "documentId": "en2-a-S1", + "documentTitle": "Support policy", + "text": "Weekend coverage is limited to priority-one incidents. These receive a first response within 8 hours on Saturdays and Sundays." + }, + { + "documentId": "en2-a-S2", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Support policy states weekend coverage is limited to priority-one incidents, with a first response within 8 hours on Saturdays and Sundays. [S1]" + }, + { + "key": "clean/en2-b#0", + "kind": "b", + "lang": "en", + "question": "What was our average first response time last month?", + "excerpts": [ + { + "documentId": "en2-b-S1", + "documentTitle": "Onboarding plan", + "text": "New support agents spend two weeks shadowing senior colleagues before taking tickets on their own." + } + ], + "raw": " Average first response time last month was four hours [S0:00:13]." + }, + { + "key": "clean/en2-c#0", + "kind": "c", + "lang": "en", + "question": "How much does the chatbot vendor charge per conversation?", + "excerpts": [ + { + "documentId": "en2-c-S1", + "documentTitle": "Chatbot pilot brief", + "text": "The pilot covers billing questions only. Pricing is usage-based; the vendor will share its price list at the end of the pilot." + } + ], + "raw": " Chatbot Vendor's Charge Per Conversation (based on [S1])\n- The pilot's pricing is usage-based\n- The vendor will share its price list at the end of the pilot" + }, + { + "key": "clean/en2-d#0", + "kind": "d", + "lang": "en", + "question": "Can everyone see the shared dashboard on their side now?", + "excerpts": [], + "raw": " User can check if everyone can see the shared dashboard by asking them to confirm.\n\n- Ask participants to confirm they can see the shared dashboard.\n- If anyone is unable to view it, help them resolve the issue.\n- Verify that everyone can access the dashboard." + }, + { + "key": "clean/en3-a#0", + "kind": "a", + "lang": "en", + "question": "How long do we keep raw event data according to the policy?", + "excerpts": [ + { + "documentId": "en3-a-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + }, + { + "documentId": "en3-a-S2", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + }, + { + "documentId": "en3-a-S3", + "documentTitle": "Data retention policy", + "text": "Raw event data is kept for 13 months and then deleted. Aggregated data is kept for five years." + } + ], + "raw": " Warehouse data retention according to policy [S3]\n- Raw event data is kept for 13 months\n- Then deleted after that period" + }, + { + "key": "clean/en3-b#0", + "kind": "b", + "lang": "en", + "question": "How many engineers are assigned to the warehouse migration?", + "excerpts": [ + { + "documentId": "en3-b-S1", + "documentTitle": "Platform roadmap", + "text": "Second quarter: complete the warehouse migration and retire the old reporting dashboard." + } + ], + "raw": " Two engineers are assigned to the warehouse migration. [S1]" + }, + { + "key": "clean/en3-c#0", + "kind": "c", + "lang": "en", + "question": "What will the new warehouse cost us per terabyte?", + "excerpts": [ + { + "documentId": "en3-c-S1", + "documentTitle": "Warehouse pricing summary", + "text": "Storage and compute are billed separately. The detailed rate card is an annex of the contract." + } + ], + "raw": " New warehouse cost per terabyte is not provided in the provided excerpt. [S1] Only mentions a detailed rate card in the contract, not the actual number." + }, + { + "key": "clean/en3-d#0", + "kind": "d", + "lang": "en", + "question": "What I want us to remember from this quarter is that the migration comes first", + "excerpts": [], + "raw": " Migration Priorities:\n- The warehouse migration comes first\n- The goal is to move everything to the new warehouse by the end of the second quarter\n- Two engineers and the analytics team are assigned to the warehouse migration" + }, + { + "key": "cold/fr1-a1#0", + "kind": "a", + "lang": "fr", + "question": "Est-ce que tu sais quel est le préavis de résiliation du contrat d'hébergement de l'ancien outil ?", + "excerpts": [ + { + "documentId": "fr1-a1-S1", + "documentTitle": "Note de cadrage", + "text": "Le projet vise à remplacer l'outil de réservation des salles avant la fin de l'année. Le pilote réunit des utilisateurs de deux étages." + }, + { + "documentId": "fr1-a1-S2", + "documentTitle": "Contrat d'hébergement", + "text": "Le contrat est conclu pour une durée d'un an, renouvelable tacitement. Chaque partie peut le résilier par lettre recommandée avec un préavis de 90 jours avant l'échéance." + } + ], + "raw": " The notice period for termination of the old tool's hosting contract is 90 days, as stated in the hosting contract [S2]." + }, + { + "key": "cold/fr2-d#1", + "kind": "d", + "lang": "fr", + "question": "Franchement, qui aurait cru qu'on arriverait un jour à caler une date avec tout le monde ?", + "excerpts": [], + "raw": " Who would have thought we would ever agree on a date with everyone?\n- The dates for the seminar have been confirmed: Thursday 12th and Friday 13th June.\n- Thirty-five participants have confirmed their attendance, with a few more still waiting for a response.\n- The deadline for signing the lodge's reservation is at the end of the month." + }, + { + "key": "cold/en1-b#2", + "kind": "b", + "lang": "en", + "question": "Remind me, how many parking spaces did we get in the new building?", + "excerpts": [ + { + "documentId": "en1-b-S1", + "documentTitle": "Floor plan notes", + "text": "The fourth floor has nine meeting rooms, two of them with video equipment, and an open kitchen next to the lifts." + } + ], + "raw": " User's response:\n\nThe new building provides twenty-five parking spaces. [02:23 S1]" + } + ] +} \ No newline at end of file diff --git a/apps/app_macos/test/helpers/probe_outputs.dart b/apps/app_macos/test/helpers/probe_outputs.dart new file mode 100644 index 00000000..ecdee975 --- /dev/null +++ b/apps/app_macos/test/helpers/probe_outputs.dart @@ -0,0 +1,67 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:ici_transcript/application/services/documents/document_library.dart'; + +/// Une sortie réelle enregistrée par la sonde (mistral 7B en local, contenu +/// de réunion inventé) : la question posée, les extraits fournis au modèle +/// (`[S1]`… dans l'ordre), et le texte brut rendu. +final class ProbeOutput { + const ProbeOutput({ + required this.key, + required this.kind, + required this.lang, + required this.question, + required this.excerpts, + required this.raw, + }); + + /// « run/id#passe », ex. `contract/en3-a#1`. + final String key; + + /// a : réponse dans les documents ; b : dans la réunion ; c : nulle part ; + /// d : pas une question pour l'utilisateur. + final String kind; + + /// Langue de la question (fr, en). + final String lang; + final String question; + final List excerpts; + final String raw; +} + +Map? _cache; + +/// test/fixtures/live_answers/mistral_probe_outputs.json (cwd du package). +Map probeOutputs() => _cache ??= { + for (final dynamic o + in (jsonDecode( + File( + 'test/fixtures/live_answers/mistral_probe_outputs.json', + ).readAsStringSync(), + ) + as Map)['outputs'] + as List) + (o as Map)['key'] as String: ProbeOutput( + key: o['key'] as String, + kind: o['kind'] as String, + lang: o['lang'] as String, + question: o['question'] as String, + excerpts: [ + for (final dynamic e in o['excerpts'] as List) + DocumentExcerpt( + documentId: (e as Map)['documentId'] as String, + documentTitle: e['documentTitle'] as String, + text: e['text'] as String, + ), + ], + raw: o['raw'] as String, + ), +}; + +/// La sortie enregistrée [key] ; échoue si elle n'existe pas. +ProbeOutput probe(String key) { + final ProbeOutput? o = probeOutputs()[key]; + if (o == null) throw ArgumentError('sortie enregistrée inconnue : $key'); + return o; +} From 3b5a98f7db3721b50508eb388b89a389c98849eb Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:51:44 +0100 Subject: [PATCH 02/17] test(live-answers): request names the question's language and forbids general-knowledge advice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shared builder must say 'in French'/'en français' for a French question and 'in English' for an English one (30/36 French questions were answered in English), and the instruction must reach the HTTP body of every provider. It must also forbid advice, steps or procedures from general knowledge presented as facts (3/16 invented procedures). Real probe questions. Red: 15 cases, today's prompt only says 'the language of the question'. --- .../live_answers/answer_prompt_test.dart | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 apps/app_macos/test/application/services/live_answers/answer_prompt_test.dart diff --git a/apps/app_macos/test/application/services/live_answers/answer_prompt_test.dart b/apps/app_macos/test/application/services/live_answers/answer_prompt_test.dart new file mode 100644 index 00000000..f12cf025 --- /dev/null +++ b/apps/app_macos/test/application/services/live_answers/answer_prompt_test.dart @@ -0,0 +1,146 @@ +import 'dart:convert'; + +import 'package:core_domain/domain/enum/audio_source.enum.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/live_answers/answer_prompt.dart'; +import 'package:ici_transcript/application/services/llm/llm_provider.dart'; +import 'package:ici_transcript/core/providers/services/active_llm_provider.provider.dart'; + +import '../../../helpers/live_answers_fakes.dart'; +import '../../../helpers/probe_outputs.dart'; +import '../../../helpers/settings_fakes.dart'; + +/// Requête de réponse, construite à UN endroit (`buildLiveAnswerRequest`, +/// answer_prompt.dart) pour tous les fournisseurs. +/// +/// 5. Langue : 30 des 36 questions françaises de la sonde ont reçu une +/// réponse en anglais avec la consigne générique « Answer in the language +/// of the question ». La requête nomme la langue de la question : +/// « French »/« français » pour une question française, « English » pour +/// une question anglaise (et pas l'autre langue comme langue de réponse). +/// 7. Sans document et sans réponse dans la réunion, 3 réponses sur 16 ont +/// inventé une procédure (« Open the shared folder… ») : la requête +/// interdit les conseils, étapes ou procédures tirés de connaissances +/// générales présentés comme des faits. +/// +/// Les paramètres propres à un fournisseur (effort, max_tokens) ne sont pas +/// fixés ici. +void main() { + LlmChatRequest build(String question, {bool withExcerpts = false}) => + buildLiveAnswerRequest( + question: question, + asked: ( + source: AudioSource.output, + speaker: 0, + timestampMs: 169000, + text: question, + ), + context: [ + ( + source: AudioSource.input, + speaker: null, + timestampMs: 0, + text: 'Hi everyone, thanks for joining.', + ), + ], + excerpts: withExcerpts + ? probe('contract/en1-a1#0').excerpts + : const [], + ); + + final RegExp french = RegExp( + r'\b(in French|en français)\b', + caseSensitive: false, + ); + final RegExp english = RegExp(r'\bin English\b', caseSensitive: false); + + // Questions réelles de la sonde. + final List frenchQuestions = [ + for (final String key in [ + 'contract/fr1-a1#0', + 'contract/fr1-a2#0', + 'contract/fr2-a#0', + 'contract/fr3-b#0', + 'contract/fr3-d#0', + ]) + probe(key).question, + ]; + final List englishQuestions = [ + for (final String key in [ + 'contract/en1-a1#0', + 'contract/en1-c#0', + 'contract/en2-d#0', + 'contract/en3-a#0', + ]) + probe(key).question, + ]; + + group('5. langue de la réponse = langue de la question', () { + for (final String q in frenchQuestions) { + test('« $q » : la requête demande une réponse en français', () { + final String text = requestText(build(q)); + expect(text, matches(french)); + expect(text, isNot(matches(english))); + }); + } + + for (final String q in englishQuestions) { + test('« $q » : la requête demande une réponse en anglais', () { + final String text = requestText(build(q)); + expect(text, matches(english)); + expect(text, isNot(matches(french))); + }); + } + + for (final LlmProviderId id in LlmProviderId.values) { + test( + '${id.name} : la consigne de langue part dans la requête HTTP', + () async { + final RecordingHttpAdapter http = RecordingHttpAdapter( + reply: BodyReply(200, kOkStream[id]!), + ); + final LlmProvider provider = buildLlmProvider( + id, + dio: Dio()..httpClientAdapter = http, + apiKey: 'sk-test-SECRET-0123456789', + model: 'model-under-test', + ); + + await provider.streamChat(build(frenchQuestions.first)).drain(); + + expect(jsonEncode(http.bodies.single), matches(french)); + }, + ); + } + }); + + group('7. pas de conseil tiré de connaissances générales', () { + test('sans extrait : la requête interdit conseils et procédures tirés de ' + 'connaissances générales', () { + final String text = requestText(build(englishQuestions[2])); + expect( + text, + matches(RegExp(r'(general|outside) knowledge', caseSensitive: false)), + ); + expect( + text, + matches( + RegExp(r'\b(advice|steps|procedures?)\b', caseSensitive: false), + ), + ); + }); + + test('avec extraits : la même interdiction reste', () { + final String text = requestText( + build(englishQuestions.first, withExcerpts: true), + ); + expect( + text, + matches( + RegExp(r'\b(advice|steps|procedures?)\b', caseSensitive: false), + ), + ); + }); + }); +} From bf412ad5d13a3109fdb7af0902852e551dfb69e9 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:52:50 +0100 Subject: [PATCH 03/17] test(live-answers): confirmation tag questions are detected; recorded system audio stays negative 'That number comes from last month, right?' was missed by the gate during the probe; ', isn't it?', ', non ?', ', n'est-ce pas ?' likewise. Bare tags and filler tags (d'accord, tu vois) stay non-questions. The spoken probe questions (reference and real ASR) and 40 of the recorded system-audio sentences (0 false positive out of 792) are pinned. Red: 5 (the four tags and the spoken tag question). --- .../question_gate_recorded_test.dart | 152 ++++++++++++++++++ .../live_answers/question_gate_test.dart | 6 +- 2 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 apps/app_macos/test/application/services/live_answers/question_gate_recorded_test.dart diff --git a/apps/app_macos/test/application/services/live_answers/question_gate_recorded_test.dart b/apps/app_macos/test/application/services/live_answers/question_gate_recorded_test.dart new file mode 100644 index 00000000..67e4980b --- /dev/null +++ b/apps/app_macos/test/application/services/live_answers/question_gate_recorded_test.dart @@ -0,0 +1,152 @@ +import 'package:core_domain/domain/entities/transcript_segment.entity.dart'; +import 'package:core_domain/domain/enum/audio_source.enum.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/live_answers/question_gate.dart'; + +/// Porte de détection contre des phrases ENREGISTRÉES (sonde du 2026-11-23, +/// contenu inventé) : questions dites à voix haute (texte de référence et +/// sortie ASR réelle), et phrases de l'audio système des journaux de la +/// sonde (792 phrases, 0 faux positif : un échantillon de 40 reste négatif). +/// +/// Règle choisie : une affirmation suivie d'un tag qui demande confirmation +/// (« right? », « isn't it? », « non ? », « n'est-ce pas ? ») est une question +/// (la sonde l'a manquée : « That number comes from last month, right? »). +/// Le tag seul reste une formule ; « d'accord ? », « ok ? », « tu vois ? » +/// après une affirmation restent du remplissage (inchangé). +void main() { + TranscriptSegmentEntity seg(String text) => TranscriptSegmentEntity( + id: 'seg-1', + sessionId: 's1', + source: AudioSource.output, + text: text, + timestampMs: 65000, + createdAt: DateTime(2026, 11, 22, 10), + ); + + group('question avec tag de confirmation : détectée', () { + for (final String text in [ + 'That number comes from last month, right?', + "The deadline is the end of the month, isn't it?", + 'On livre le lot 1 en mars, non ?', + "Le budget est déjà validé, n'est-ce pas ?", + ]) { + test('« $text »', () { + expect(detectQuestions(seg(text)), [text]); + }); + } + + for (final String text in [ + 'Right?', + "Isn't it?", + 'Non ?', + "N'est-ce pas ?", + "On livre en mars, d'accord ?", + 'On livre en mars, tu vois ?', + ]) { + test('« $text » : formule, pas une question', () { + expect(detectQuestions(seg(text)), isEmpty); + }); + } + }); + + group('questions dites à voix haute pendant la sonde (référence et ASR)', () { + for (final String text in [ + 'Est-ce que tu as reçu le devis du traiteur ?', + 'Est-ce que tu as reçu le devis du traiteur?', + 'Tu as reçu le devis du traiteur ?', + 'Tu as reçu le devis du traiteur?', + 'Quand est-ce que la nouvelle version sort ?', + 'Quand est-ce que la nouvelle version sort?', + 'Combien de personnes participent au pilote ?', + 'Combien de personnes participent au pilote?', + 'On part sur quelle date pour la recette ?', + 'On part sur quelle date pour la recette?', + 'Pourquoi le correctif n\'est pas encore en production ?', + 'Pourquoi le correctif n\'est pas encore en production?', + 'Vous pensez que le budget tiendra jusqu\'à la fin de l\'année ?', + 'Vous pensez que le budget tiendra jusqu\'à la fin de l\'année?', + 'Qui s\'occupe du transport pour le séminaire ?', + 'Et le contrat, il se termine quand ?', + 'Et le contrat, il se termine quand?', + 'C\'est toi qui prépares la démo de jeudi ?', + 'C\'est toi qui prépare la démo de jeudi?', + 'Peux-tu me rappeler le montant de l\'acompte ?', + 'Peux-tu me rappeler le montant de la compte?', + 'Ça coûte combien par utilisateur, la nouvelle offre ?', + 'Quel est le délai de préavis prévu dans le contrat ?', + 'Quel est le délai de préavis prévu dans le contrat?', + 'Tu sais où en est la migration des données ?', + 'Tu sais où on est l\'adaptation des données?', + 'Alors, on valide le planning ou pas ?', + 'Alors, on valide le planning ou pas?', + 'Do you know when the new version ships?', + 'You already sent the report to the team?', + 'How many parking spaces did we get?', + 'What\'s the notice period on the current lease?', + 'Can you remind me who owns the pipeline cleanup?', + 'Why is the response time so high on Mondays?', + 'So the move is still planned for September?', + 'Is the budget for the furniture approved yet?', + 'Where are we with the warehouse migration?', + 'And the chatbot pilot, how is it going so far?', + 'Which supplier did we pick for the desks?', + 'Have we decided who gets a parking space?', + 'Any idea how long we keep the raw event data?', + 'Would it make sense to extend the pilot to another team?', + 'That number comes from last month, right?', + ]) { + test('« $text » : détectée', () { + expect(detectQuestions(seg(text)), isNotEmpty); + }); + } + }); + + group('audio système enregistré : aucun faux positif', () { + for (final String text in [ + 'The teacher moved the wooden fence during the village fair, and then the gardener photographed the round fountain without telling anyone.', + 'Le jardinier a déplacé la cabane sans prévenir personne, puis le jardinier a décoré la cabane avant la pluie du soir.', + 'La gardienne a déplacé la fontaine ronde sous un ciel gris, puis la voisine a déplacé le kiosque à journaux pendant la fête du village.', + 'La Mega Reparer est le kiosque à journaux malgré le vent froid, puis la musicienne a réparé le kiosque à journaux au lever du soleil.', + 'The librarian painted the wooden fence despite the cold wind, and then the mayor tidied the wooden fence before the evening rain.', + 'Le jardinier a photographié le lavoir au lever du soleil, puis la musicienne a nettoyé la fontaine ronde sous un ciel gris.', + 'My neighbor moved the small cabin for the start of school, and then the postman tidied the green bench before the evening rain.', + 'Le maire a déplacé la cabane sous un ciel gris, puis le facteur a mesuré le kiosque à journaux pour la rentrée des classes.', + 'The baker painted the small cabin without telling anyone, and then the librarian cleaned the round fountain with a lot of patience.', + 'Le libraire a photographié la serre avec beaucoup de patience, puis le libraire a nettoyé la cabane sous un ciel gris.', + 'La musicienne a basuré la fontaine ronde au lever du soleil, puis la musicienne a réparé le banc vert pour la rentrée des classes.', + 'The postman measured the green bench at sunrise, and then the baker repaired the stone wall despite the cold wind.', + 'La voisine a déplacé la fontaine haute pendant la fête du village, puis le facteur a photographié le lavoir avec beaucoup de patience.', + 'Le facteur a repris la cabane sous un ciel gris, puis le libraire a rangé la serre avec beaucoup de patience.', + 'My neighbor tidied the wooden fence for the start of school, and then the mayor repaired the round fountain despite the cold wind.', + 'La Mega Photo vacille le kiosque à journaux pour la rentrée des classes, puis la boulangère a repeint la cabane avant la pluie du soir.', + 'Le biker a nettoyé le portail avec beaucoup de patience, puis la musicienne a décoré le lavoir avec beaucoup de patience.', + 'The mayor cleaned the old greenhouse under a gray sky, and then my neighbor photographed the small cabin before the evening rain.', + 'The GAGNA measured the stone wall with a lot of patience, and then the mayor moved the garden gate with a lot of patience.', + 'La boulangère a décoré la cabane pendant la fête du village, puis le libraire a rangé la fontaine ronde avec beaucoup de patience.', + 'La gardienne a photographié le portail avec beaucoup de patience, puis le jardinier a repeint la fontaine ronde sous un ciel gris.', + 'La gardienne a déplacé la vieille barrière avant la pluie de soir, puis la gardienne a nettoyé le kiosque à journaux sous un ciel gris.', + 'The painter tidied the stone wall for the start of school, and then the gardener repaired the green bench for the start of school.', + 'The Gognar repaired the wooden fence without telling anyone, and then the teacher measured the small cabin at sunrise.', + 'My neighbor moved the garden gate under a gray sky, and then the librarian tidied the old greenhouse for the start of school.', + 'La boulangère a basuré la serre avant la pluie du soir, puis le maire a photographié le kiosque à journaux sous un ciel gris.', + 'The baker decorated the stone wall for the start of school, and then the teacher cleaned the old greenhouse at sunrise.', + 'The mayor decorated the round fountain before the evening rain, and then the postman moved the garden gate with a lot of patience.', + 'The postman moved the round fountain for the start of school, and then the painter decorated the garden gate before the evening rain.', + 'My neighbor photographed the wooden fence for the start of school, and then the gardener decorated the stone wall for the start of school.', + 'The teacher decorated the old greenhouse without telling anyone, and then the teacher cleaned the green bench despite the cold wind.', + 'La boulangère a repeint la vieille barrière avant la pluie du soir, puis la musicienne a décoré le portail avec beaucoup de patience.', + 'La voisine a photo bafrié la vieille barrière au lever du soleil, puis le libraire a rangé la fontaine ronde sans prévenir personne.', + 'The teacher painted the bus shelter before the evening rain, and then the postman painted the old greenhouse without telling anyone.', + 'La boulangère a nettoyé la cabane malgré le vent froid, puis la voisine a nettoyé la fontaine ronde avec beaucoup de patience.', + 'The librarian painted the stone wall during the village fair, and then my neighbor painted the small cabin for the start of school.', + 'Le libraire a repeint le kiosque à journaux pour la rentrée des classes, puis le jardinier a déplacé la serre sans prévenir personne.', + 'The mere photograph the garden gate despite the cold wind, and then my neighbor photograph the wooden fence before the evening rain.', + 'La musicienne a réparé le lavoir sans prévenir personne, puis la gardienne a photographié le bon verre avant la pluie du soir.', + 'Lavali l\'a décoré le portail sous un ciel gris, puis la musicienne a repeint la serre sans prévenir personne.', + ]) { + test('« $text »', () { + expect(detectQuestions(seg(text)), isEmpty); + }); + } + }); +} diff --git a/apps/app_macos/test/application/services/live_answers/question_gate_test.dart b/apps/app_macos/test/application/services/live_answers/question_gate_test.dart index e7505450..2a81b1f3 100644 --- a/apps/app_macos/test/application/services/live_answers/question_gate_test.dart +++ b/apps/app_macos/test/application/services/live_answers/question_gate_test.dart @@ -17,8 +17,10 @@ import 'package:ici_transcript/application/services/live_answers/question_gate.d /// phrase SANS ponctuation finale (sortie ASR) est candidate si elle /// commence (après « et / alors / donc / mais / and / so ») par une forme /// interrogative ; une phrase finissant par « . » ou « ! » ne l'est jamais ; -/// une affirmation suivie d'un tag (« …, d'accord ? », « …, right? ») non -/// plus. +/// une affirmation suivie d'un tag de remplissage (« …, d'accord ? », +/// « …, ok ? », « …, tu vois ? ») non plus ; suivie d'un tag qui demande +/// confirmation (« …, right? », « …, isn't it? », « …, non ? », « …, n'est-ce +/// pas ? »), si : voir question_gate_recorded_test.dart. void main() { TranscriptSegmentEntity seg( String text, { From 742fad6cc95606b6bd1d49846599f97dde805027 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:53:33 +0100 Subject: [PATCH 04/17] test(live-answers): screen shows a shortened sign, flags unsourced answers, hides prose refusals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Live panel: a recorded 9-line answer keeps its headline and shows live_answers.shortened; an answer citing no provided excerpt shows live_answers.unsourced (live and in the note); a recorded prose refusal is shown as declined, its text never displayed. Keys: shortened 'Réponse raccourcie', unsourced 'Sans source : à vérifier'. Red: 3 panel, 1 note, 2 keys (no unsourced label exists after PR #20). --- .../session_detail_questions_test.dart | 22 +++++++ .../live_answers_panel_test.dart | 62 +++++++++++++++++++ .../live_answers_translations_test.dart | 2 + 3 files changed, 86 insertions(+) diff --git a/apps/app_macos/test/features/history/session_detail_questions_test.dart b/apps/app_macos/test/features/history/session_detail_questions_test.dart index 792103a1..72272a35 100644 --- a/apps/app_macos/test/features/history/session_detail_questions_test.dart +++ b/apps/app_macos/test/features/history/session_detail_questions_test.dart @@ -182,4 +182,26 @@ void main() { lessThan(FontWeight.values.indexOf(FontWeight.w600)), ); }); + + testWidgets('réponse gardée sans source : marquée « sans source » ; avec ' + 'source : non', (WidgetTester tester) async { + await pumpNote(tester, const [ + LiveQuestion( + id: 'q-nosrc', + sessionId: 's1', + text: 'Combien coûte la licence par utilisateur ?', + timestampMs: 120000, + status: LiveQuestionStatus.answered, + answer: 'La licence coûte 40 € par mois.', + ), + ]); + expect(find.text('live_answers.unsourced'.tr()), findsOneWidget); + }); + + testWidgets('réponse gardée avec source : pas « sans source »', ( + WidgetTester tester, + ) async { + await pumpNote(tester, const [answered]); + expect(find.text('live_answers.unsourced'.tr()), findsNothing); + }); } diff --git a/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart b/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart index c628e7be..552f3c69 100644 --- a/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart +++ b/apps/app_macos/test/features/live_transcription/live_answers_panel_test.dart @@ -15,6 +15,7 @@ import 'package:ici_transcript/features/live_transcription/presentation/screens/ import '../../helpers/fake_view_models.dart' show settle; import '../../helpers/live_answers_fakes.dart'; import '../../helpers/localized_app.dart'; +import '../../helpers/probe_outputs.dart'; import '../../helpers/text_weight.dart'; /// Zone « Questions » de l'écran en direct (T4, besoin 11) : comportement, @@ -379,4 +380,65 @@ void main() { lessThan(FontWeight.values.indexOf(FontWeight.w600)), ); }); + + testWidgets('réponse raccourcie (plus de trois puces, sortie réelle) : la ' + 'tête reste, l\'écran signale le raccourci', (WidgetTester tester) async { + await pumpLive(tester); + await ask(tester); + h.llm.last.reply(probe('contract/fr1-c#0').raw); + await settle(tester); + + expect(find.textContaining('Meeting Recap'), findsOneWidget); + expect(find.text('live_answers.shortened'.tr()), findsOneWidget); + }); + + testWidgets('réponse courte : pas de signe de raccourci', ( + WidgetTester tester, + ) async { + await pumpLive(tester); + await ask(tester); + h.llm.last.reply('Le lot 1 arrive le 12 mars.'); + await settle(tester); + + expect(find.text('live_answers.shortened'.tr()), findsNothing); + }); + + testWidgets('réponse qui ne cite aucune source : marquée « sans source »', ( + WidgetTester tester, + ) async { + await pumpLive(tester); + await ask(tester); + h.llm.last.reply('Le lot 1 arrive le 12 mars.'); + await settle(tester); + + expect(find.text('live_answers.unsourced'.tr()), findsOneWidget); + }); + + testWidgets('réponse qui cite un extrait fourni : pas « sans source »', ( + WidgetTester tester, + ) async { + await pumpLive(tester); + h.search.results = [contract]; + await ask(tester); + h.llm.last.reply('Le lot 1 arrive le 12 mars [S1].'); + await settle(tester); + + expect(find.text('live_answers.unsourced'.tr()), findsNothing); + }); + + testWidgets( + 'refus en prose du modèle (sortie réelle) : rien d\'affiché comme ' + 'réponse, la question reste avec la mention de refus', + (WidgetTester tester) async { + await pumpLive(tester); + await ask(tester); + h.llm.last.reply(probe('contract/en3-c#2').raw); + await settle(tester); + + expect(find.text(q), findsOneWidget); + expect(find.text('live_answers.declined'.tr()), findsOneWidget); + expect(find.textContaining('rate card'), findsNothing); + expect(h.only.status, LiveQuestionStatus.declined); + }, + ); } diff --git a/apps/app_macos/test/features/live_transcription/live_answers_translations_test.dart b/apps/app_macos/test/features/live_transcription/live_answers_translations_test.dart index 65d616c3..0b9e7d34 100644 --- a/apps/app_macos/test/features/live_transcription/live_answers_translations_test.dart +++ b/apps/app_macos/test/features/live_transcription/live_answers_translations_test.dart @@ -15,6 +15,8 @@ void main() { 'live_answers.answer_latest': 'Répondre', 'live_answers.answer_this': 'Répondre à cette phrase', 'live_answers.answer': 'Proposer une réponse', + 'live_answers.shortened': 'Réponse raccourcie', + 'live_answers.unsourced': 'Sans source : à vérifier', 'live_answers.local_manual_hint': 'Modèle local : les réponses se demandent, cliquez sur « Proposer une réponse ».', 'live_answers.answering': 'Réponse en cours…', From 78a5120c18a91d7741014dc374c6b1cedb2a5ead Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:59:15 +0100 Subject: [PATCH 05/17] Read real local-model answers: prose refusals, stray tokens, citations Why: a probe on mistral 7B (96 generations) showed refusals in prose shown as answers, NO_ANSWER mid-text, citations as times or [S1, S4], preambles taken for the headline, and answers far over three bullets. What: parseAnswer stays one pure function for every provider: lines carrying the token are dropped; citation groups become canonical [S] for provided excerpts (times, unknown tags and 'User' removed, 'document S1' mapped); preambles stripped; the first block citing a provided excerpt is kept; head + 3 bullets with a shortened flag; a prose refusal in the answering sentence (any line under a title) declines; a last line is cut only on a continuation sign or a function word. Proof: answer_parser, recorded_outputs and recorded_outputs_shortened specs green against the 99 recorded outputs. --- .../services/live_answers/answer_parser.dart | 182 ++++++++++++++---- 1 file changed, 146 insertions(+), 36 deletions(-) diff --git a/apps/app_macos/lib/application/services/live_answers/answer_parser.dart b/apps/app_macos/lib/application/services/live_answers/answer_parser.dart index 0ab3f6fe..205d7496 100644 --- a/apps/app_macos/lib/application/services/live_answers/answer_parser.dart +++ b/apps/app_macos/lib/application/services/live_answers/answer_parser.dart @@ -32,9 +32,19 @@ class ParsedAnswer { required this.bullets, required this.sources, required this.truncated, + this.shortened = false, }); - /// Le modèle a refusé (`NO_ANSWER`). + static const ParsedAnswer _declined = ParsedAnswer( + declined: true, + headline: '', + bullets: [], + sources: [], + truncated: false, + ); + + /// Le modèle a refusé : `NO_ANSWER`, ou une phrase qui dit que + /// l'information manque ou que ce n'est pas une question. final bool declined; /// Phrase de tête. @@ -49,6 +59,10 @@ class ParsedAnswer { /// Le texte s'arrête au milieu d'une phrase. final bool truncated; + /// Des lignes reçues ne sont pas montrées (au-delà de la tête et de + /// [kMaxBullets] puces, ou un autre bloc). + final bool shortened; + /// Réponse affichée et sauvegardée : la tête puis une puce par ligne. String get text => [ if (headline.isNotEmpty) headline, @@ -63,35 +77,41 @@ final RegExp _bulletMarker = RegExp(r'^([-*•]|\d+[.)])\s+'); final RegExp _finalStop = RegExp(r'[.!?…»")]$'); final RegExp _trailingCitations = RegExp(r'(\s*\[S\d+\])+\s*$'); -/// Lit [raw], la réponse complète, contre les [excerpts] fournis au modèle -/// (l'extrait n° i, à partir de 1, se cite `[S]`). +/// Lit [raw], la réponse complète d'un modèle, contre les [excerpts] qu'il +/// a reçus (l'extrait n° i, à partir de 1, se cite `[S]`). Une seule +/// lecture pour tous les fournisseurs, faite pour les sorties réelles d'un +/// petit modèle local : refus en prose, jeton au milieu, citations mal +/// formées, préambules, réponses trop longues. /// -/// Citations vers un extrait non fourni : retirées du texte et des sources. -/// Les autres sont renumérotées dans l'ordre de première citation. +/// Étapes : refus en tête ; lignes portant le jeton retirées ; citations +/// et préambules nettoyés ; bloc gardé (le premier qui cite un extrait +/// fourni) ; tête + [kMaxBullets] puces ; refus en prose ; citations +/// renumérotées dans l'ordre de première citation (inconnues retirées). ParsedAnswer parseAnswer(String raw, List excerpts) { final String trimmed = raw.trim(); - if (isDeclined(trimmed)) { - return const ParsedAnswer( - declined: true, - headline: '', - bullets: [], - sources: [], - truncated: false, - ); - } - final List lines = [ + if (isDeclined(trimmed)) return ParsedAnswer._declined; + + final List cleaned = [ for (final String l in trimmed.split('\n')) - if (l.trim().replaceFirst(_bulletMarker, '').trim() case final String t - when t.isNotEmpty) - t, - ].take(kMaxBullets + 1).toList(); + if (!l.contains(kNoAnswerToken)) _clean(l, excerpts.length), + ]; + final List> blocks = _blocks(cleaned); + if (blocks.isEmpty) return ParsedAnswer._declined; + final List block = blocks.firstWhere( + (List b) => b.any(kCitation.hasMatch), + orElse: () => blocks.first, + ); + final List lines = [ + for (final String l in block) l.replaceFirst(_bulletMarker, '').trim(), + ].where((String l) => l.isNotEmpty).toList(); + if (lines.isEmpty || _isRefusal(lines)) return ParsedAnswer._declined; + final List kept = lines.take(kMaxBullets + 1).toList(); final List sources = []; final Map renumber = {}; String cite(String line) => line.replaceAllMapped(RegExp(r'\s*\[S(\d+)\]'), (Match m) { final int n = int.parse(m[1]!); - if (n < 1 || n > excerpts.length) return ''; final int to = renumber.putIfAbsent(n, () { final DocumentExcerpt e = excerpts[n - 1]; sources.add( @@ -105,43 +125,133 @@ ParsedAnswer parseAnswer(String raw, List excerpts) { }); return '${m[0]!.substring(0, m[0]!.indexOf('['))}[S$to]'; }).trim(); - final List cited = lines.map(cite).toList(); - final String last = cited.isEmpty - ? '' - : cited.last.replaceFirst(_trailingCitations, ''); + final List cited = kept.map(cite).toList(); final bool emptyLastBullet = RegExp( r'(^|\n)\s*([-*•]|\d+[.)])\s*$', ).hasMatch(trimmed); return ParsedAnswer( declined: false, - headline: cited.isEmpty ? '' : cited.first, + headline: cited.first, bullets: cited.skip(1).toList(), sources: sources, truncated: emptyLastBullet || - (cited.length > 1 - ? _bulletLooksCut(last) - : last.isNotEmpty && !_finalStop.hasMatch(last)), + _looksCut(cited.last.replaceFirst(_trailingCitations, '')), + shortened: + lines.length > kept.length || + blocks.length > 1 && blocks.any((List b) => b != block), ); } -/// Mots outils après lesquels une puce ne peut pas finir. +/// Groupe entre crochets ou parenthèses fait de tags `S`, d'heures, +/// « User » ou « Speaker n » : remplacé par les citations canoniques +/// fournies, le reste retiré. +final RegExp _citationGroup = RegExp( + r'(\s*)([\[(])([^\[\]()]*|\[[^\[\]]*\])([\])])', +); +final RegExp _tag = RegExp(r'\bS(\d+)\b'); +final RegExp _time = RegExp(r'\b\d{1,2}:\d{2}(?::\d{2})?\b'); +final RegExp _documentTag = RegExp(r'\b(?:the )?documents? S(\d+)\b'); +final RegExp _preamble = RegExp( + r"^\s*(User's response|User|Answer|Response|Réponse)\s*:\s*", + caseSensitive: false, +); + +/// Une ligne nettoyée : citations canoniques vers [count] extraits +/// fournis, heures et préambule retirés. +String _clean(String line, int count) { + String canonical(Iterable tags) => [ + for (final RegExpMatch t in tags) + if (int.parse(t[1]!) case final int n when n >= 1 && n <= count) '[S$n]', + ].join(' '); + + String out = line.replaceAllMapped(_documentTag, (Match m) => '[S${m[1]}]'); + // Deux passes : `([S1])` devient `[S1]` après la première. + for (int pass = 0; pass < 2; pass++) { + out = out.replaceAllMapped(_citationGroup, (Match m) { + final String inner = m[3]!; + final String rest = inner + .replaceAll(kCitation, '') + .replaceAll(_tag, '') + .replaceAll(_time, '') + .replaceAll(RegExp(r'\b(User|Speaker \d+)\b'), '') + .replaceAll(RegExp(r'[\s,;:]'), ''); + if (rest.isNotEmpty) return m[0]!; + final String tags = canonical(_tag.allMatches(inner)); + return tags.isEmpty ? '' : '${m[1]}$tags'; + }); + } + final bool bullet = _bulletMarker.hasMatch(out.trimLeft()); + final String body = out.trimLeft().replaceFirst(_bulletMarker, ''); + final String withoutPreamble = body.replaceFirst(_preamble, '').trim(); + if (withoutPreamble.isEmpty) return ''; + return bullet ? '- $withoutPreamble' : withoutPreamble; +} + +/// Blocs séparés par une ligne vide, chacun commençant par une ligne qui +/// n'est pas une puce (une puce après une ligne vide continue le bloc). +List> _blocks(List lines) { + final List> blocks = >[]; + bool afterBlank = false; + for (final String l in lines) { + if (l.trim().isEmpty) { + afterBlank = true; + continue; + } + if (blocks.isEmpty || + (afterBlank && !_bulletMarker.hasMatch(l.trimLeft()))) { + blocks.add([]); + } + blocks.last.add(l); + afterBlank = false; + } + return blocks; +} + +/// Phrases qui disent que l'information manque, ou que ce n'est pas une +/// question pour l'utilisateur. Un état du monde (« not yet approved ») +/// n'en est pas une. +final RegExp _refusal = RegExp( + r"not (explicitly )?(given|provided|stated|indicated|mentioned|specified)" + r"|(documents?|excerpts?) do(es)? not (mention|contain)" + r"|did not specify" + r"|no specific\b[^.]*\b(given|available)" + r"|n'est pas (donné|indiqué|précisé|mentionné)" + r"|n'ont pas été mentionné" + r"|non (spécifié|indiqué|précisé)" + r"|ne connaît pas" + r"|aucune information" + r"|not a question|is a comment", + caseSensitive: false, +); + +/// Refus en prose : la phrase qui répond (la première de la tête) le dit ; +/// si la tête est un titre suivi de puces, toute ligne compte. +bool _isRefusal(List lines) { + final String head = lines.first.replaceFirst(_trailingCitations, ''); + final bool title = + lines.length > 1 && (!_finalStop.hasMatch(head) || head.endsWith(':')); + if (title) return lines.any(_refusal.hasMatch); + return _refusal.hasMatch(lines.first.split(RegExp(r'(?<=[.!?])\s')).first); +} + +/// Mots outils après lesquels une ligne ne peut pas finir. const Set _functionWords = { 'de', 'du', 'des', 'le', 'la', 'les', 'un', 'une', 'et', 'ou', 'à', 'au', // 'aux', 'pour', 'par', 'avec', 'en', 'sur', 'the', 'a', 'an', 'of', 'to', // 'and', 'or', 'for', 'with', 'in', 'on', 'at', // }; -/// Dernière puce coupée ? Sans signal de fin de longueur du fournisseur : +/// Dernière ligne coupée ? Sans signal de fin de longueur du fournisseur : /// seulement si elle finit sur un signe de suite (, ; : - – ou parenthèse -/// ouverte) ou sur un mot outil. Une puce finie par un mot plein est +/// ouverte) ou sur un mot outil. Une ligne finie par un mot plein est /// complète, même sans point. -bool _bulletLooksCut(String bullet) { - if (_finalStop.hasMatch(bullet)) return false; - if (RegExp(r'[,;:\-–(]$').hasMatch(bullet)) return true; - if ('('.allMatches(bullet).length > ')'.allMatches(bullet).length) { +bool _looksCut(String line) { + if (_finalStop.hasMatch(line)) return false; + if (RegExp(r'[,;:\-–(]$').hasMatch(line)) return true; + if ('('.allMatches(line).length > ')'.allMatches(line).length) { return true; } - final String lastWord = bullet.split(RegExp(r'\s+')).last.toLowerCase(); + final String lastWord = line.split(RegExp(r'\s+')).last.toLowerCase(); return _functionWords.contains(lastWord); } From 60ebb30450a754d79657a7814c68761bc6fa1466 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:59:15 +0100 Subject: [PATCH 06/17] Detect confirmation tag questions Why: the probe missed 'That number comes from last month, right?'. What: right / isn't it / non / n'est-ce pas after a statement make a question; d'accord, ok, tu vois stay filler. Proof: question_gate and question_gate_recorded specs green (no false positive on the 40 recorded system sentences). --- .../services/live_answers/question_gate.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/app_macos/lib/application/services/live_answers/question_gate.dart b/apps/app_macos/lib/application/services/live_answers/question_gate.dart index 8ef3c60e..86a99d10 100644 --- a/apps/app_macos/lib/application/services/live_answers/question_gate.dart +++ b/apps/app_macos/lib/application/services/live_answers/question_gate.dart @@ -15,7 +15,8 @@ const int kMinQuestionWords = 3; /// - une phrase finissant par « ? » est candidate si elle compte au moins /// [kMinQuestionWords] mots et n'est ni une salutation, ni de la /// logistique de réunion (« Vous m'entendez ? »), ni une affirmation -/// suivie d'un tag (« …, d'accord ? ») ; +/// suivie d'un tag de remplissage (« …, d'accord ? ») ; suivie d'un tag +/// de confirmation (« …, right? », « …, non ? »), si ; /// - une phrase sans ponctuation finale (sortie ASR) est candidate si elle /// compte au moins [kMinQuestionWords] mots et commence, après /// « et / alors / donc / mais / and / so », par une forme interrogative ; @@ -68,10 +69,11 @@ final RegExp _formula = RegExp( r"voir mon|on mute|en sourdine|you're muted", ); -/// « …, d'accord ? », « …, right? » : un tag après une affirmation. +/// « …, d'accord ? », « …, tu vois ? » : un tag de remplissage après une +/// affirmation. Un tag qui demande confirmation (« …, right? », « …, isn't +/// it? », « …, non ? », « …, n'est-ce pas ? ») fait, lui, une question. final RegExp _tagAfterStatement = RegExp( - r",\s*(d'accord|ok|okay|right|non|hein|tu vois|vous voyez|n'est-ce pas|" - r"isn't it|you know|correct|yes|no|oui)\s*\?", + r",\s*(d'accord|ok|okay|hein|tu vois|vous voyez|you know|yes|oui)\s*\?", caseSensitive: false, ); From 640ff1ba169629f94e321a0153fee0ebeef32852 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:59:15 +0100 Subject: [PATCH 07/17] Name the question's language and forbid general-knowledge advice Why: 30 of 36 French questions were answered in English, and answers without documents invented procedures. What: the one shared prompt builder detects French or English from the question's words and asks for that language; it forbids advice, steps or procedures from general knowledge presented as facts, and citing times. Proof: answer_prompt spec green, including the request body sent by each of the four providers. --- .../services/live_answers/answer_prompt.dart | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart b/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart index 6d34b48f..6dd2b5c4 100644 --- a/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart +++ b/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart @@ -15,22 +15,57 @@ typedef ContextLine = ({ }); /// Consignes du modèle : le contrat de sortie lu par [parseAnswer]. Seul -/// endroit où il est écrit. -const String kLiveAnswerSystemPrompt = +/// endroit où il est écrit, pour tous les fournisseurs. [language] : langue +/// de la question (« French », « English »), null si inconnue. +String liveAnswerSystemPrompt(String? language) => 'You help the user during a live meeting: another participant just asked ' 'a question and you suggest what the user could answer.\n' 'Rules:\n' '- Use only the meeting context and the numbered document excerpts given ' 'below. Never use outside knowledge, never guess a number, a date or a ' - 'name.\n' + 'name. Never give advice, steps or procedures from general knowledge ' + 'presented as facts.\n' '- If they do not contain the answer, or the text is not a question ' 'addressed to the user, reply exactly $kNoAnswerToken and nothing else.\n' - '- Answer in the language of the question.\n' + '${language == null ? '- Answer in the language of the question.' : '- Answer in $language, the language of the question, even if the context or the excerpts are in another language.'}\n' '- Output: one short headline sentence that answers, then at most ' '$kMaxBullets bullets starting with "- ", one short sentence each. Every ' - 'line ends with a period. No preamble, no heading, no bold.\n' + 'line ends with a period. No preamble, no title, no heading, no bold.\n' '- After a sentence that uses an excerpt, cite it with its tag, for ' - 'example [S1]. Never cite a tag that is not listed.'; + 'example [S1]. Never cite a tag that is not listed, never cite a time.'; + +/// Langue de [question] (« French » ou « English ») d'après ses mots ; +/// null si rien ne permet de trancher. +// ponytail: deux langues comptées sur des mots fréquents ; une 3e langue +// demandera un vrai détecteur. +String? questionLanguage(String question) { + final List words = question + .toLowerCase() + .split(RegExp(r"[^\p{L}']+", unicode: true)) + .expand((String w) => w.split("'")) + .where((String w) => w.isNotEmpty) + .toList(); + final int fr = + words.where(_frenchWords.contains).length + + (RegExp('[àâçéèêëîïôûùüœ]').hasMatch(question.toLowerCase()) ? 2 : 0); + final int en = words.where(_englishWords.contains).length; + if (fr == en) return null; + return fr > en ? 'French' : 'English'; +} + +const Set _frenchWords = { + 'le', 'la', 'les', 'de', 'des', 'du', 'un', 'une', 'est', 'et', 'que', // + 'qui', 'quel', 'quelle', 'quels', 'quelles', 'combien', 'comment', // + 'pourquoi', 'quand', 'tu', 'vous', 'on', 'nous', 'ce', 'pour', 'sur', // + 'avec', 'il', 'elle', 'sais', 'qu', 'c', 'l', 'd', 'en', 'pas', // +}; + +const Set _englishWords = { + 'the', 'is', 'are', 'was', 'were', 'do', 'does', 'did', 'what', 'how', // + 'why', 'when', 'where', 'who', 'which', 'we', 'you', 'our', 'can', // + 'could', 'would', 'will', 'have', 'has', 'of', 'to', 'for', 'on', 'it', // + 'much', 'many', 'that', 'this', 'with', 'and', 'any', // +}; /// Requête de réponse à [question] : contexte récent (déjà fenêtré et /// borné), extraits numérotés `[S1]`… Jamais le document entier ni l'audio. @@ -63,7 +98,7 @@ LlmChatRequest buildLiveAnswerRequest({ ) ..write(question); return LlmChatRequest( - systemPrompt: kLiveAnswerSystemPrompt, + systemPrompt: liveAnswerSystemPrompt(questionLanguage(question)), messages: [ LlmMessage(role: LlmRole.user, content: b.toString()), ], From 6c0b55fd724587418ff72b4c9284ec8aba7c749f Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 01:59:16 +0100 Subject: [PATCH 08/17] Show shortened and unsourced answers on screen and in the note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: a shortened answer must say so, and an answer citing no document must be flagged for checking. What: LiveQuestion.shortened (not stored yet) from the parser; the shared question view shows 'Réponse raccourcie' and 'Sans source : à vérifier' for an answered question without sources; two fr.json keys, locale keys regenerated. Proof: live_answers_panel, session_detail_questions and translations specs green; flutter analyze clean. --- apps/app_macos/assets/translations/fr.json | 2 ++ .../live_answers/live_answers.service.dart | 2 ++ .../services/live_answers/live_question.dart | 7 +++++ .../screens/detail/session_detail.screen.dart | 2 ++ .../widgets/live_answers_panel.widget.dart | 2 ++ .../widgets/question_answer.widget.dart | 30 ++++++++++++------- .../generated/translations/locale_keys.g.dart | 2 ++ 7 files changed, 37 insertions(+), 10 deletions(-) diff --git a/apps/app_macos/assets/translations/fr.json b/apps/app_macos/assets/translations/fr.json index 70d9db83..b84e7466 100644 --- a/apps/app_macos/assets/translations/fr.json +++ b/apps/app_macos/assets/translations/fr.json @@ -149,6 +149,8 @@ "dismiss": "Ignorer", "declined": "Pas de réponse utile à proposer.", "truncated": "Réponse incomplète", + "shortened": "Réponse raccourcie", + "unsourced": "Sans source : à vérifier", "error": { "invalid_key": "Clé API refusée : vérifiez-la dans Réglages.", "rate_limited": "Trop de demandes chez le fournisseur : réessayez dans un instant.", diff --git a/apps/app_macos/lib/application/services/live_answers/live_answers.service.dart b/apps/app_macos/lib/application/services/live_answers/live_answers.service.dart index 668f5972..6edcfb7b 100644 --- a/apps/app_macos/lib/application/services/live_answers/live_answers.service.dart +++ b/apps/app_macos/lib/application/services/live_answers/live_answers.service.dart @@ -192,6 +192,7 @@ class LiveAnswersService { answer: '', failure: null, truncated: false, + shortened: false, sources: const [], ), ); @@ -359,6 +360,7 @@ class LiveAnswersService { : LiveQuestionStatus.answered, answer: a.text, truncated: a.truncated, + shortened: a.shortened, sources: a.sources, failure: null, model: model, diff --git a/apps/app_macos/lib/application/services/live_answers/live_question.dart b/apps/app_macos/lib/application/services/live_answers/live_question.dart index 61473a2f..b1799a88 100644 --- a/apps/app_macos/lib/application/services/live_answers/live_question.dart +++ b/apps/app_macos/lib/application/services/live_answers/live_question.dart @@ -88,6 +88,7 @@ class LiveQuestion { this.status = LiveQuestionStatus.detected, this.answer = '', this.truncated = false, + this.shortened = false, this.failure, this.sources = const [], this.model, @@ -124,6 +125,10 @@ class LiveQuestion { /// La réponse s'arrête au milieu d'une phrase. final bool truncated; + /// Des lignes reçues ne sont pas montrées (réponse trop longue). + // ponytail: pas rangé en base ; une note rouverte ne le signale plus. + final bool shortened; + /// Raison de l'échec quand [status] vaut `failed`. final LiveAnswerFailure? failure; @@ -141,6 +146,7 @@ class LiveQuestion { LiveQuestionStatus? status, String? answer, bool? truncated, + bool? shortened, Object? failure = _keep, List? sources, Object? model = _keep, @@ -156,6 +162,7 @@ class LiveQuestion { status: status ?? this.status, answer: answer ?? this.answer, truncated: truncated ?? this.truncated, + shortened: shortened ?? this.shortened, failure: identical(failure, _keep) ? this.failure : failure as LiveAnswerFailure?, diff --git a/apps/app_macos/lib/features/history/presentation/screens/detail/session_detail.screen.dart b/apps/app_macos/lib/features/history/presentation/screens/detail/session_detail.screen.dart index 0f884426..a59539e5 100644 --- a/apps/app_macos/lib/features/history/presentation/screens/detail/session_detail.screen.dart +++ b/apps/app_macos/lib/features/history/presentation/screens/detail/session_detail.screen.dart @@ -705,6 +705,8 @@ class _SavedQuestion extends StatelessWidget { ), status: status, truncatedLabel: LocaleKeys.live_answers_truncated.tr(), + shortenedLabel: LocaleKeys.live_answers_shortened.tr(), + unsourcedLabel: LocaleKeys.live_answers_unsourced.tr(), ); } } diff --git a/apps/app_macos/lib/features/live_transcription/presentation/screens/live/widgets/live_answers_panel.widget.dart b/apps/app_macos/lib/features/live_transcription/presentation/screens/live/widgets/live_answers_panel.widget.dart index 19f8824d..a0efda12 100644 --- a/apps/app_macos/lib/features/live_transcription/presentation/screens/live/widgets/live_answers_panel.widget.dart +++ b/apps/app_macos/lib/features/live_transcription/presentation/screens/live/widgets/live_answers_panel.widget.dart @@ -167,6 +167,8 @@ class _QuestionCard extends StatelessWidget { status: status.$1, statusTone: status.$2, truncatedLabel: LocaleKeys.live_answers_truncated.tr(), + shortenedLabel: LocaleKeys.live_answers_shortened.tr(), + unsourcedLabel: LocaleKeys.live_answers_unsourced.tr(), actions: [ if (q.status == LiveQuestionStatus.answered) icon( diff --git a/apps/app_macos/lib/features/shared/presentation/widgets/question_answer.widget.dart b/apps/app_macos/lib/features/shared/presentation/widgets/question_answer.widget.dart index bb071072..b2290623 100644 --- a/apps/app_macos/lib/features/shared/presentation/widgets/question_answer.widget.dart +++ b/apps/app_macos/lib/features/shared/presentation/widgets/question_answer.widget.dart @@ -15,6 +15,8 @@ class QuestionAnswerView extends StatelessWidget { this.status, this.statusTone = QuestionStatusTone.neutral, this.truncatedLabel, + this.shortenedLabel, + this.unsourcedLabel, this.actions = const [], this.footer = const [], super.key, @@ -35,6 +37,12 @@ class QuestionAnswerView extends StatelessWidget { /// Mention d'une réponse coupée, affichée si la réponse l'est. final String? truncatedLabel; + /// Mention d'une réponse raccourcie (lignes reçues non montrées). + final String? shortenedLabel; + + /// Mention d'une réponse qui ne cite aucun extrait (à vérifier). + final String? unsourcedLabel; + /// Petites actions à droite de l'en-tête (icônes à info-bulle). final List actions; @@ -72,21 +80,23 @@ class QuestionAnswerView extends StatelessWidget { const SizedBox(height: OatsSpace.sm), _StatusLine(s, tone: statusTone), ], - if (question.truncated && truncatedLabel != null) ...[ + for (final (IconData icon, String label) in <(IconData, String)>[ + if (question.truncated && truncatedLabel != null) + (Icons.content_cut_outlined, truncatedLabel!), + if (question.shortened && shortenedLabel != null) + (Icons.unfold_less, shortenedLabel!), + if (question.status == LiveQuestionStatus.answered && + question.sources.isEmpty && + unsourcedLabel != null) + (Icons.help_outline, unsourcedLabel!), + ]) ...[ const SizedBox(height: OatsSpace.xs), Row( children: [ - Icon( - Icons.content_cut_outlined, - size: OatsIconSize.sm, - color: o.faint, - ), + Icon(icon, size: OatsIconSize.sm, color: o.faint), const SizedBox(width: OatsSpace.xs), Flexible( - child: Text( - truncatedLabel!, - style: o.meta.copyWith(color: o.faint), - ), + child: Text(label, style: o.meta.copyWith(color: o.faint)), ), ], ), diff --git a/apps/app_macos/lib/generated/translations/locale_keys.g.dart b/apps/app_macos/lib/generated/translations/locale_keys.g.dart index 41aa08c7..03ca9edc 100644 --- a/apps/app_macos/lib/generated/translations/locale_keys.g.dart +++ b/apps/app_macos/lib/generated/translations/locale_keys.g.dart @@ -128,6 +128,8 @@ abstract class LocaleKeys { static const live_answers_dismiss = 'live_answers.dismiss'; static const live_answers_declined = 'live_answers.declined'; static const live_answers_truncated = 'live_answers.truncated'; + static const live_answers_shortened = 'live_answers.shortened'; + static const live_answers_unsourced = 'live_answers.unsourced'; static const live_answers_error_invalid_key = 'live_answers.error.invalid_key'; static const live_answers_error_rate_limited = 'live_answers.error.rate_limited'; static const live_answers_error_unreachable = 'live_answers.error.unreachable'; From 2e35e8bbf3b2899fb3e3c7da42a1efb7c1795267 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 02:03:44 +0100 Subject: [PATCH 09/17] test(live-answers): live answers via Claude ask for low effort and 1024 max_tokens On the JSON body posted through the real service: output_config {effort: low} and max_tokens 1024 for a live answer (Anthropic 'Reduce latency' guidance); summary and coach requests unchanged; the property rides on the request, so OpenAI, Gemini and Ollama bodies equal those of the same request without it, with no effort field. Red: 1 (the live answer body); the 6 guards are green. --- .../live_answer_latency_test.dart | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 apps/app_macos/test/application/services/live_answers/live_answer_latency_test.dart diff --git a/apps/app_macos/test/application/services/live_answers/live_answer_latency_test.dart b/apps/app_macos/test/application/services/live_answers/live_answer_latency_test.dart new file mode 100644 index 00000000..a8ecf306 --- /dev/null +++ b/apps/app_macos/test/application/services/live_answers/live_answer_latency_test.dart @@ -0,0 +1,197 @@ +import 'dart:convert'; + +import 'package:core_domain/domain/entities/transcript_segment.entity.dart'; +import 'package:core_domain/domain/enum/audio_source.enum.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/live_answers/live_answers.service.dart'; +import 'package:ici_transcript/application/services/llm/llm_provider.dart'; +import 'package:ici_transcript/application/services/llm/meeting_ai.dart'; +import 'package:ici_transcript/core/providers/services/active_llm_provider.provider.dart'; + +import '../../../helpers/live_answers_fakes.dart'; +import '../../../helpers/settings_fakes.dart'; + +/// Latence des réponses en direct avec Claude. Documentation Anthropic, +/// « Reduce latency » (consultée par le coordinateur, 2026-11-23, +/// https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-latency) : +/// l'effort est le premier levier de vitesse ; exemple à `low` avec +/// `"output_config": {"effort": "low"}` et `max_tokens` 1024. +/// +/// Attendu, sur le corps JSON réellement posté : +/// - une requête de RÉPONSE EN DIRECT (construite par `LiveAnswersService`) +/// envoyée par le fournisseur Anthropic porte `output_config: {effort: +/// low}` et `max_tokens` 1024 ; +/// - un résumé ou un retour du coach par le même fournisseur : inchangés +/// (aucun `output_config`, `max_tokens` = `kLlmAnswerMaxTokens`) ; +/// - la propriété « priorité à la latence » est portée par la requête +/// (nom au choix de l'implémenteur) : OpenAI, Gemini et Ollama l'ignorent +/// sans erreur, leur corps est celui de la même requête sans elle. +void main() { + const String claudeKey = 'sk-ant-test-SECRET-0123456789'; + const String question = 'Est-ce que vous avez prévu une date de livraison ?'; + + LlmProvider provider(LlmProviderId id, RecordingHttpAdapter http) => + buildLlmProvider( + id, + dio: Dio()..httpClientAdapter = http, + apiKey: claudeKey, + model: 'model-under-test', + ); + + /// Requête réellement construite par le service pour [question]. + Future liveRequestVia(ScriptedLlmProvider llm) async { + final LiveAnswersService service = LiveAnswersService( + resolveModel: () async => + LiveAnswerModel(provider: llm, modelId: 'model-under-test'), + searchDocuments: FakeDocumentSearch().call, + store: InMemoryQuestionStore(), + )..start('s1'); + addTearDown(service.stop); + service.onSegmentFinalized( + TranscriptSegmentEntity( + id: 'seg-1', + sessionId: 's1', + source: AudioSource.output, + text: question, + timestampMs: 65000, + createdAt: DateTime(2026, 11, 23, 10), + ), + speaker: 0, + ); + await eventually(() => expect(llm.requests, hasLength(1))); + return llm.requests.single; + } + + /// Corps posté par le fournisseur Anthropic pour la réponse en direct, + /// passée par le vrai service. + Future> liveBodyViaService() async { + final RecordingHttpAdapter http = RecordingHttpAdapter( + reply: BodyReply(200, kOkStream[LlmProviderId.anthropic]!), + ); + final LiveAnswersService service = LiveAnswersService( + resolveModel: () async => LiveAnswerModel( + provider: provider(LlmProviderId.anthropic, http), + modelId: 'model-under-test', + ), + searchDocuments: FakeDocumentSearch().call, + store: InMemoryQuestionStore(), + )..start('s1'); + addTearDown(service.stop); + service.onSegmentFinalized( + TranscriptSegmentEntity( + id: 'seg-1', + sessionId: 's1', + source: AudioSource.output, + text: question, + timestampMs: 65000, + createdAt: DateTime(2026, 11, 23, 10), + ), + speaker: 0, + ); + await eventually(() => expect(http.bodies, hasLength(1))); + return http.bodies.single!; + } + + /// La même requête, reconstruite avec les seuls champs d'aujourd'hui. + LlmChatRequest plainCopy(LlmChatRequest r) => LlmChatRequest( + systemPrompt: r.systemPrompt, + messages: r.messages, + maxTokens: r.maxTokens, + model: r.model, + ); + + Future> bodyOf( + LlmProviderId id, + LlmChatRequest request, + ) async { + final RecordingHttpAdapter http = RecordingHttpAdapter( + reply: BodyReply(200, kOkStream[id]!), + ); + await provider(id, http).streamChat(request).drain(); + return http.bodies.single!; + } + + group('Anthropic', () { + test( + 'réponse en direct (vrai service) : effort low et max_tokens 1024', + () async { + final Map body = await liveBodyViaService(); + + expect(body['output_config'], {'effort': 'low'}); + expect(body['max_tokens'], 1024); + }, + ); + + test('résumé : inchangé (pas d\'effort, max_tokens habituel)', () async { + final RecordingHttpAdapter http = RecordingHttpAdapter( + reply: BodyReply(200, kOkStream[LlmProviderId.anthropic]!), + ); + await summarizeMeeting( + provider(LlmProviderId.anthropic, http), + 'Bonjour à tous. On fait le point sur la livraison du lot 1.', + ).drain(); + + final Map body = http.bodies.single!; + expect(body.containsKey('output_config'), isFalse); + expect(body['max_tokens'], kLlmAnswerMaxTokens); + }); + + test('coach : inchangé (pas d\'effort, max_tokens habituel)', () async { + final RecordingHttpAdapter http = RecordingHttpAdapter( + reply: BodyReply(200, kOkStream[LlmProviderId.anthropic]!), + ); + try { + await coachEnglish( + provider(LlmProviderId.anthropic, http), + 'I am agree with you.', + ); + } on Object { + // « OK » n'est pas un retour du coach : seule la requête compte ici. + } + + final Map body = http.bodies.single!; + expect(body.containsKey('output_config'), isFalse); + expect(body['max_tokens'], kLlmAnswerMaxTokens); + }); + + test('la même requête sans la propriété de latence : pas d\'effort (la ' + 'propriété est portée par la requête du direct)', () async { + final LlmChatRequest live = await liveRequestVia(ScriptedLlmProvider()); + + final Map body = await bodyOf( + LlmProviderId.anthropic, + plainCopy(live), + ); + + expect(body.containsKey('output_config'), isFalse); + }); + }); + + group('autres fournisseurs : propriété ignorée, sans erreur', () { + for (final LlmProviderId id in [ + LlmProviderId.openai, + LlmProviderId.gemini, + LlmProviderId.ollama, + ]) { + test('${id.name} : corps identique à celui de la même requête sans ' + 'elle, aucun champ d\'effort', () async { + final LlmChatRequest live = await liveRequestVia(ScriptedLlmProvider()); + + final Map withIt = await bodyOf(id, live); + final Map without = await bodyOf(id, plainCopy(live)); + + expect(jsonEncode(withIt), jsonEncode(without)); + final String encoded = jsonEncode(withIt); + for (final String field in [ + 'output_config', + 'effort', + 'reasoning_effort', + 'thinking', + ]) { + expect(encoded, isNot(contains('"$field"')), reason: field); + } + }); + } + }); +} From 5d80a1da0d26b264a68ab95e0d4394fd05edf5b5 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 02:04:33 +0100 Subject: [PATCH 10/17] test(live-answers): the shortened sign survives closing and reopening the note Real LiveAnswersService over the real question store on an in-memory Drift database: a recorded 9-line answer is shortened during the meeting; after the container is disposed, the reopened note shows live_answers.shortened. A short answer shows none. Red: 1 (the flag is not stored today). --- .../history/shortened_answer_reopen_test.dart | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 apps/app_macos/test/features/history/shortened_answer_reopen_test.dart diff --git a/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart b/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart new file mode 100644 index 00000000..89ee8ff5 --- /dev/null +++ b/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart @@ -0,0 +1,148 @@ +import 'dart:ui' show Size; + +import 'package:core_data/database/app_database.dart'; +import 'package:core_domain/domain/entities/session.entity.dart'; +import 'package:core_domain/domain/entities/transcript_segment.entity.dart'; +import 'package:core_domain/domain/enum/audio_source.enum.dart'; +import 'package:core_domain/domain/enum/session_status.enum.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/misc.dart' show Override; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/live_answers/live_answers.service.dart'; +import 'package:ici_transcript/application/services/live_answers/live_question.dart'; +import 'package:ici_transcript/application/services/live_answers/question_store.dart'; +import 'package:ici_transcript/core/providers/core/repositories/session.repository.provider.dart'; +import 'package:ici_transcript/core/providers/services/question_store.provider.dart'; +import 'package:ici_transcript/features/history/presentation/screens/detail/session_detail.screen.dart'; +import 'package:ici_transcript/features/onboarding/presentation/ollama_setup.view_model.dart'; + +import '../../helpers/fake_view_models.dart'; +import '../../helpers/live_answers_fakes.dart'; +import '../../helpers/local_model_fakes.dart'; +import '../../helpers/localized_app.dart'; +import '../../helpers/probe_outputs.dart'; +import '../../helpers/settings_fakes.dart' show eventually; + +/// « Réponse raccourcie » survit à la réouverture de la note : une réponse +/// raccourcie pendant la réunion (plus de trois puces, sortie réelle du +/// modèle local) garde son signe dans le détail de la note, une fois la +/// note fermée puis rouverte. Vrai `LiveAnswersService`, vrai stockage +/// (`questionStoreProvider` sur une base Drift en mémoire), vrai view model +/// du détail ; seul le LLM est piloté par le test. +/// +/// Le signe dans le panneau du direct est déjà fixé par +/// live_answers_panel_test.dart ; ici, seule la réouverture. +void main() { + late AppDatabase db; + late InstantOllamaService ollama; + const String question = + 'Tu as une date pour la recette avec le prestataire ?'; + + List overrides() => [ + ...localModelOverrides(db, ollama), + ollamaSetupViewModelProvider.overrideWith( + () => FakeOllamaSetupViewModel(kOllamaReady), + ), + ]; + + /// La réunion : la question arrive, le modèle répond par une sortie + /// enregistrée de [rawKey] ; la réponse est sauvée comme en direct. + Future meeting(WidgetTester tester, String rawKey) async { + return tester.runAsync(() async { + final ProviderContainer c = ProviderContainer(overrides: overrides()); + final DateTime start = DateTime(2026, 11, 23, 9); + await c + .read(sessionRepositoryProvider) + .create( + SessionEntity( + id: 's1', + title: 'Point outil de réservation', + createdAt: start, + updatedAt: start, + durationSeconds: 600, + status: SessionStatus.completed, + ), + ); + final QuestionStore store = c.read(questionStoreProvider); + final ScriptedLlmProvider llm = ScriptedLlmProvider(); + final LiveAnswersService service = LiveAnswersService( + resolveModel: () async => + LiveAnswerModel(provider: llm, modelId: 'claude-haiku-5-5'), + searchDocuments: FakeDocumentSearch().call, + store: store, + )..start('s1'); + service.onSegmentFinalized( + TranscriptSegmentEntity( + id: 'seg-1', + sessionId: 's1', + source: AudioSource.output, + text: question, + timestampMs: 65000, + createdAt: start, + ), + speaker: 0, + ); + await eventually(() => expect(llm.requests, hasLength(1))); + llm.last.reply(probe(rawKey).raw); + await eventually( + () async => expect( + (await store.forSession('s1')).single.status, + LiveQuestionStatus.answered, + ), + ); + final bool shortened = service.questions.single.shortened; + await service.stop(); + // Note fermée : plus rien en mémoire, seule la base reste. + c.dispose(); + return shortened; + }); + } + + Future reopenNote(WidgetTester tester) async { + await pumpLocalized( + tester, + SessionDetailScreen(sessionId: 's1', onClose: () {}), + size: const Size(1280, 3000), + settle: false, + overrides: overrides(), + ); + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 50)), + ); + await settle(tester); + } + + setUp(() { + db = memoryDatabase(); + ollama = InstantOllamaService(installed: true); + }); + tearDown(() => db.close()); + + testWidgets( + 'réponse raccourcie : le signe est toujours là à la réouverture', + (WidgetTester tester) async { + expect( + await meeting(tester, 'contract/fr1-c#0'), + isTrue, + reason: 'raccourcie pendant la réunion', + ); + + await reopenNote(tester); + + expect(find.text(question), findsOneWidget); + expect(find.text('live_answers.shortened'.tr()), findsOneWidget); + }, + ); + + testWidgets('réponse courte : pas de signe à la réouverture', ( + WidgetTester tester, + ) async { + expect(await meeting(tester, 'contract/en1-a1#0'), isFalse); + + await reopenNote(tester); + + expect(find.text(question), findsOneWidget); + expect(find.text('live_answers.shortened'.tr()), findsNothing); + }); +} From af9eefb9dcb375d8d9a27df101a009d363b9ffa7 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 02:06:48 +0100 Subject: [PATCH 11/17] Ask Claude for low effort on live answers Why: Anthropic's 'Reduce latency' guide: effort is Haiku 5.5's main speed control; its example uses output_config effort low with max_tokens 1024. What: LlmChatRequest.preferLowLatency (provider-neutral), set once by buildLiveAnswerRequest; the Anthropic provider then sends output_config {effort: low} and max_tokens 1024. Summary and coach requests, and OpenAI, Gemini and Ollama bodies, are unchanged. Proof: live_answer_latency and answer_prompt specs green; llm provider specs green; analyze clean. --- .../services/live_answers/answer_prompt.dart | 2 ++ .../services/llm/anthropic_llm_provider.dart | 10 +++++++++- .../lib/application/services/llm/llm_provider.dart | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart b/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart index 6dd2b5c4..44322934 100644 --- a/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart +++ b/apps/app_macos/lib/application/services/live_answers/answer_prompt.dart @@ -105,6 +105,8 @@ LlmChatRequest buildLiveAnswerRequest({ // Large : chez certains modèles, la réflexion compte dans cette borne ; // la tête et trois puces ne doivent jamais être coupées. maxTokens: kLlmAnswerMaxTokens, + // Réponse courte en direct : la latence prime (effort bas chez Claude). + preferLowLatency: true, ); } diff --git a/apps/app_macos/lib/application/services/llm/anthropic_llm_provider.dart b/apps/app_macos/lib/application/services/llm/anthropic_llm_provider.dart index 93c23d50..7ddf6f30 100644 --- a/apps/app_macos/lib/application/services/llm/anthropic_llm_provider.dart +++ b/apps/app_macos/lib/application/services/llm/anthropic_llm_provider.dart @@ -18,6 +18,10 @@ class AnthropicLlmProvider implements LlmProvider { /// Modele rapide par defaut. static const String defaultModel = 'claude-haiku-5-5'; + /// `max_tokens` d'une requête [LlmChatRequest.preferLowLatency] : la + /// documentation « Reduce latency » associe effort `low` et 1024 jetons. + static const int lowLatencyMaxTokens = 1024; + /// Version de l'API (en-tete `anthropic-version`). static const String apiVersion = '2026-10-21'; @@ -39,7 +43,11 @@ class AnthropicLlmProvider implements LlmProvider { }, body: { 'model': request.model ?? _model, - 'max_tokens': request.maxTokens, + 'max_tokens': request.preferLowLatency + ? lowLatencyMaxTokens + : request.maxTokens, + if (request.preferLowLatency) + 'output_config': {'effort': 'low'}, 'stream': true, 'system': request.systemPrompt, 'messages': >[ diff --git a/apps/app_macos/lib/application/services/llm/llm_provider.dart b/apps/app_macos/lib/application/services/llm/llm_provider.dart index f8d1380c..dc8cdc21 100644 --- a/apps/app_macos/lib/application/services/llm/llm_provider.dart +++ b/apps/app_macos/lib/application/services/llm/llm_provider.dart @@ -42,6 +42,7 @@ class LlmChatRequest { required this.messages, required this.maxTokens, this.model, + this.preferLowLatency = false, }); /// Consignes systeme. @@ -55,6 +56,11 @@ class LlmChatRequest { /// Modele demande ; null = modele rapide par defaut du fournisseur. final String? model; + + /// Réponse courte où la latence prime (réponses en direct). Un + /// fournisseur qui a un réglage pour cela l'applique, les autres + /// l'ignorent. + final bool preferLowLatency; } /// Fournisseur LLM : une requete de chat -> un flux de morceaux de texte. From 52e002439af04ed8ff69216b30d689eafe0a65a8 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 02:10:46 +0100 Subject: [PATCH 12/17] Keep the shortened sign when a note is reopened MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: 'Réponse raccourcie' was lost on reopening; the coordinator chose a new value of the existing status column over a migration. What: status 'shortened' (answered, text shown shortened), written by the DAO when not truncated (truncated wins); storedStatus is the one place that reads a status: shortened = answered + sign, and any value this build does not know reads as plain answered (answer kept visible, was 'unanswered' before). Schema stays v3, no migration. Proof: shortened_answer_reopen, question_store, session_detail_questions and detected_question_dao specs green; analyze clean (app, core_data). --- .../services/live_answers/question_store.dart | 59 +++++++++++++++---- .../core_data/lib/database/app_database.dart | 3 +- .../lib/database/app_database.g.dart | 3 +- .../database/dao/detected_question.dao.dart | 15 ++++- 4 files changed, 62 insertions(+), 18 deletions(-) diff --git a/apps/app_macos/lib/application/services/live_answers/question_store.dart b/apps/app_macos/lib/application/services/live_answers/question_store.dart index d2f24f65..312bfccf 100644 --- a/apps/app_macos/lib/application/services/live_answers/question_store.dart +++ b/apps/app_macos/lib/application/services/live_answers/question_store.dart @@ -50,6 +50,7 @@ class DriftQuestionStore implements QuestionStore { answer: question.answer, model: question.model ?? '', truncated: question.truncated, + shortened: question.shortened, sources: [ for (final AnswerSource s in question.sources) (documentId: s.documentId, title: s.title, excerpt: s.excerpt), @@ -75,9 +76,7 @@ class DriftQuestionStore implements QuestionStore { ]; static LiveQuestion _read(DetectedQuestion row) { - final ({LiveQuestionStatus status, bool truncated}) s = storedStatus( - row.status, - ); + final StoredStatus s = storedStatus(row.status); return LiveQuestion( id: row.id, sessionId: row.sessionId, @@ -88,6 +87,7 @@ class DriftQuestionStore implements QuestionStore { timestampMs: row.timestampMs, status: s.status, truncated: s.truncated, + shortened: s.shortened, answer: row.answer ?? '', model: row.answerModel, sources: _sources(row.sources), @@ -112,13 +112,46 @@ class DriftQuestionStore implements QuestionStore { } } -/// Statut rangé en base (`unanswered`, `answered`, `truncated`, `declined`, -/// `failed`) → état relu. Inconnu = sans réponse. -({LiveQuestionStatus status, bool truncated}) storedStatus(String stored) => - switch (stored) { - 'answered' => (status: LiveQuestionStatus.answered, truncated: false), - 'truncated' => (status: LiveQuestionStatus.answered, truncated: true), - 'declined' => (status: LiveQuestionStatus.declined, truncated: false), - 'failed' => (status: LiveQuestionStatus.failed, truncated: false), - _ => (status: LiveQuestionStatus.detected, truncated: false), - }; +/// Statut rangé en base → état relu ; seul endroit qui le lit. +/// `shortened` = répondue, texte montré raccourci. Valeur inconnue (rangée +/// par une version plus récente) = répondue : la réponse reste montrée. +typedef StoredStatus = ({ + LiveQuestionStatus status, + bool truncated, + bool shortened, +}); + +StoredStatus storedStatus(String stored) => switch (stored) { + 'unanswered' => ( + status: LiveQuestionStatus.detected, + truncated: false, + shortened: false, + ), + 'truncated' => ( + status: LiveQuestionStatus.answered, + truncated: true, + shortened: false, + ), + 'shortened' => ( + status: LiveQuestionStatus.answered, + truncated: false, + shortened: true, + ), + 'declined' => ( + status: LiveQuestionStatus.declined, + truncated: false, + shortened: false, + ), + 'failed' => ( + status: LiveQuestionStatus.failed, + truncated: false, + shortened: false, + ), + // 'answered', et toute valeur qu'une version plus récente aurait rangée : + // la réponse reste montrée. + _ => ( + status: LiveQuestionStatus.answered, + truncated: false, + shortened: false, + ), +}; diff --git a/packages/core_data/lib/database/app_database.dart b/packages/core_data/lib/database/app_database.dart index beadfb78..6445b454 100644 --- a/packages/core_data/lib/database/app_database.dart +++ b/packages/core_data/lib/database/app_database.dart @@ -109,7 +109,8 @@ class DetectedQuestions extends Table { /// Sources de la reponse, liste JSON {documentId, title, excerpt}. TextColumn get sources => text().nullable()(); - /// Etat : unanswered, answered, declined, truncated, failed (schema v3). + /// Etat : unanswered, answered, shortened, declined, truncated, failed + /// (schema v3 ; shortened = repondue, texte montre raccourci). TextColumn get status => text().withDefault(const Constant('unanswered'))(); diff --git a/packages/core_data/lib/database/app_database.g.dart b/packages/core_data/lib/database/app_database.g.dart index edfc24a5..f22aa66c 100644 --- a/packages/core_data/lib/database/app_database.g.dart +++ b/packages/core_data/lib/database/app_database.g.dart @@ -1803,7 +1803,8 @@ class DetectedQuestion extends DataClass /// Sources de la reponse, liste JSON {documentId, title, excerpt}. final String? sources; - /// Etat : unanswered, answered, declined, truncated, failed (schema v3). + /// Etat : unanswered, answered, shortened, declined, truncated, failed + /// (schema v3 ; shortened = repondue, texte montre raccourci). final String status; /// Interlocuteur (0, 1, ...) range en texte, null si inconnu (schema v3). diff --git a/packages/core_data/lib/database/dao/detected_question.dao.dart b/packages/core_data/lib/database/dao/detected_question.dao.dart index 9a54edec..67c743c4 100644 --- a/packages/core_data/lib/database/dao/detected_question.dao.dart +++ b/packages/core_data/lib/database/dao/detected_question.dao.dart @@ -16,7 +16,7 @@ typedef StoredAnswerSource = ({ /// DAO des questions détectées en direct : sauvées à la détection, /// complétées à la fin du flux, supprimées avec leur session (trigger). /// -/// `status` : unanswered, answered, declined, truncated, failed. +/// `status` : unanswered, answered, shortened, declined, truncated, failed. @DriftAccessor(tables: [DetectedQuestions]) class DetectedQuestionDao extends DatabaseAccessor with _$DetectedQuestionDaoMixin { @@ -50,20 +50,29 @@ class DetectedQuestionDao extends DatabaseAccessor } /// Complète la question [id] : réponse, modèle et sources (statut - /// `answered`, ou `truncated` si [truncated]). + /// `answered`, `truncated` si [truncated], sinon `shortened` si + /// [shortened]). Future saveAnswer( String id, { required String answer, required String model, required List sources, bool truncated = false, + bool shortened = false, }) { return _write( id, DetectedQuestionsCompanion( answer: Value(answer), answerModel: Value(model), - status: Value(truncated ? 'truncated' : 'answered'), + // Coupée prime sur raccourcie : un seul état par ligne. + status: Value( + truncated + ? 'truncated' + : shortened + ? 'shortened' + : 'answered', + ), sources: Value( jsonEncode(>[ for (final StoredAnswerSource s in sources) From a6d09d50f7a5f8cfcc38c8235bc772d81eeb0e1b Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 02:13:34 +0100 Subject: [PATCH 13/17] test(live-answers): unknown stored status and truncated-plus-shortened answers on reopen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - A status written by a later version, with an answer text: plain answer, no sign, sources kept (green); with no answer text: 'Sans réponse', never an empty answer, no crash (red: it reads as answered). - An answer both cut by generation and shortened (kept cited block ends on a function word): after reopening, the headline stays and at least one incompleteness sign remains (green). --- .../history/shortened_answer_reopen_test.dart | 59 +++++++- .../history/unknown_question_status_test.dart | 139 ++++++++++++++++++ 2 files changed, 195 insertions(+), 3 deletions(-) create mode 100644 apps/app_macos/test/features/history/unknown_question_status_test.dart diff --git a/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart b/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart index 89ee8ff5..5747ae17 100644 --- a/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart +++ b/apps/app_macos/test/features/history/shortened_answer_reopen_test.dart @@ -9,6 +9,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/misc.dart' show Override; import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/documents/document_library.dart'; import 'package:ici_transcript/application/services/live_answers/live_answers.service.dart'; import 'package:ici_transcript/application/services/live_answers/live_question.dart'; import 'package:ici_transcript/application/services/live_answers/question_store.dart'; @@ -48,7 +49,13 @@ void main() { /// La réunion : la question arrive, le modèle répond par une sortie /// enregistrée de [rawKey] ; la réponse est sauvée comme en direct. - Future meeting(WidgetTester tester, String rawKey) async { + Future meeting( + WidgetTester tester, + String rawKey, { + String? raw, + List excerpts = const [], + void Function(LiveQuestion q)? check, + }) async { return tester.runAsync(() async { final ProviderContainer c = ProviderContainer(overrides: overrides()); final DateTime start = DateTime(2026, 11, 23, 9); @@ -69,7 +76,7 @@ void main() { final LiveAnswersService service = LiveAnswersService( resolveModel: () async => LiveAnswerModel(provider: llm, modelId: 'claude-haiku-5-5'), - searchDocuments: FakeDocumentSearch().call, + searchDocuments: (FakeDocumentSearch()..results = excerpts).call, store: store, )..start('s1'); service.onSegmentFinalized( @@ -84,7 +91,7 @@ void main() { speaker: 0, ); await eventually(() => expect(llm.requests, hasLength(1))); - llm.last.reply(probe(rawKey).raw); + llm.last.reply(raw ?? probe(rawKey).raw); await eventually( () async => expect( (await store.forSession('s1')).single.status, @@ -92,6 +99,7 @@ void main() { ), ); final bool shortened = service.questions.single.shortened; + check?.call(service.questions.single); await service.stop(); // Note fermée : plus rien en mémoire, seule la base reste. c.dispose(); @@ -145,4 +153,49 @@ void main() { expect(find.text(question), findsOneWidget); expect(find.text('live_answers.shortened'.tr()), findsNothing); }); + + testWidgets('réponse à la fois coupée par la génération et raccourcie : à ' + 'la réouverture, la tête reste et au moins un signe d\'incomplétude', ( + WidgetTester tester, + ) async { + // Deux blocs : le bloc gardé est celui qui cite l'extrait fourni (donc + // raccourcie), et sa dernière puce est coupée sur un mot outil + // (génération arrêtée au milieu d'une phrase). + const String raw = + 'Planning général\n' + '- Le pilote démarre en mars.\n' + '\n' + 'La recette avec le prestataire est prévue après le pilote [S1].\n' + '- La date reste à confirmer avec le prestataire.\n' + '- Le bilan sera présenté pour le'; + await meeting( + tester, + 'contract/fr1-c#0', + raw: raw, + excerpts: const [ + DocumentExcerpt( + documentId: 'doc-planning', + documentTitle: 'Planning du projet', + text: 'La recette aura lieu après la phase pilote, date à confirmer.', + ), + ], + check: (LiveQuestion q) { + expect(q.shortened, isTrue, reason: 'raccourcie pendant la réunion'); + expect(q.truncated, isTrue, reason: 'coupée pendant la réunion'); + }, + ); + + await reopenNote(tester); + + expect( + find.textContaining( + 'La recette avec le prestataire est prévue après le pilote', + ), + findsOneWidget, + ); + final int signs = + find.text('live_answers.shortened'.tr()).evaluate().length + + find.text('live_answers.truncated'.tr()).evaluate().length; + expect(signs, greaterThanOrEqualTo(1)); + }); } diff --git a/apps/app_macos/test/features/history/unknown_question_status_test.dart b/apps/app_macos/test/features/history/unknown_question_status_test.dart new file mode 100644 index 00000000..9df7ce16 --- /dev/null +++ b/apps/app_macos/test/features/history/unknown_question_status_test.dart @@ -0,0 +1,139 @@ +import 'dart:ui' show Size; + +import 'package:core_data/database/app_database.dart'; +import 'package:core_data/database/dao/detected_question.dao.dart'; +import 'package:core_domain/domain/entities/session.entity.dart'; +import 'package:core_domain/domain/enum/session_status.enum.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_riverpod/misc.dart' show Override; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/core/providers/core/repositories/session.repository.provider.dart'; +import 'package:ici_transcript/features/history/presentation/screens/detail/session_detail.screen.dart'; +import 'package:ici_transcript/features/onboarding/presentation/ollama_setup.view_model.dart'; + +import '../../helpers/fake_view_models.dart'; +import '../../helpers/local_model_fakes.dart'; +import '../../helpers/localized_app.dart'; + +/// Une question rangée avec un `status` que ce build ne connaît pas (écrit +/// par une version plus récente) : avec un texte de réponse, elle se lit +/// comme une réponse simple (sans signe, avec ses sources) ; sans texte de +/// réponse, comme une question sans réponse (jamais une « réponse » vide). +/// Rien ne plante. Vrai stockage (Drift en mémoire) jusqu'au détail de note. +void main() { + late AppDatabase db; + late InstantOllamaService ollama; + const String withAnswer = 'Quel est le préavis du contrat d\'hébergement ?'; + const String withoutAnswer = 'Combien coûte la licence par utilisateur ?'; + + List overrides() => [ + ...localModelOverrides(db, ollama), + ollamaSetupViewModelProvider.overrideWith( + () => FakeOllamaSetupViewModel(kOllamaReady), + ), + ]; + + setUp(() { + db = memoryDatabase(); + ollama = InstantOllamaService(installed: true); + }); + tearDown(() => db.close()); + + Future storeRows(WidgetTester tester) => tester.runAsync(() async { + final ProviderContainer c = ProviderContainer(overrides: overrides()); + final DateTime start = DateTime(2026, 11, 23, 9); + await c + .read(sessionRepositoryProvider) + .create( + SessionEntity( + id: 's1', + title: 'Point contrat', + createdAt: start, + updatedAt: start, + durationSeconds: 600, + status: SessionStatus.completed, + ), + ); + c.dispose(); + final DetectedQuestionDao dao = DetectedQuestionDao(db); + await dao.insertDetected( + id: 'q1', + sessionId: 's1', + question: withAnswer, + timestampMs: 60000, + createdAt: start, + source: 'output', + speaker: '0', + ); + await dao.saveAnswer( + 'q1', + answer: 'Le préavis est de 90 jours. [S1]', + model: 'claude-haiku-5-5', + sources: const [ + ( + documentId: 'doc-contrat', + title: 'Contrat d\'hébergement', + excerpt: 'Chaque partie peut résilier avec un préavis de 90 jours.', + ), + ], + ); + await dao.insertDetected( + id: 'q2', + sessionId: 's1', + question: withoutAnswer, + timestampMs: 120000, + createdAt: start, + source: 'output', + ); + // Valeur écrite par une version future. + await db.customStatement( + "UPDATE detected_questions SET status = 'reviewed_by_user_v9'", + ); + }); + + Future openNote(WidgetTester tester) async { + await pumpLocalized( + tester, + SessionDetailScreen(sessionId: 's1', onClose: () {}), + size: const Size(1280, 3000), + settle: false, + overrides: overrides(), + ); + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 50)), + ); + await settle(tester); + } + + testWidgets('avec réponse : réponse simple, sans signe, avec sa source', ( + WidgetTester tester, + ) async { + await storeRows(tester); + await openNote(tester); + + expect(tester.takeException(), isNull); + expect(find.text(withAnswer), findsOneWidget); + expect(find.textContaining('Le préavis est de 90 jours.'), findsOneWidget); + expect(find.textContaining('Contrat d\'hébergement'), findsWidgets); + for (final String sign in [ + 'live_answers.shortened', + 'live_answers.truncated', + 'live_answers.declined', + 'history.detail.answer_failed', + ]) { + expect(find.text(sign.tr()), findsNothing, reason: sign); + } + }); + + testWidgets('sans réponse : « Sans réponse », jamais une réponse vide', ( + WidgetTester tester, + ) async { + await storeRows(tester); + await openNote(tester); + + expect(tester.takeException(), isNull); + expect(find.text(withoutAnswer), findsOneWidget); + expect(find.text('history.detail.no_answer'.tr()), findsOneWidget); + }); +} From 3c5a66b62d412fbf60b516334752995ea9fdf1d6 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 02:14:24 +0100 Subject: [PATCH 14/17] Read an unknown question status by its answer text Why: an unknown status with no answer showed as an empty answer. What: storedStatus (the one mapping) reads an unknown value as answered when an answer text is stored, as not answered otherwise. Proof: unknown_question_status, shortened_answer_reopen and question_store specs green; analyze clean. --- .../services/live_answers/question_store.dart | 84 +++++++++++-------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/apps/app_macos/lib/application/services/live_answers/question_store.dart b/apps/app_macos/lib/application/services/live_answers/question_store.dart index 312bfccf..4b0b83c3 100644 --- a/apps/app_macos/lib/application/services/live_answers/question_store.dart +++ b/apps/app_macos/lib/application/services/live_answers/question_store.dart @@ -76,7 +76,10 @@ class DriftQuestionStore implements QuestionStore { ]; static LiveQuestion _read(DetectedQuestion row) { - final StoredStatus s = storedStatus(row.status); + final StoredStatus s = storedStatus( + row.status, + hasAnswer: (row.answer ?? '').trim().isNotEmpty, + ); return LiveQuestion( id: row.id, sessionId: row.sessionId, @@ -114,44 +117,53 @@ class DriftQuestionStore implements QuestionStore { /// Statut rangé en base → état relu ; seul endroit qui le lit. /// `shortened` = répondue, texte montré raccourci. Valeur inconnue (rangée -/// par une version plus récente) = répondue : la réponse reste montrée. +/// par une version plus récente) = répondue si un texte de réponse est +/// rangé, sinon sans réponse. typedef StoredStatus = ({ LiveQuestionStatus status, bool truncated, bool shortened, }); -StoredStatus storedStatus(String stored) => switch (stored) { - 'unanswered' => ( - status: LiveQuestionStatus.detected, - truncated: false, - shortened: false, - ), - 'truncated' => ( - status: LiveQuestionStatus.answered, - truncated: true, - shortened: false, - ), - 'shortened' => ( - status: LiveQuestionStatus.answered, - truncated: false, - shortened: true, - ), - 'declined' => ( - status: LiveQuestionStatus.declined, - truncated: false, - shortened: false, - ), - 'failed' => ( - status: LiveQuestionStatus.failed, - truncated: false, - shortened: false, - ), - // 'answered', et toute valeur qu'une version plus récente aurait rangée : - // la réponse reste montrée. - _ => ( - status: LiveQuestionStatus.answered, - truncated: false, - shortened: false, - ), -}; +StoredStatus storedStatus(String stored, {required bool hasAnswer}) => + switch (stored) { + 'unanswered' => ( + status: LiveQuestionStatus.detected, + truncated: false, + shortened: false, + ), + 'truncated' => ( + status: LiveQuestionStatus.answered, + truncated: true, + shortened: false, + ), + 'shortened' => ( + status: LiveQuestionStatus.answered, + truncated: false, + shortened: true, + ), + 'declined' => ( + status: LiveQuestionStatus.declined, + truncated: false, + shortened: false, + ), + 'failed' => ( + status: LiveQuestionStatus.failed, + truncated: false, + shortened: false, + ), + 'answered' => ( + status: LiveQuestionStatus.answered, + truncated: false, + shortened: false, + ), + // Valeur qu'une version plus récente aurait rangée : la réponse reste + // montrée ; sans texte, la question reste sans réponse. + _ => ( + status: hasAnswer + ? LiveQuestionStatus.answered + : LiveQuestionStatus.detected, + truncated: false, + shortened: false, + ), + }; From 79a8b15a7df7e9231594ee151491c55fbaa485bb Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 03:01:14 +0100 Subject: [PATCH 15/17] test(live-answers): sourced negatives stay answers; text parentheses are not citations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review of PR #23: a title with a cited bullet and a 'non précisée'/'not specified' detail, and sourced world-state negatives ('Breakfast is not provided. [S1]', 'n'est pas indiqué comme inclus [S2]', 'Aucune information confidentielle [S1]') must stay answers; '(14:30)' and '(S2)' stay text. Red: 8. Green: answer then 'The exact date is not specified.', [S2] chip; the 12 recorded refusals still decline. --- .../answer_parser_review_test.dart | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 apps/app_macos/test/application/services/live_answers/answer_parser_review_test.dart diff --git a/apps/app_macos/test/application/services/live_answers/answer_parser_review_test.dart b/apps/app_macos/test/application/services/live_answers/answer_parser_review_test.dart new file mode 100644 index 00000000..054e0f5c --- /dev/null +++ b/apps/app_macos/test/application/services/live_answers/answer_parser_review_test.dart @@ -0,0 +1,101 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:ici_transcript/application/services/documents/document_library.dart'; +import 'package:ici_transcript/application/services/live_answers/answer_parser.dart'; +import 'package:ici_transcript/application/services/live_answers/live_question.dart'; + +/// Revue de PR #23 : la règle du refus en prose ne doit pas cacher une +/// réponse sourcée, et le nettoyage des citations ne doit pas toucher aux +/// parenthèses du texte. Les 12 refus enregistrés restent fixés par +/// recorded_outputs_test.dart (inchangé). +void main() { + const List excerpts = [ + DocumentExcerpt( + documentId: 'doc-gite', + documentTitle: 'Informations du gîte', + text: 'Le petit-déjeuner n\'est pas fourni. Arrivée possible dès 10 h.', + ), + DocumentExcerpt( + documentId: 'doc-offre', + documentTitle: 'Offre de base', + text: 'Le support n\'est pas inclus dans l\'offre de base.', + ), + ]; + + ParsedAnswer parse(String raw) => parseAnswer(raw, excerpts); + + group('1. réponses sourcées qui contiennent une négation : réponses', () { + for (final String raw in [ + 'Arrivée au gîte\n' + '- L\'arrivée est possible dès 10 h [S1].\n' + '- L\'heure exacte du dîner n\'est pas précisée.', + 'Arrival at the lodge\n' + '- Arrival is possible from 10 am [S1].\n' + '- The exact dinner time is not specified.', + 'Arrivée au gîte :\n' + '- L\'arrivée est possible dès 10 h [S1].\n' + '- L\'heure du dîner non précisée.', + ]) { + test('titre, puce sourcée avec du contenu, puce « non précisé » : ' + 'réponse (${raw.split('\n').first})', () { + final ParsedAnswer a = parse(raw); + expect(a.declined, isFalse); + expect(a.text, contains('10')); + expect(a.sources.map((AnswerSource s) => s.documentId), [ + 'doc-gite', + ]); + }); + } + + for (final String raw in [ + 'Breakfast is not provided. [S1]', + 'Le support n\'est pas indiqué comme inclus dans l\'offre de base. [S2]', + 'Aucune information confidentielle ne doit sortir. [S1]', + ]) { + test('état du monde sourcé « $raw » : réponse', () { + final ParsedAnswer a = parse(raw); + expect(a.declined, isFalse); + expect(a.headline, isNotEmpty); + expect(a.sources, isNotEmpty); + }); + } + + test('tête qui répond puis « The exact date is not specified. » : ' + 'réponse', () { + final ParsedAnswer a = parse( + 'The meeting with the vendor takes place after the pilot [S1]. ' + 'The exact date is not specified.', + ); + expect(a.declined, isFalse); + expect(a.text, contains('after the pilot')); + }); + }); + + group('2. parenthèses du texte : gardées', () { + test('« (14:30) » dans une réponse sur une heure : gardé tel quel', () { + final ParsedAnswer a = parse( + 'Le point avec le prestataire est jeudi après-midi (14:30) [S1].', + ); + expect(a.text, contains('(14:30)')); + expect(a.sources.map((AnswerSource s) => s.documentId), [ + 'doc-gite', + ]); + }); + + test('« (S2) » pour un semestre : du texte, pas une citation', () { + final ParsedAnswer a = parse( + 'Le nouveau module arrive au second semestre (S2) 2027.', + ); + expect(a.text, contains('(S2)')); + expect(a.sources, isEmpty); + }); + + test('« [S2] » entre crochets reste une citation', () { + final ParsedAnswer a = parse( + 'Le support n\'est pas inclus dans l\'offre de base [S2].', + ); + expect(a.sources.map((AnswerSource s) => s.documentId), [ + 'doc-offre', + ]); + }); + }); +} From eeb897ead26e288c897e783088045a155250bd79 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 03:01:58 +0100 Subject: [PATCH 16/17] test(live-answers): a sourced 'not specified, to be confirmed [S1]' is shown, not refused Decision on the review of PR #23: showing a weak sourced answer beats hiding a real one. clean/fr1-c#0 moves from the 12 refusals to the answers; the header states the accepted rule (sentence head, title head, parentheses). Red: clean/fr1-c#0 here plus the 8 review cases. --- .../live_answers/recorded_outputs_test.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart b/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart index fd55e351..f0d501fc 100644 --- a/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart +++ b/apps/app_macos/test/application/services/live_answers/recorded_outputs_test.dart @@ -27,9 +27,12 @@ import '../../../helpers/probe_outputs.dart'; /// été mentionnés », « non spécifié/indiqué/précisé », « ne connaît pas », /// « aucune information ») ou que le texte n'est pas une question pour /// l'utilisateur (« the question is a comment, not a question »). La phrase -/// qui répond = la première phrase de la tête ; si la tête est un titre -/// (sans ponctuation finale, ou finie par « : », suivi de puces), toute -/// ligne compte. Un état du monde (« not yet approved », « yet to be +/// qui répond = la première phrase de la tête : refus si elle refuse sans +/// citer d'extrait fourni, ou si elle renvoie aux sources (« ici », « in +/// the provided/given … ») ; si la tête est un titre (sans ponctuation +/// finale, ou finie par « : », suivi de puces) : refus si la première puce +/// refuse, ou si une ligne refuse et qu'aucune ne cite d'extrait fourni. +/// Parenthèses : seuls `([Sn])` et `(User|Speaker…, heure)` sont nettoyés. Un état du monde (« not yet approved », « yet to be /// confirmed », « does not include ») reste une réponse. /// - Jeton `NO_ANSWER` (avec ou sans crochets) ailleurs qu'en tête : la ligne /// qui le porte est retirée ; s'il ne reste rien de substantiel (seulement @@ -66,7 +69,6 @@ void main() { 'contract/fr3-c#2', 'contract/en2-c#2', 'contract/en3-c#2', - 'clean/fr1-c#0', 'clean/en3-c#0', 'contract/fr2-d#2', ]) { @@ -80,6 +82,9 @@ void main() { for (final String key in [ // Réponses qui contiennent une négation : elles restent des réponses. + // Refus sourcé (« non spécifiée, à confirmer [S1] ») : montré, l'extrait + // du planning le dit ; mieux qu'une vraie réponse cachée (décision). + 'clean/fr1-c#0', 'contract/en2-a#1', 'contract/fr3-b#2', 'clean/fr1-a2#0', From eb894ce6011832ac4db4a400ae715b1963da6973 Mon Sep 17 00:00:00 2001 From: Clement Guyon Date: Mon, 23 Nov 2026 03:05:40 +0100 Subject: [PATCH 17/17] Keep sourced negative answers and text parentheses Why: PR #23 review: the prose-refusal rule hid answers backed by a cited excerpt, and citation clean-up ate '(14:30)' and '(S2)'. What: sentence head declines only when it refuses without citing a provided excerpt, or points back to the sources ('ici', 'in the provided/given'); title head declines when the first bullet refuses, or a line refuses and no bullet cites an excerpt (a cited title alone does not count, as in the recorded en2-c#1); only '([Sn])' and '(User|Speaker, time)' parentheses are cleaned. Proof: answer_parser_review and all live_answers specs green (384, the 11 recorded refusals included); full app suite +1632 green; analyze clean. --- .../services/live_answers/answer_parser.dart | 78 +++++++++++++------ 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/apps/app_macos/lib/application/services/live_answers/answer_parser.dart b/apps/app_macos/lib/application/services/live_answers/answer_parser.dart index 205d7496..78cc0b58 100644 --- a/apps/app_macos/lib/application/services/live_answers/answer_parser.dart +++ b/apps/app_macos/lib/application/services/live_answers/answer_parser.dart @@ -143,11 +143,18 @@ ParsedAnswer parseAnswer(String raw, List excerpts) { ); } -/// Groupe entre crochets ou parenthèses fait de tags `S`, d'heures, -/// « User » ou « Speaker n » : remplacé par les citations canoniques -/// fournies, le reste retiré. -final RegExp _citationGroup = RegExp( - r'(\s*)([\[(])([^\[\]()]*|\[[^\[\]]*\])([\])])', +/// Groupe entre crochets fait de tags `S`, d'heures, « User » ou +/// « Speaker n » : remplacé par les citations canoniques fournies, le reste +/// retiré. +final RegExp _citationGroup = RegExp(r'(\s*)\[([^\[\]]*)\]'); + +/// Parenthèses nettoyées, et seulement elles : `([S1])` (citations +/// canoniques) et `(User, 00:00:01)`. « (14:30) » ou « (S2) » restent du +/// texte. +final RegExp _citationInParens = RegExp(r'\(\s*((?:\[S\d+\][\s,;]*)+)\)'); +final RegExp _speakerTimeInParens = RegExp( + r'\s*\((?:User|Speaker \d+)[\s,]+\d{1,2}:\d{2}(?::\d{2})?' + r'(?:[\s,]+\d{1,2}:\d{2}(?::\d{2})?)*\s*\)', ); final RegExp _tag = RegExp(r'\bS(\d+)\b'); final RegExp _time = RegExp(r'\b\d{1,2}:\d{2}(?::\d{2})?\b'); @@ -166,21 +173,20 @@ String _clean(String line, int count) { ].join(' '); String out = line.replaceAllMapped(_documentTag, (Match m) => '[S${m[1]}]'); - // Deux passes : `([S1])` devient `[S1]` après la première. - for (int pass = 0; pass < 2; pass++) { - out = out.replaceAllMapped(_citationGroup, (Match m) { - final String inner = m[3]!; - final String rest = inner - .replaceAll(kCitation, '') - .replaceAll(_tag, '') - .replaceAll(_time, '') - .replaceAll(RegExp(r'\b(User|Speaker \d+)\b'), '') - .replaceAll(RegExp(r'[\s,;:]'), ''); - if (rest.isNotEmpty) return m[0]!; - final String tags = canonical(_tag.allMatches(inner)); - return tags.isEmpty ? '' : '${m[1]}$tags'; - }); - } + out = out + .replaceAllMapped(_citationInParens, (Match m) => m[1]!.trim()) + .replaceAll(_speakerTimeInParens, '') + .replaceAllMapped(_citationGroup, (Match m) { + final String inner = m[2]!; + final String rest = inner + .replaceAll(_tag, '') + .replaceAll(_time, '') + .replaceAll(RegExp(r'\b(User|Speaker \d+)\b'), '') + .replaceAll(RegExp(r'[\s,;:]'), ''); + if (rest.isNotEmpty) return m[0]!; + final String tags = canonical(_tag.allMatches(inner)); + return tags.isEmpty ? '' : '${m[1]}$tags'; + }); final bool bullet = _bulletMarker.hasMatch(out.trimLeft()); final String body = out.trimLeft().replaceFirst(_bulletMarker, ''); final String withoutPreamble = body.replaceFirst(_preamble, '').trim(); @@ -225,14 +231,38 @@ final RegExp _refusal = RegExp( caseSensitive: false, ); -/// Refus en prose : la phrase qui répond (la première de la tête) le dit ; -/// si la tête est un titre suivi de puces, toute ligne compte. +/// Phrase qui renvoie aux sources au lieu de répondre (« … n'est pas donné +/// ici », « not stated in the provided information »). +final RegExp _pointsBack = RegExp( + r"\bici\b|\bin the (provided|given)\b", + caseSensitive: false, +); + +/// Première phrase, citations qui la suivent comprises. +final RegExp _firstSentence = RegExp(r'^.*?[.!?](\s*\[S\d+\])*(?=\s|$)'); + +/// Refus en prose (lignes déjà nettoyées : seules les citations vers un +/// extrait fourni restent). +/// - Tête-phrase : la première phrase refuse sans citer d'extrait, ou +/// renvoie aux sources. +/// - Tête-titre (sans ponctuation finale ou finie par « : », suivie de +/// puces) : la première puce refuse, ou une ligne refuse et aucune puce ne +/// cite d'extrait. +/// Une négation appuyée sur un extrait cité (« Breakfast is not provided. +/// [S1] ») reste une réponse. bool _isRefusal(List lines) { final String head = lines.first.replaceFirst(_trailingCitations, ''); final bool title = lines.length > 1 && (!_finalStop.hasMatch(head) || head.endsWith(':')); - if (title) return lines.any(_refusal.hasMatch); - return _refusal.hasMatch(lines.first.split(RegExp(r'(?<=[.!?])\s')).first); + if (title) { + return _refusal.hasMatch(lines[1]) || + (lines.any(_refusal.hasMatch) && + !lines.skip(1).any(kCitation.hasMatch)); + } + final String sentence = + _firstSentence.firstMatch(lines.first)?[0] ?? lines.first; + return _pointsBack.hasMatch(sentence) || + (_refusal.hasMatch(sentence) && !kCitation.hasMatch(sentence)); } /// Mots outils après lesquels une ligne ne peut pas finir.