Skip to content

feat: @Generable structured summary output (#44)#59

Open
StevenLi-phoenix wants to merge 1 commit intomainfrom
worktree-issue-44-structured-summary
Open

feat: @Generable structured summary output (#44)#59
StevenLi-phoenix wants to merge 1 commit intomainfrom
worktree-issue-44-structured-summary

Conversation

@StevenLi-phoenix
Copy link
Owner

Summary

  • Add StructuredSummary model with @Generable + Codable for structured summary output (summary, key points, action items, sentiment)
  • FoundationModelsEngine uses Apple's @Generable macro for on-device structured generation; other engines use SummarySchemaProvider JSON Schema via existing generateStructured() protocol
  • SummarizerService.summarizeWithFallback() tries structured output first, gracefully falls back to plain text
  • SummaryCardView renders sectioned display with key points, action items, and sentiment badge when structured data is available
  • SchemaV7 lightweight migration adds structuredContent: String? to SummaryBlock
  • 19 new unit tests across 2 test suites

Files Changed

Category Files
New StructuredSummary.swift, SchemaV7.swift, StructuredSummaryTests.swift, SummarizerStructuredTests.swift
Model SummaryBlock.swift, NotetakerMigrationPlan.swift
Engine FoundationModelsEngine.swift
Service SummarizerService.swift, PromptBuilder.swift, BackgroundSummaryService.swift, SummaryMarkdownFormatter.swift
View SummaryCardView.swift, SessionDetailView.swift
ViewModel RecordingViewModel.swift
Config UnitTests.xctestplan, CLAUDE.md

Test plan

  • Build succeeds (CODE_SIGNING_ALLOWED=NO)
  • 19 new tests pass (StructuredSummaryTests: 12, SummarizerStructuredTests: 7)
  • Existing tests unaffected (70 tests across 5 related suites pass)
  • CI build-and-test workflow passes
  • Manual: verify structured summary renders correctly with OpenAI/Ollama engine
  • Manual: verify fallback to plain text when engine doesn't support structured output

Closes #44

🤖 Generated with Claude Code

…#44)

- Add StructuredSummary (@generable + Codable) with summary, keyPoints, actionItems, sentiment
- FoundationModelsEngine uses @generable for on-device structured generation
- Other engines (OpenAI/Anthropic/Ollama) use SummarySchemaProvider JSON Schema
- SummarizerService.summarizeWithFallback() tries structured first, falls back to plain text
- SummaryCardView renders sectioned display (key points, action items, sentiment badge)
- SchemaV7 adds structuredContent to SummaryBlock (lightweight migration)
- 19 new tests across 2 test suites

Closes #44
@claude
Copy link

claude bot commented Mar 26, 2026

✅ Claude Code Review: APPROVE

The PR correctly implements structured summary output with proper SchemaV7 lightweight migration (inline default on structuredContent: String? = nil), graceful fallback from structured to plain text, 19 new tests covering the new logic, and all callsites updated consistently across BackgroundSummaryService, SessionDetailView, and RecordingViewModel.

@github-actions
Copy link
Contributor

⏸️ Auto-merge paused: 3 unchecked checkbox(es) in PR body. Merge will proceed automatically once all tasks are checked and a new push triggers the workflow.

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.

Foundation Models @Generable 结构化摘要输出 (Structured Summary Output)

1 participant