Skip to content

feat: opt-in auto-summarize new downloads in the background (P13a-2)#138

Merged
blokzdev merged 1 commit into
mainfrom
claude/p13a2-auto-summary
Jun 2, 2026
Merged

feat: opt-in auto-summarize new downloads in the background (P13a-2)#138
blokzdev merged 1 commit into
mainfrom
claude/p13a2-auto-summary

Conversation

@blokzdev
Copy link
Copy Markdown
Owner

@blokzdev blokzdev commented Jun 2, 2026

What & why

Follow-up to P13a (your request): optionally auto-generate the abstractive summary for a newly downloaded item in the backgroundopt-in, default off. Mirrors the established autoTranscribe precedent (P12e-3) almost field-for-field, so it's low-risk and consistent. The on-demand "Summarize with AI" on item detail (P13a) keeps working regardless.

Key safety property: it runs only when text generation is enabled and its model is already downloaded (ensureReady, read-only) — it never triggers a surprise mid-queue model fetch.

Changes

  • Settings: SettingsModel.autoSummarizeOnDownload (default false) + setAutoSummarizeOnDownload; a toggle in the AI-settings generation card, shown only when generation is enabled.
  • Pure decision: autoSummaryDecisionskip / needsModel / summarize (unit-tested, mirrors transcribeFallbackAction).
  • Queue (queue_controller._persistCompleted): after the auto-transcribe block (so a just-built transcript is the preferred source), for each completed item — gated by autoSummarizeOnDownload && generationEnabled + the decision — collect generate(buildSummaryPrompt(text)) and persist via updateAiSummary. A per-item failure never fails the download.
  • Activity Inbox: a category: ai success entry (summary_$id), or a one-time "Finish setting up summaries" nudge (summary_needs_model) when opted in but no model is downloaded.
  • No schema change (reuses P13a's aiSummary/aiSummaryModelId).
  • Docs: P13-PLAN P13a-2 card ([~]), VERIFICATION P13a-2 checks, BACKLOG note.

Tests

dart format clean · flutter analyze No issues · flutter test 773 passed, including the new autoSummaryDecision units and three queue cases: enabled+model-ready → summary written + ai success entry; enabled+no-model → skip + one nudge to /settings/ai; opted-in-but-generation-disabled → no-op.

Honest notes

  • Inline, like autoTranscribe: the summary generates inline in _persistCompleted before the next download pumps (gated on model-present so it can't stall on a fetch). Generation is heavier than whisper-tiny, so a fuller off-critical-path design — plus the LLM + Cozo HNSW RAM co-residency validation (owed to P13d) — is logged in BACKLOG.md as a deliberate v1 tradeoff.
  • Owed APK spot-check (in VERIFICATION → P13a-2): real on-device auto-summary + inbox entry offline; the no-model nudge; default-off no-op.

https://claude.ai/code/session_013JoYmLCosYt5tQ8qwdbL1T


Generated by Claude Code

Follow-up to P13a: optionally auto-generate the abstractive summary for a
newly downloaded item in the background, default-off, mirroring the
`autoTranscribe` precedent. Runs only when text generation is enabled and
its model is already downloaded — never triggers a mid-queue fetch. The
on-demand "Summarize with AI" on item detail (P13a) works regardless.

- Settings: `autoSummarizeOnDownload` (default false) + setter; a toggle in
  the AI-settings generation card, shown when generation is enabled.
- Pure `autoSummaryDecision` (skip / needsModel / summarize) — unit-tested.
- Queue: in `_persistCompleted` (after the auto-transcribe block, so a
  just-built transcript is the source) generate via the existing engine and
  persist with `updateAiSummary`; post an `ai` success inbox entry, or a
  one-time "finish setup" nudge when opted in but no model is present.
- Tests: decision units + three queue cases (ready→summary+entry,
  no-model→nudge, generation-off→no-op). No schema change (reuses P13a).
- Docs: P13-PLAN P13a-2 card; VERIFICATION P13a-2 checks; BACKLOG note on
  the queue-decoupled / RAM co-residency deferral.

https://claude.ai/code/session_013JoYmLCosYt5tQ8qwdbL1T
@blokzdev blokzdev merged commit d072f7a into main Jun 2, 2026
1 check passed
@blokzdev blokzdev deleted the claude/p13a2-auto-summary branch June 2, 2026 04:46
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.

2 participants