Skip to content

SCA-335: remove dead focus_sessions writer and PTT transcript cleanup - #11778

Merged
Git-on-my-level merged 3 commits into
mainfrom
agent/m1-studio-cursor-grok-4-6/f8c68d7f
Aug 18, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
agent/m1-studio-cursor-grok-4-6/f8c68d7f

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Removes two macOS proactive paths that were wired into storage/sync/query surfaces but had no writer and no caller.

  • Delete PTTTranscriptCleanupService (unreachable gemini-2.5-flash ASR rewrite).
  • Delete FocusSessionRecord and the unused RewindIndexer.processFrame(_:focusStatus:extractedTasks:insight:) overload (the only writer of screenshots.focusStatus).
  • Keep the focus_sessions SQLite table, Settings "Focus Sessions" count (raw COUNT(*)), chat schema annotations, daily-recap query, and agent sync so leftover rows stay visible. No schema migration.

Closes SCA-335

Zero-caller search at branch point

Branched from origin/main at 015172400b (later rebased onto current origin/main). Searches against that tree:

git grep 'FocusSessionRecord(' origin/main -- desktop/macos/Desktop/Sources
# no matches — the initializer is never called

git grep 'PTTTranscriptCleanupService' origin/main -- desktop/macos
# definition only in PTTContextVocabularyProvider.swift:381-382

git grep 'RewindIndexer.shared.processFrame' origin/main -- desktop/macos/Desktop/Sources
# ProactiveAssistantsPlugin+RewindCapture.swift (2-arg / CGImage overloads)
# RewindArtifactGauntlet.swift (same)
# no caller of the focusStatus/extractedTasks/insight overload

git grep 'deleteFocusSessionsOlderThan' origin/main -- desktop/macos
# definition only

Windows still writes focus_sessions; this PR is macOS-only.

Proposed follow-up (not in this PR)

A later migration could drop focus_sessions and screenshots.focusStatus / extractedTasksJson / adviceJson once Windows/backend/agent_vm no longer need the table. That is a high-blast-radius schema change and should be tracked separately.

Finding left alone (engagement hooks, not dead code)

These setters still have zero callers, but deleting them would remove hooks a future fix needs:

  • MemoryStorage.updateReadStatus / markAllAsRead / updateDismissedStatus
  • InsightStorage.markAsRead / dismissInsight
  • DashboardPage filters insightHistory on isDismissed, which nothing ever sets

Test plan

  • xcrun swift build -c debug --package-path desktop/macos/Desktop — clean
  • python3 desktop/macos/scripts/check_desktop_test_quality.py — OK
  • xcrun swift test --package-path desktop/macos/Desktop --filter DeadProactivePathTests — 1/1 pass
  • xcrun swift test --package-path desktop/macos/Desktop --filter 'ChatDiscoverabilityTests|RewindDatabaseLifecycleTests|RewindAbandonedChunkRecoveryTests|RewindRetentionCleanupTests' — 41/41 pass
  • Isolated desktop/macos/scripts/swift-test-suites.sh — started twice; blocked cloning the 7.5G .build from /Volumes/scratch onto the boot-volume mktemp dir (cp -c cannot COW across volumes). Combined swift test --skip-build ran hundreds of suites green until the log was truncated; not treated as the official isolated gate.
  • No changelog fragment — internal dead-code cleanup, no user-visible behavior change

Product invariants affected

  • INV-CHAT-1

Path-matched because this PR edits PTTContextVocabularyProvider.swift. The live PTT vocabulary capture path is unchanged; only the unreachable Gemini cleanup actor was deleted. Chat write-path / continuity behavior is not affected.

Review in cubic

@Git-on-my-level Git-on-my-level added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Aug 18, 2026
Git-on-my-level and others added 2 commits August 18, 2026 07:51
PTTTranscriptCleanupService.cleanup had zero callers, so the gemini-2.5-flash ASR rewrite path could never run.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
FocusSessionRecord was never constructed and RewindIndexer.processFrame(_:focusStatus:) had no callers. Keep the SQLite table, Settings count, chat schema, and agent sync so leftover rows stay visible.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the agent/m1-studio-cursor-grok-4-6/f8c68d7f branch from 96282f1 to 525a5c2 Compare August 18, 2026 01:10
RewindStorageErrorClassificationTests is a static source-inspection
contract: it greps RewindIndexer.swift for the logError strings that
prove fire-and-forget writer flushes preserve errors. This branch
deletes the metadata-carrying processFrame overload — the unused
focus_sessions writer — so the string it asserted no longer exists and
CI failed on the assertion, not on behavior.

The guard is not lost, it is inverted: DeadProactivePathTests added in
this PR fails if RewindIndexer ever regains a focusStatus writer. Every
other error-classification assertion in the suite is untouched.

Verified: xcrun swift test --filter
'RewindStorageErrorClassificationTests|DeadProactivePathTests'
— 11 passed, 0 failures.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 91c3f01 into main Aug 18, 2026
26 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-cursor-grok-4-6/f8c68d7f branch August 18, 2026 04:45
Git-on-my-level added a commit that referenced this pull request Aug 19, 2026
## Summary

Closes SCA-343.

The `no-changelog-needed` PR label greened the desktop changelog gate
and then reddened main's Release Eligibility run, because push has no PR
context. That is a trap: a green PR can poison a main SHA and block
`gcp_backend.yml` deploys. Live instance: #11778. Same class as #11373
and #11039.

### Approach taken: (2) + (3)

**In-repo `{"kind": "none"}` fragment** as the durable internal
exemption, **and reject the label as an exemption for production desktop
paths**.

- A new unreleased fragment of `{"kind": "none"}` satisfies both the
PR-run and the post-merge push-run. It lives in the diff, so both lanes
see the same evidence.
- `--skip` / `no-changelog-needed` no longer passes when the diff
touches production desktop paths. The PR-run and push-run therefore
agree on the #11778 shape (both fail without a fragment; both pass with
`kind: none`).
- Leftover `kind: none` fragments do **not** satisfy release-lane
`--accept-tree-fragments`. That lane still requires real user-facing
notes for the next release.
- Release consolidation ignores `kind: none` so it never becomes a
user-facing changelog line.

### Why the others were rejected

1. **Resolve the PR from the merge commit and read labels via the API.**
Closest to the old UI intent, but it adds a network dependency to a gate
that is otherwise hermetic, and it must fail-closed on direct pushes and
back-merges. A label would still be invisible to local `make preflight`
/ pre-push.
3. **Reject the label alone** (no in-repo marker). Smallest diff, but it
forces a dishonest user-facing note for genuinely internal production
edits such as dead-code deletion. Combined with (2), authors have an
honest, durable escape.

The invariant: a PR that is green on this gate cannot redden `main` on
the same gate.

## Product invariants affected

none

## Failure class (fixes)

Failure-Class: new

Registers `FC-changelog-exemption-lost-at-merge` with a reusable guard:
`evaluate_changelog_requirement()` plus the #11778 regression in
`.github/scripts/test_desktop_changelog.py`. Evidence PRs: #11039,
#11373, #11778.

## Authors

Internal-only production desktop edits (for example dead-code deletion
under `Desktop/Sources/`) now need:

```json
{"kind": "none"}
```

under `desktop/macos/changelog/unreleased/`. The `no-changelog-needed`
label is not an exemption. Documented in `desktop/macos/AGENTS.md`.

## Test plan

- [x] `python3 .github/scripts/test_desktop_changelog.py` — 16 tests,
including the #11778 PR-vs-push agreement cases
- [x] `python3 .github/scripts/desktop-changelog.py validate`
- [x] `python3 scripts/test_failure_class.py`
- [x] `scripts/pr-preflight --pr-body-file pr-body.md`
- [ ] Confirm CI `desktop-changelog-io-tests` and
`desktop-changelog-entry` on this PR
- [ ] Confirm a follow-up internal Sources edit without a fragment fails
both the PR lane and a simulated push lane (`--accept-tree-fragments`)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/11797?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Git-on-my-level added a commit that referenced this pull request Sep 24, 2026
…e) (#18466)

## Summary
- Add durable mobile release-note fragments and mergeable
marketing-version collections, deriving bounded iOS and Android text
only when needed.
- Require a deterministic, app-scoped fragment or `none` exemption on
PRs and main pushes; exact internal release-control paths remain exempt.
This gate is mobile-specific rather than sharing the desktop guard
because the mobile authoring root and release behavior differ; the
PR-label/post-merge mismatch seen in desktop PRs #11373 and #11778 is
covered with offline fixtures.
- Add a manual-only Codemagic lane for promoting exact existing,
processed iOS and alpha Android builds with roll-forward public-version
checks; do not modify current build lanes.

Failure-Class: none

## Product invariants affected

- INV-AUTH-1
- INV-DATA-1
- INV-BETA-1

#### Test plan
- [x] `python3 .github/scripts/test_mobile_changelog.py` (33 offline
tests)
- [x] `python3 app/scripts/mobile_store_promote_test.py` (9 offline
tests)
- [x] `python3 .github/scripts/check-release-process-guards.py`
- [x] `make preflight` (28 selected checks passed)
- [ ] Codemagic live store promotion deliberately not invoked (manual
operator confirmation is required)

Generated with [Devin](https://devin.ai)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/18466?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Skip desktop changelog enforcement for internal-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant