Skip to content

AI Chat: keep numbered chapter titles out of the survey wave check - #244

Merged
felipeelia merged 1 commit into
developfrom
fix/chat-wave-check-chapter-titles
Oct 26, 2026
Merged

felipeelia merged 1 commit into
developfrom
fix/chat-wave-check-chapter-titles

Conversation

@felipeelia

Copy link
Copy Markdown
Member

Description of the Change

The survey wave check (Ambiguity_Gate, #243) groups passages by their page title, without years, to find several waves of one report. Chapters of different reports often share a title, though. For example, "Section 1: Views of the mayor" can be a chapter of a 2010 report and of a different 2011 report. The gate read those as two waves of one report and asked the reader to pick "2011 (Section 1: Views of the mayor)" or "2010 (Section 1: Views of the mayor)", which names chapters the reader cannot recognize.

  • Ambiguity_Gate::get_family_key() now returns no family for a numbered chapter title: "Section 1: …", "Chapter 2. …", "Part IV: …", "3. …". Such pages are skipped, like generic titles (Methodology, Appendix).
  • Titles that only start like a chapter still form families, for example "2024: The year in review" or "Part of the City 2024".
  • A report family next to numbered chapter pages still triggers the question.

How to test the Change

  1. Turn on "Survey wave check" for a bot.
  2. Use an index with numbered chapter pages that share a title across different reports and years (for example "Section 1: Views of the mayor" in a 2010 and a 2011 report).
  3. Ask a question with no year that those chapters answer. Before this change, Chat asked which year; now it answers.
  4. Ask a question with no year that matches several editions of one recurring report. Chat still asks which edition.

Covered by test_numbered_chapter_titles_do_not_count, which fails without the change.

Changelog Entry

Fixed - AI Chat: the survey wave check no longer offers chapters of different reports as waves of one report.

Credits

Props @felipeelia

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Finding the cause on real content, writing the change and its test, and drafting this description. I reviewed the code and the test results before opening this PR.

Chapters of different reports often share a title ("Section 1: Views of
the mayor" in a 2010 and a 2011 report), so the gate offered them as two
waves of one report.

- Ambiguity_Gate::get_family_key() returns no family for a numbered
  chapter title ("Section 1:", "Chapter 2.", "Part IV:", "3. …").
  Titles that only start like one ("2024: The year in review", "Part of
  the City 2024") still form families.
- Tests: test_numbered_chapter_titles_do_not_count.
@felipeelia felipeelia added this to the 2.6.0 milestone Oct 26, 2026
@felipeelia
felipeelia merged commit 1284330 into develop Oct 26, 2026
21 of 24 checks passed
@felipeelia
felipeelia deleted the fix/chat-wave-check-chapter-titles branch October 26, 2026 21:04
felipeelia added a commit that referenced this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant