Skip to content

chore: raise repo hygiene with hot-file headers, a new-file check and a leaner macOS guide - #24260

Closed
Git-on-my-level wants to merge 13 commits into
mainfrom
lane/hygiene-guides
Closed

Git-on-my-level wants to merge 13 commits into
mainfrom
lane/hygiene-guides

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Raises the hygiene bar for agents and humans reading this repo, with no runtime behavior changes.

  • Adds purpose headers to 47 of the 100 most-changed production files. Comments and module docstrings only.
  • Adds check_new_file_headers.py, so new first-party source files must carry a header.
  • Trims desktop/macos/AGENTS.md from 535 to 348 lines by moving detail to owning docs, and lowers its budget.

Product invariants affected

  • INV-AUTH-1
  • INV-CHAT-1
  • INV-DATA-1
  • INV-NAV-1
  • INV-MEM-4
  • INV-CAP-1
  • INV-TASK-2

Cited because comment-only headers touch their paths. No invariant behavior changes.

How it was verified

  • All 47 header files checked mechanically: Python AST is identical apart from the module docstring, and Swift and Dart additions are // lines only, with no removed lines.
  • scripts/pr-preflight --pr-body-file with this body.
  • test_check_new_file_headers.py and test_run_checks.py pass.
  • check_agents_md_lean.py and check_agent_doc_references.py pass.

Not verified: no product test suites or app builds were run, since source changes are comments only.

Line-count exceptions

The header comments add 6 to 10 lines each to these oversized files, so each needs a declared allowance. Each file gains only comments; splitting them is tracked separately and waits for batch infra to ship.

Line-Count-Exception: app/lib/backend/preferences.dart | 1641 -> 1648 | comment-only purpose header, no code added
Line-Count-Exception: app/lib/providers/device_provider.dart | 1663 -> 1669 | comment-only purpose header, no code added
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4609 -> 4617 | comment-only purpose header, no code added
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2692 -> 2699 | comment-only purpose header, no code added
Line-Count-Exception: app/lib/utils/analytics/analytics_manager.dart | 3138 -> 3145 | comment-only purpose header, no code added
Line-Count-Exception: backend/database/action_items.py | 1742 -> 1751 | comment-only purpose header, no code added
Line-Count-Exception: backend/database/conversations.py | 4649 -> 4659 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/apps.py | 2731 -> 2739 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/chat.py | 1812 -> 1821 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/conversations.py | 2487 -> 2495 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/desktop_chat.py | 2022 -> 2032 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/developer.py | 2862 -> 2871 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/payment.py | 1981 -> 1991 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/pusher.py | 1891 -> 1901 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/sync.py | 3716 -> 3725 | comment-only purpose header, no code added
Line-Count-Exception: backend/routers/users.py | 2767 -> 2775 | comment-only purpose header, no code added
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3411 -> 3421 | comment-only purpose header, no code added
Line-Count-Exception: backend/utils/other/storage.py | 2779 -> 2788 | comment-only purpose header, no code added
Line-Count-Exception: backend/utils/stt/streaming.py | 2609 -> 2619 | comment-only purpose header, no code added
Line-Count-Exception: backend/utils/subscription.py | 2237 -> 2246 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/AppState/AppState+Transcription.swift | 1759 -> 1765 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/DesktopAutomationBridge.swift | 5260 -> 5267 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift | 3037 -> 3045 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift | 5942 -> 5948 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift | 2162 -> 2169 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/ProactiveAssistants/ProactiveAssistantsPlugin.swift | 1951 -> 1958 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/Providers/ChatProvider.swift | 6864 -> 6871 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/Providers/ChatToolExecutor.swift | 3926 -> 3932 | comment-only purpose header, no code added
Line-Count-Exception: desktop/macos/Desktop/Sources/Rewind/UI/RewindPage.swift | 1705 -> 1711 | comment-only purpose header, no code added

Tests

.github/scripts/test_check_new_file_headers.py covers the new check. Other changes are comments and docs, so they need no tests.

UI evidence

UI-Evidence: none -- no UI changes

Failure class (fixes)

Failure-Class: none

New guards (only when adding a check or ratchet)

check_new_file_headers.py would have caught PR #14527, which merged the 75-line headerless app/lib/backend/http/api_result.dart; replaying the check against that merge fails on the file. It is not a shared primitive because it applies a repo-specific header rule to added files only.

Scoped cleanups (optional)

The AGENTS.md trim is included as described above and was checked by the preflight and doc checks listed there. The omiGlass/firmware/.pio removal moved to follow-up PRs because this PR would otherwise exceed the 300-file limit in the UI author approval guard.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

David Zhang and others added 8 commits November 1, 2026 11:27
State what each file owns and the non-obvious constraint it upholds, with
links to the owning ARCHITECTURE/runbook docs. Comments only; no code
changes.
State what each file owns and the non-obvious constraint it upholds, with
links to the owning contract docs. Comments only; no code changes.
State what each file owns and the non-obvious constraint it upholds, with
links to the owning contract docs. Comments only; no code changes.
Fails when a file added in the diff (backend/*.py, app/lib/*.dart,
desktop/macos/Desktop/Sources/*.swift, desktop/macos/agent/src/*.ts)
lacks a header: Python module docstring first, or >=2 comment lines
before the first non-import code. Excludes tests, generated files,
__init__.py and files under 40 lines, thresholds justified in the
script. Registered in both local and ci lanes with a test suite.

Instance: #14527 merged the 231-line headerless
app/lib/backend/http/api_result.dart (the C3 typed-result contract).
desktop/macos/AGENTS.md: 535 lines / 46,552 bytes -> 348 lines / 29,402
bytes, budget ratcheted 560/47,000 -> 380/32,000.

Moved, not deleted, per .github/agent-docs/doc-maintenance.md:
- INV-6 write-path contract, PR definition of done, gauntlet gate policy,
  and live-vs-hermetic table -> docs/chat-continuity-write-path.md
  (cross-linked with product/invariants/chat-continuity.md); the guide
  keeps the invariant and the core never-rules inline. The gauntlet
  script pointers that named the old AGENTS.md sections now point at the
  new doc.
- Product analytics integrity contract -> docs/analytics-integrity.md;
  privacy and product-authority hard rules stay inline.
- Release-train mechanics, signed-smoke scope, recovery, backend
  deployment workflows, and the Codemagic CLI -> docs/release.md (merged
  with its existing promotion/recovery detail); the guide keeps the
  operator never-rules inline.
- Firebase quick-connect snippet -> docs/firebase-connection.md.
- Changelog guidelines -> changelog/README.md; the kind:none
  anti-footgun stays inline. Added a kind:none fragment for this
  internal-only edit per that rule.
- Agent-runtime stamp-cache detail and incomplete_runtime_payload ->
  README.md, which already owned the fast lane, dev-feedback loop, and
  suite worker isolation (those paragraphs are now cited, not duplicated).

Dropped as generic or duplicated with a verifiable owner: pinned
swift-format/SwiftLint versions (wrapper scripts), test-quality marker
syntax (check_desktop_test_quality.py), ps aux | grep Omi, the
dev-instance primary-checkout note (script header).

Safety rules (production bundle protection, named bundles, signing/TCC,
backend URL env rules, never/must clauses) remain inline.
Header check now rejects empty docstrings and marker-only comments, and no
longer treats a rename as a new file. Corrects three headers that overstated
what the code guarantees, keeps the signed-smoke safeguards visible in the
macOS guide, and fixes the incident citation's line count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-01T16:46:09.304105Z
We couldn’t complete this review. Comment @codex review to try again.
94ade8e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 94ade8e0e7f4d1964a08b9efc9e8058b93f3f216. Each new head needs a fresh approval. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

23 issues found across 62 files

Confidence score: 3/5

  • backend/routers/apps.py sends requests to the user-supplied mcp_server_url without validating it, so requests can go to an unchecked destination. Validate the URL before making outbound requests.
  • analytics_manager.dart disables both replay masks despite the header claiming text and images are masked, so replay data may include unmasked content. Enable the masks or correct the documentation to reflect the actual behavior.
  • release.md gives conflicting instructions about whether the normal lane can start Codemagic with a direct /builds POST, which could lead to the wrong release trigger being used. Clarify the actual trigger path.
  • firebase-connection.md prints a success message without verifying a Firestore connection, so it can report success when no connection was checked. Perform a small read before reporting success and let initialization errors surface.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/macos/docs/release.md">

<violation number="1" location="desktop/macos/docs/release.md:21">
P2: This contradicts the unchanged rule at the top of the file that the normal lane must never start Codemagic through a direct `/builds` API POST. Reconcile the two: state the actual trigger path (native tag trigger vs. the fallback API dispatch through the intake helper) and update the 'Never' sentence to match it, so operators are not given conflicting instructions.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/MainWindow/SettingsSidebar.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/SettingsSidebar.swift:3">
P3: The header says keywords are defined "per SettingsSection", but they are defined per `SettingsSearchItem`, and each item then points to a section. Consider "keywords per search item" so the comment matches the data model.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/Rewind/UI/RewindPage.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/Rewind/UI/RewindPage.swift:3">
P2: The header says search results highlight inline on the timeline rather than replacing it, but search defaults to a full-screen results view that replaces the timeline (`SearchViewMode.results`). Describe both modes so the header matches the code.</violation>
</file>

<file name="app/lib/services/wals/wal.dart">

<violation number="1" location="app/lib/services/wals/wal.dart:8">
P3: The `CUSTODY.md` reference is attached to `backend/utils/sync`, but that file lives at `app/lib/services/wals/CUSTODY.md`. Point the reference at the path that exists so readers can find the contract.</violation>
</file>

<file name="app/lib/pages/conversations/widgets/processing_capture.dart">

<violation number="1" location="app/lib/pages/conversations/widgets/processing_capture.dart:6">
P3: The header says the one-second timer is a no-op whenever no offline session is active. That is not accurate: with an active Omi call the callback calls setState every second, and the 10-tick prefs reload runs for batch-mode limitless devices regardless of session state. Reword the header to name these cases, or drop the no-op claim.</violation>
</file>

<file name="app/lib/providers/message_provider.dart">

<violation number="1" location="app/lib/providers/message_provider.dart:4">
P3: The header says this provider resolves the current conversation, but the server picks it and this provider only decides whether a voice reply shows in the visible thread. Reword it so the header matches the code.</violation>
</file>

<file name="app/lib/backend/http/shared.dart">

<violation number="1" location="app/lib/backend/http/shared.dart:8">
P3: The header overstates the override boundary. Official Omi hosts keep Authorization and X-Account-Generation even when an override is active, so name that exception here to match `buildHeaders`.</violation>
</file>

<file name="desktop/macos/docs/firebase-connection.md">

<violation number="1" location="desktop/macos/docs/firebase-connection.md:8">
P2: This quick-connect command cannot run from the stated `desktop/macos/` directory: it enters nonexistent `desktop/backend` and uses the wrong virtualenv path. Use the repository backend path and its canonical `.venv`.</violation>

<violation number="2" location="desktop/macos/docs/firebase-connection.md:15">
P2: The success message prints without any request to Firestore, so it reports a connection that was never verified. Run a small read (e.g. fetch one document) before printing, and let other init errors surface instead of being swallowed.</violation>
</file>

<file name="app/lib/pages/action_items/action_items_page.dart">

<violation number="1" location="app/lib/pages/action_items/action_items_page.dart:4">
P2: This header invariant is wrong: dated sections are categorized from the same `provider.actionItems` list that scroll paging extends, and nothing restricts paging to No Deadline. The first fetch is also capped at 100 items. Reword the comment to describe the actual behavior so future changes are not built on a false assumption.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift:6">
P3: The cited doc doesn't state the single-provider/viewport rule this header relies on. The rule lives in `desktop/macos/docs/chat-continuity-write-path.md`, so cite that file instead.</violation>
</file>

<file name="backend/routers/developer.py">

<violation number="1" location="backend/routers/developer.py:1">
P3: The docstring scope is inaccurate: this module also serves `/v1/conversations/from-segments` (Firebase-authed, not `/v1/dev/*`) and the `/v1/dev/user/goals` routes. Either list those routes or say the surface is broader. If this module is meant to carry released-client compatibility rules, register it in `contracts/client-compat/` too, since the docstring currently asserts that without a matching entry.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Services/NotificationService.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Services/NotificationService.swift:4">
P3: This header rule is stated as absolute, but functional notices (`respectFrequency: false`) intentionally skip the master, frequency, snooze and presence gates, and the meeting summary card skips frequency. Reword it to say proactive sends must pass these gates, so future maintainers do not treat the functional bypass as a violation.</violation>
</file>

<file name="backend/utils/other/storage.py">

<violation number="1" location="backend/utils/other/storage.py:4">
P3: The new header overstates the write gate. `owner_storage_write_gate` only fences writes against account deletion; it does not keep writes under the owner's prefix, and not every write goes through it. Reword the header to describe the deletion fence.</violation>
</file>

<file name="backend/routers/conversations.py">

<violation number="1" location="backend/routers/conversations.py:4">
P3: The header says routes are policy-only and visibility lives in the DB layer, but this file still makes visibility decisions and orchestrates search merging. Reword the header to describe what the file actually owns, or move those branches into database/conversations or a util.</violation>
</file>

<file name="backend/routers/payment.py">

<violation number="1" location="backend/routers/payment.py:6">
P3: This header overstates the guarantee: webhook idempotency only holds when `BILLING_WEBHOOK_LEDGER_ENABLED` is on, since `dispatch_with_ledger` passes straight to the handler when it is off (default). Reword the line to name that condition so readers don't assume replays are deduplicated.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift:2">
P3: The header says this file holds 'the entry tiles', but no tile code exists in this file. Remove that phrase or name the type that actually owns it.</violation>

<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift:4">
P3: This paragraph restates the `PersistedCaptureLaunchPolicy` doc comment that already sits a few lines below. Keep one copy: either drop this paragraph from the header or shorten the header to a pointer to the type.</violation>
</file>

<file name="app/lib/main.dart">

<violation number="1" location="app/lib/main.dart:4">
P3: The header promises launch 'must never wedge on the native storyboard', but only thrown errors are routed to the retry screen. An init step that hangs (e.g. `_init()` awaits without a timeout) still leaves the storyboard up. Reword this as the intent, or add a timeout around the hang-prone steps.</violation>
</file>

<file name=".github/scripts/check_new_file_headers.py">

<violation number="1" location=".github/scripts/check_new_file_headers.py:124">
P2: A multi-line `/* */` header without leading `*` on each line is rejected as "lacks a purpose header", even though the docstring says a `/* */` block satisfies the rule. Track block-comment state so every line inside `/* ... */` counts as comment text.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift:4">
P3: This header claims the transcript's row spacing subtracts `ChatBubbleMetadataControlMetrics` values, but production code never reads them. `ChatTranscriptLayout` uses its own fixed `afterMetadataBandRowSpacing`, and only tests reference `bandHeight`. Reword the header to describe the actual relationship, or drop the layout paragraph since the `bandHeight` doc already covers it.</violation>
</file>

<file name="backend/routers/apps.py">

<violation number="1" location="backend/routers/apps.py:5">
P2: This docstring claims URL validation and HTML escaping happen at this boundary, but this file does not validate the user-supplied `mcp_server_url` before making outbound requests, and it escapes only tool names. Future readers could rely on this as a security guarantee. Reword it to describe what the module actually does.</violation>
</file>

<file name="app/lib/utils/analytics/analytics_manager.dart">

<violation number="1" location="app/lib/utils/analytics/analytics_manager.dart:6">
P2: This header says session replay masks all text and images, but `SessionReplay.configure` explicitly sets both masks to `false`. Either enable the masks or change this header to document the current unmasked behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic


`desktop_auto_release.yml` runs on an hourly `schedule` (plus manual `workflow_dispatch` retries — there is no `push` trigger). Each run tags the newest releasable `desktop/macos/**`/`codemagic.yaml` change since the last tag, coalescing every merge in the window and binding the immutable tag to the Codemagic config that builds it. A candidate reaches Beta automatically after Codemagic finishes the signed release build:

1. **GitHub Actions** (`desktop_auto_release.yml`) — the planner auto-increments the version and pushes a timestamped annotated `v*-macos` tag. Every invocation passes `--min-tag-interval-seconds 3600`, so scheduled and manual retries create at most one candidate per hour, measured from the previous candidate's GitHub-release `createdAt` after publication or its annotated-tag creation time while still building. A ~60s quiet window (`AUTO_RELEASE_QUIET_SECONDS`) coalesces near-simultaneous merges; the one-active-release fence (Codemagic build status on the latest tag) admits one candidate at a time. GitHub compile queues do not gate tagging: the tag stays on the exact newest source, or its mechanically verified changelog-only child, while later macOS merges remain queued for the next hourly candidate. The workflow immediately API-dispatches exactly one same-tag `omi-desktop-swift-release` build, verifies its immutable source identity, and retains JSON intake evidence; retries reuse an existing exact-tag build instead of duplicating it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This contradicts the unchanged rule at the top of the file that the normal lane must never start Codemagic through a direct /builds API POST. Reconcile the two: state the actual trigger path (native tag trigger vs. the fallback API dispatch through the intake helper) and update the 'Never' sentence to match it, so operators are not given conflicting instructions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At desktop/macos/docs/release.md, line 21:

<comment>This contradicts the unchanged rule at the top of the file that the normal lane must never start Codemagic through a direct `/builds` API POST. Reconcile the two: state the actual trigger path (native tag trigger vs. the fallback API dispatch through the intake helper) and update the 'Never' sentence to match it, so operators are not given conflicting instructions.</comment>

<file context>
@@ -14,7 +14,20 @@ python3 .github/scripts/plan-desktop-release.py \
+
+`desktop_auto_release.yml` runs on an hourly `schedule` (plus manual `workflow_dispatch` retries — there is no `push` trigger). Each run tags the newest releasable `desktop/macos/**`/`codemagic.yaml` change since the last tag, coalescing every merge in the window and binding the immutable tag to the Codemagic config that builds it. A candidate reaches Beta automatically after Codemagic finishes the signed release build:
+
+1. **GitHub Actions** (`desktop_auto_release.yml`) — the planner auto-increments the version and pushes a timestamped annotated `v*-macos` tag. Every invocation passes `--min-tag-interval-seconds 3600`, so scheduled and manual retries create at most one candidate per hour, measured from the previous candidate's GitHub-release `createdAt` after publication or its annotated-tag creation time while still building. A ~60s quiet window (`AUTO_RELEASE_QUIET_SECONDS`) coalesces near-simultaneous merges; the one-active-release fence (Codemagic build status on the latest tag) admits one candidate at a time. GitHub compile queues do not gate tagging: the tag stays on the exact newest source, or its mechanically verified changelog-only child, while later macOS merges remain queued for the next hourly candidate. The workflow immediately API-dispatches exactly one same-tag `omi-desktop-swift-release` build, verifies its immutable source identity, and retains JSON intake evidence; retries reuse an existing exact-tag build instead of duplicating it.
+2. **Codemagic** (`codemagic.yaml`, workflow `omi-desktop-swift-release`) — API-dispatched with the immutable tag, runs on Mac mini M4 and owns compile/release admission:
+   - Builds the universal app and dSYM, UUID-checks the dSYM against the executable, and always publishes the verified dSYM with the release so crashes stay symbolicable offline
</file context>

@@ -1,3 +1,9 @@
// The Rewind page: the screen-activity timeline with integrated inline search.
//
// The timeline is the primary interface -- search results highlight inline on

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The header says search results highlight inline on the timeline rather than replacing it, but search defaults to a full-screen results view that replaces the timeline (SearchViewMode.results). Describe both modes so the header matches the code.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At desktop/macos/Desktop/Sources/Rewind/UI/RewindPage.swift, line 3:

<comment>The header says search results highlight inline on the timeline rather than replacing it, but search defaults to a full-screen results view that replaces the timeline (`SearchViewMode.results`). Describe both modes so the header matches the code.</comment>

<file context>
@@ -1,3 +1,9 @@
+// The Rewind page: the screen-activity timeline with integrated inline search.
+//
+// The timeline is the primary interface -- search results highlight inline on
+// it rather than replacing it -- and the page carries an optional brain
+// destination because it can be opened in place of another page (task
</file context>

try: firebase_admin.initialize_app(cred)
except ValueError: pass
db = firestore.client()
print('Connected to Firebase: based-hardware')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The success message prints without any request to Firestore, so it reports a connection that was never verified. Run a small read (e.g. fetch one document) before printing, and let other init errors surface instead of being swallowed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At desktop/macos/docs/firebase-connection.md, line 15:

<comment>The success message prints without any request to Firestore, so it reports a connection that was never verified. Run a small read (e.g. fetch one document) before printing, and let other init errors surface instead of being swallowed.</comment>

<file context>
@@ -0,0 +1,17 @@
+try: firebase_admin.initialize_app(cred)
+except ValueError: pass
+db = firestore.client()
+print('Connected to Firebase: based-hardware')
+"
+```
</file context>

// The Tasks page: dated Today/Tomorrow/Later sections plus an expandable
// No Deadline section, completion toggles, and task-integration entry points.
//
// Dated sections render complete lists on load while No Deadline is the only

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This header invariant is wrong: dated sections are categorized from the same provider.actionItems list that scroll paging extends, and nothing restricts paging to No Deadline. The first fetch is also capped at 100 items. Reword the comment to describe the actual behavior so future changes are not built on a false assumption.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/pages/action_items/action_items_page.dart, line 4:

<comment>This header invariant is wrong: dated sections are categorized from the same `provider.actionItems` list that scroll paging extends, and nothing restricts paging to No Deadline. The first fetch is also capped at 100 items. Reword the comment to describe the actual behavior so future changes are not built on a false assumption.</comment>

<file context>
@@ -1,3 +1,9 @@
+// The Tasks page: dated Today/Tomorrow/Later sections plus an expandable
+// No Deadline section, completion toggles, and task-integration entry points.
+//
+// Dated sections render complete lists on load while No Deadline is the only
+// section allowed to page, and completion state is driven through the shared
+// action-items provider so list, widget and integration views stay consistent.
</file context>

if IMPORT_LIKE.match(stripped):
run = 0
continue
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A multi-line /* */ header without leading * on each line is rejected as "lacks a purpose header", even though the docstring says a /* */ block satisfies the rule. Track block-comment state so every line inside /* ... */ counts as comment text.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/scripts/check_new_file_headers.py, line 124:

<comment>A multi-line `/* */` header without leading `*` on each line is rejected as "lacks a purpose header", even though the docstring says a `/* */` block satisfies the rule. Track block-comment state so every line inside `/* ... */` counts as comment text.</comment>

<file context>
@@ -0,0 +1,220 @@
+        if IMPORT_LIKE.match(stripped):
+            run = 0
+            continue
+        return False
+    return False
+
</file context>


Prices come only from the generated plan catalog -- current Stripe amounts are
import-blocked and must never be published or rebound from a code-change
workflow -- and webhook handlers answer replays, so mutations stay idempotent

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This header overstates the guarantee: webhook idempotency only holds when BILLING_WEBHOOK_LEDGER_ENABLED is on, since dispatch_with_ledger passes straight to the handler when it is off (default). Reword the line to name that condition so readers don't assume replays are deduplicated.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/payment.py, line 6:

<comment>This header overstates the guarantee: webhook idempotency only holds when `BILLING_WEBHOOK_LEDGER_ENABLED` is on, since `dispatch_with_ledger` passes straight to the handler when it is off (default). Reword the line to name that condition so readers don't assume replays are deduplicated.</comment>

<file context>
@@ -1,3 +1,13 @@
+
+Prices come only from the generated plan catalog -- current Stripe amounts are
+import-blocked and must never be published or rebound from a code-change
+workflow -- and webhook handlers answer replays, so mutations stay idempotent
+under event re-delivery (.github/agent-docs/plan-source-of-truth.md,
+backend/docs/checkout-admission.md).
</file context>
Suggested change
workflow -- and webhook handlers answer replays, so mutations stay idempotent
workflow -- and webhook replay dedupe applies only when BILLING_WEBHOOK_LEDGER_ENABLED is on (ledger off by default),

Comment on lines +4 to +7
// PersistedCaptureLaunchPolicy reconciles stored intent with running services
// because intent and runtime are stored independently -- a fresh launch and a
// settings sync both need the same reconciliation instead of treating a
// one-time readiness check as the source of truth.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This paragraph restates the PersistedCaptureLaunchPolicy doc comment that already sits a few lines below. Keep one copy: either drop this paragraph from the header or shorten the header to a pointer to the type.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift, line 4:

<comment>This paragraph restates the `PersistedCaptureLaunchPolicy` doc comment that already sits a few lines below. Keep one copy: either drop this paragraph from the header or shorten the header to a pointer to the type.</comment>

<file context>
@@ -1,3 +1,10 @@
+// The desktop home view and its capture-launch policy: restoring persisted
+// capture intent at launch, permission surfaces, and the entry tiles.
+//
+// PersistedCaptureLaunchPolicy reconciles stored intent with running services
+// because intent and runtime are stored independently -- a fresh launch and a
+// settings sync both need the same reconciliation instead of treating a
</file context>
Suggested change
// PersistedCaptureLaunchPolicy reconciles stored intent with running services
// because intent and runtime are stored independently -- a fresh launch and a
// settings sync both need the same reconciliation instead of treating a
// one-time readiness check as the source of truth.
// PersistedCaptureLaunchPolicy reconciles stored capture intent with running services (see its doc comment).

@@ -1,3 +1,10 @@
// The desktop home view and its capture-launch policy: restoring persisted
// capture intent at launch, permission surfaces, and the entry tiles.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The header says this file holds 'the entry tiles', but no tile code exists in this file. Remove that phrase or name the type that actually owns it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift, line 2:

<comment>The header says this file holds 'the entry tiles', but no tile code exists in this file. Remove that phrase or name the type that actually owns it.</comment>

<file context>
@@ -1,3 +1,10 @@
+// The desktop home view and its capture-launch policy: restoring persisted
+// capture intent at launch, permission surfaces, and the entry tiles.
+//
+// PersistedCaptureLaunchPolicy reconciles stored intent with running services
</file context>
Suggested change
// capture intent at launch, permission surfaces, and the entry tiles.
// capture intent at launch and permission surfaces.

Comment thread app/lib/main.dart
// App bootstrap: main() wraps runApp in a staged _start() that falls back to
// BootRecoveryApp / StartupFailureApp instead of leaving a black screen.
//
// Launch must never wedge on the native storyboard -- a failed init step

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The header promises launch 'must never wedge on the native storyboard', but only thrown errors are routed to the retry screen. An init step that hangs (e.g. _init() awaits without a timeout) still leaves the storyboard up. Reword this as the intent, or add a timeout around the hang-prone steps.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/main.dart, line 4:

<comment>The header promises launch 'must never wedge on the native storyboard', but only thrown errors are routed to the retry screen. An init step that hangs (e.g. `_init()` awaits without a timeout) still leaves the storyboard up. Reword this as the intent, or add a timeout around the hang-prone steps.</comment>

<file context>
@@ -1,3 +1,10 @@
+// App bootstrap: main() wraps runApp in a staged _start() that falls back to
+// BootRecoveryApp / StartupFailureApp instead of leaving a black screen.
+//
+// Launch must never wedge on the native storyboard -- a failed init step
+// renders a retry surface rather than exiting -- and background entry points
+// (Firebase messaging, on-device overflow) initialize only their own slice of
</file context>
Suggested change
// Launch must never wedge on the native storyboard -- a failed init step
// Launch should not stay on the native storyboard after an init failure -- a failed init step

Comment on lines +4 to +7
// Layout metrics are centralized (ChatBubbleMetadataControlMetrics) because the
// transcript's row spacing subtracts the hover strip's reserved band -- the gap
// under a reply must be the band itself, not the band plus a full
// inter-exchange gap.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This header claims the transcript's row spacing subtracts ChatBubbleMetadataControlMetrics values, but production code never reads them. ChatTranscriptLayout uses its own fixed afterMetadataBandRowSpacing, and only tests reference bandHeight. Reword the header to describe the actual relationship, or drop the layout paragraph since the bandHeight doc already covers it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift, line 4:

<comment>This header claims the transcript's row spacing subtracts `ChatBubbleMetadataControlMetrics` values, but production code never reads them. `ChatTranscriptLayout` uses its own fixed `afterMetadataBandRowSpacing`, and only tests reference `bandHeight`. Reword the header to describe the actual relationship, or drop the layout paragraph since the `bandHeight` doc already covers it.</comment>

<file context>
@@ -1,3 +1,10 @@
+// Chat message bubble rendering: markdown, citations, resource strips, and the
+// metadata controls on hover.
+//
+// Layout metrics are centralized (ChatBubbleMetadataControlMetrics) because the
+// transcript's row spacing subtracts the hover strip's reserved band -- the gap
+// under a reply must be the band itself, not the band plus a full
</file context>
Suggested change
// Layout metrics are centralized (ChatBubbleMetadataControlMetrics) because the
// transcript's row spacing subtracts the hover strip's reserved band -- the gap
// under a reply must be the band itself, not the band plus a full
// inter-exchange gap.
// Hover-strip metrics for assistant rows. ChatTranscriptLayout keeps its own
// spacing constant; ChatRowErgonomicsTests checks the combined dead space.

@Git-on-my-level
Git-on-my-level marked this pull request as draft November 4, 2026 07:01
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review November 4, 2026 07:27

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 62 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Turn on auto-fix | Re-trigger cubic

# Conflicts:
#	backend/database/conversations.py
The branch carried a brace-style-only delta that CI's clang-format
rejects; the snapshot initializer is semantically identical either way,
so main's formatting wins.
Main's lease-hold cap (#24554) reads time.monotonic() on entering the
heartbeat loop, but this proof injects a frozen SimpleNamespace clock
that only carried time(). Pin monotonic at T0 so the cap stays inert
and the transient-retry semantics under test are unchanged. Same-root
failure is currently red on main's own backend-emulator-proofs run.
The previous fix was re-styled by the local pre-commit hook's newer
clang-format (19+ changed cast-designated-initializer spacing), which
CI's clang-format 18 then rejects. Commit main's exact blob with the
hook pinned to clang-format 18 so local hooks and CI agree.
… 5xx

#24392 documented that a 5xx from the paid transcription POST is
uncertain and stays held (submitted=True, no duplicate transcription),
but the stale assertion in test_batch_vendor_clients.py still expected
submitted=False, which is why main's own Backend Unit Tests shard 3/8
has been red since it landed. Explicit refusals (402 credit, 429 rate)
keep submitted=False; only the uncertain 5xx case moves.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Folding batch (2026-11-04): this branch's tip was merged into the survivor PR #24477 (feat/cv1-release-safety), which now carries origin/main plus all sixteen folded branches; pushed as 88c7ec5. Both sides' conflict intents were preserved (main's evolved implementations win where a successor of the same intent had already landed). Closing here so the batch lives on one PR. Reopen if something you need is missing from the survivor.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hey @Git-on-my-level 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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