-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Ai::OpenAiService has grown substantial test coverage since this issue was filed. Several method groups remain untested.
What's already covered
- Briefing pipeline — 5 tests in
open_ai_service_briefing_test.rb(analyze_topic_briefing, render_topic_briefing, generate_briefing_interim, parse error handling) - Topic extraction prompts — 2 tests in
open_ai_service_extract_topics_test.rb(category name blocking, re_extract_item_topics) - Description generation — 4 tests in
open_ai_service_generate_description_test.rb(activity-based prompt, concept-based prompt, empty/nil response handling) - Committee context — 3 tests in
committee_context_test.rb(active committees, empty set, committee_type inclusion) - Committee member extraction — 3 tests in
extract_committee_members_test.rb(request/response, text truncation, JSON keyword in prompt)
Methods still needing tests
Summarization (meeting-level)
summarize_packet_with_citations()— Two-pass summarization with JSON planningsummarize_packet()— Packet analysissummarize_minutes()— Minutes recapanalyze_meeting_content()— Meeting content analysis passrender_meeting_summary()— Meeting summary rendering pass
Topic analysis (per-meeting)
analyze_topic_summary()— Governance-compliant topic analysisrender_topic_summary()— Markdown rendering from analysis JSON
Vote extraction
extract_votes()— Motion and vote extraction from minutes
Triage
triage_topics()— Topic merging, approval, blocking recommendations
Catch-all refinement
refine_catchall_topic()— Refines broad ordinance topics into specific concerns
Infrastructure
- Error handling and retries across all methods
- Provider selection (OpenAI vs Gemini)
gemini_generate()path
Approach
- Stub API responses with
WebMockor mock objects - Test prompt construction (verify governance elements: citations, anti-speculation, confidence scoring)
- Test response parsing (JSON extraction from various formats)
- Test error handling (API timeouts, malformed responses)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels