Skip to content

fix(conversations): keep filler and unsettled fragments off Home - #24403

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/offlinesync-noise
Nov 2, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/offlinesync-noise

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Requested by David

What changed and why

David's Home showed three 1s "Thank you" rows for about 12 hours, plus "Yeah." (5m44s), "I don't know" (2m12s) and "ハハハハ" fragments that later vanished. David asked that users never see these rows.

  • Short-clip floor skipped the rules. quiet_minimum returned a kept row before relevance ran. Text the rules prove content-free (filler_only, no_content_words, mic_check) now discards on that path. User curation, keep triggers such as first open, and calendar overlap still keep it.
  • Occasion retention outranked the rules. A content-free clip was kept because a neighbor or episode member existed. There's nothing in it to transfer to a survivor, so the rules now run first. This narrows c3863b3e9203a, on content-free text only; any text with content still stays until absorption.
  • Katakana laughter. CJK_FILLER_CHARS had hiragana は only. ハ and イ are added, so ハハハハ and ハイ are filler while アイ still goes to the model. RULES_VERSION moves to 2.
  • Settling hold. A short batch-owned row (under 60s, or a server minimum) stays off default reads until batch text lands, the upload fails or a partial is published, for at most 2 hours from finished_at. It's presentation only: nothing is stored. A live episode whose only rows are settling stays off /v1/episodes/live too. It uses the existing HOME_HIDE_BELOW_FLOOR_ROWS kill switch. record_audio_closed is deliberately not a release signal, because the live text is still provisional then.
  • Stored rows. The episode list also hides rows with a stored below-floor decision and no summary_blocked_reason. conversation_relevance_backfill.py can re-judge floor and occasion keeps. Dry run stays the default and nothing has been applied.

The upload half of the report needs no change here: reading the code, the open row and the "processing on Omi" label behave as designed, and held-audio release belongs to #24382.

Product invariants affected

  • INV-MEM-4: a content-free short clip now records a discard instead of a keep. Discarded rows produce no memory intake, and this PR adds no intake, promotion or consolidation route.
  • INV-TASK-2: no capture policy or task write changes, and a discarded clip yields no task candidate.

How it was verified

Repo BasedHardware/omi, lane/offlinesync-noise. Layer measured: unit tests only.

  • pytest file by file over 24 affected test files, Google credentials stripped: all passed. This includes the relevance, short-clip, occasion, recovery, episode Home, sync visibility and archive filter contract suites.
  • relevance_rules.py run directly on the reported strings returns discard for "Thank you", "Yeah." and "I don't know".

Not verified:

  • David's stored rows. The read-only look at them was approved, but this Mac's permission check blocked it. So the claim that the "Thank you" rows took the short-clip path rests on code plus the screenshot: the title is the transcript and the icon is the minimum's 💬. Check relevance_decision.reason on those rows after deploy; content_below_floor confirms it.
  • Dev or production behaviour. Nothing has been deployed.

Risks

  • A real short recording appears later than it does today: when batch text lands, or at 2 hours at most if it's stuck.
  • is_visible_conversation is shared, so the hold also applies to other default readers and to direct reads without include_discarded, matching bridge_pending. Rollback: set HOME_HIDE_BELOW_FLOOR_ROWS=false.
  • A client may still show the row returned by its own finalize call until the next list refresh. This PR changes no client code.
  • "Brief Conversation Fragment"-style rows of 60s or longer with model notes aren't held.

Review

Luna review of the first head had 5 findings. Fixed: live episode bypass, starred or foldered short clips discarded at finalize, katakana set too broad. Not fixed: MCP and agent previews can return a held row, because they aren't Home; and the list count can exceed the list by the held rows for up to 2 hours, because an exact count needs an extra query on every count call.

Luna's re-check confirmed the curated and katakana fixes and added one known limit, also not fixed: a live episode with another visible row still shows the held row's moments on /v1/episodes/live. They appear inside that episode, not as a standalone Home row, and hiding them needs moment-level filtering.

Tests

Regression tests: test_a_content_free_short_clip_is_hidden_not_stood_up_as_a_row, test_content_free_text_is_no_evidence_of_an_occasion, test_katakana_laughter_and_acknowledgement_are_filler, test_record_settling.py, test_a_stored_floor_decision_without_a_blocked_reason_leaves_the_list, test_keeps_that_never_ran_the_rules_are_rejudged.

UI evidence

UI-Evidence: none -- backend only

Line count

Line-Count-Exception: backend/database/conversations.py | 4649 -> 4652 | Shared visibility predicate and its list field mask must sit beside the other holds in this file.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3411 -> 3412 | One import for the short-clip decision; the logic itself lives in relevance_io.py.

Failure class (fixes)

Failure-Class: FC-rule-discard-left-visible

🤖 Generated with Claude Code

The short-clip floor returned a kept row before the relevance rules ran, so a
1s "Thank you" stood up as its own Home row. Occasion retention also ran ahead
of the rules. Text the rules prove content-free now discards on both paths,
outranked only by keep triggers, user curation and calendar overlap.

Short batch-owned rows now wait off Home until batch text lands, for at most
2 hours, and the episode list also hides rows with a stored below-floor
decision. The backfill can re-judge floor and occasion keeps; dry run stays
the default. Katakana acknowledgements join the CJK filler list.

Failure-Class: FC-rule-discard-left-visible

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level Git-on-my-level self-assigned this Nov 2, 2026

@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.

5 issues found across 15 files

Confidence score: 3/5

  • fragment_visibility.py can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can make Home reads return 500. Use the canonical UTC-normalized conversation duration.
  • relevance_rules.py can discard substantive Katakana words like ハエ and エア as filler. Match exact filler sequences with a separate Katakana lexicon.
  • conversations.py counts settling rows that the list hides, so conversation, search, and folder counts can overstate what users see. Apply the hidden-row calculation to those counts.
  • relevance_io.py can treat a detected wake-word invocation in a short clip as filler because it hard-codes trusted_wake_word=False. Pass whether a wake word was found.
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="backend/utils/conversations/relevance_rules.py">

<violation number="1" location="backend/utils/conversations/relevance_rules.py:119">
P2: This character-level expansion discards substantive Katakana words such as `ハエ` and `エア`, not just acknowledgements. Match exact filler sequences with a separate Katakana lexicon instead of treating each added code point as filler.</violation>
</file>

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

<violation number="1" location="backend/database/conversations.py:886">
P2: Default conversation counts include settling rows that the list now hides, so `/v1/conversations/count` and search/folder counts overstate visible conversations. Extend the count’s hidden-row calculation to apply the same settling predicate.</violation>
</file>

<file name="backend/scripts/conversation_relevance_backfill.py">

<violation number="1" location="backend/scripts/conversation_relevance_backfill.py:103">
P2: This guard can rejudge a present-but-invalid or non-keep relevance receipt. Require a non-`None` decision to be a mapping with `verdict == 'keep'` before allowing these keep reasons through; otherwise the backfill can hide rows whose stored receipt is malformed or contradictory.</violation>
</file>

<file name="backend/utils/conversations/fragment_visibility.py">

<violation number="1" location="backend/utils/conversations/fragment_visibility.py:173">
P1: This raw wall-window calculation can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can turn a Home read into a 500. Use the canonical UTC-normalized conversation duration or an equivalent capture-span value for the settling threshold.</violation>
</file>

<file name="backend/utils/conversations/relevance_io.py">

<violation number="1" location="backend/utils/conversations/relevance_io.py:220">
P2: This hard-codes `trusted_wake_word=False`, so a short clip admitted by `quiet_minimum` can discard a detected wake-word invocation as filler before the normal wake-word/model protection runs. Pass `bool(find_wake_word_matches(segments))` here.</violation>
</file>

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

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

return False
structured = data.get('structured')
server_minimum = isinstance(structured, Mapping) and structured.get('title_provenance') == 'server_minimum'
return server_minimum or (finished - started).total_seconds() < SETTLING_ROW_MAX_SECONDS

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: This raw wall-window calculation can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can turn a Home read into a 500. Use the canonical UTC-normalized conversation duration or an equivalent capture-span value for the settling threshold.

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/utils/conversations/fragment_visibility.py, line 173:

<comment>This raw wall-window calculation can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can turn a Home read into a 500. Use the canonical UTC-normalized conversation duration or an equivalent capture-span value for the settling threshold.</comment>

<file context>
@@ -129,3 +141,33 @@ def is_low_signal_sync_fragment(data: Mapping[str, Any] | None) -> bool:
+        return False
+    structured = data.get('structured')
+    server_minimum = isinstance(structured, Mapping) and structured.get('title_provenance') == 'server_minimum'
+    return server_minimum or (finished - started).total_seconds() < SETTLING_ROW_MAX_SECONDS
</file context>

# characters are all in this set is a backchannel ("嗯嗯", "好的", "对对对").
CJK_FILLER_CHARS: FrozenSet[str] = frozenset(
'嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね'
'嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね' 'ハイエウンアソネ'

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 character-level expansion discards substantive Katakana words such as ハエ and エア, not just acknowledgements. Match exact filler sequences with a separate Katakana lexicon instead of treating each added code point as filler.

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/utils/conversations/relevance_rules.py, line 119:

<comment>This character-level expansion discards substantive Katakana words such as `ハエ` and `エア`, not just acknowledgements. Match exact filler sequences with a separate Katakana lexicon instead of treating each added code point as filler.</comment>

<file context>
@@ -116,7 +116,7 @@
 # characters are all in this set is a backchannel ("嗯嗯", "好的", "对对对").
 CJK_FILLER_CHARS: FrozenSet[str] = frozenset(
-    '嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね'
+    '嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね' 'ハイエウンアソネ'
 )
 
</file context>

if (
conversation.get('dream_duplicate_of')
or bridge_pending.hidden(conversation)
or is_settling_fragment(conversation)

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: Default conversation counts include settling rows that the list now hides, so /v1/conversations/count and search/folder counts overstate visible conversations. Extend the count’s hidden-row calculation to apply the same settling predicate.

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/database/conversations.py, line 886:

<comment>Default conversation counts include settling rows that the list now hides, so `/v1/conversations/count` and search/folder counts overstate visible conversations. Extend the count’s hidden-row calculation to apply the same settling predicate.</comment>

<file context>
@@ -882,6 +883,7 @@ def is_visible_conversation(conversation: Optional[Mapping[str, Any]], *, includ
         if (
             conversation.get('dream_duplicate_of')
             or bridge_pending.hidden(conversation)
+            or is_settling_fragment(conversation)
             or conversation.get('discarded')
             or is_completed_rule_discard(conversation)
</file context>

if is_user_curated(conversation):
return None
decision = conversation.get('relevance_decision')
if decision and not (isinstance(decision, Mapping) and decision.get('reason') in REJUDGED_KEEP_REASONS):

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 guard can rejudge a present-but-invalid or non-keep relevance receipt. Require a non-None decision to be a mapping with verdict == 'keep' before allowing these keep reasons through; otherwise the backfill can hide rows whose stored receipt is malformed or contradictory.

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/scripts/conversation_relevance_backfill.py, line 103:

<comment>This guard can rejudge a present-but-invalid or non-keep relevance receipt. Require a non-`None` decision to be a mapping with `verdict == 'keep'` before allowing these keep reasons through; otherwise the backfill can hide rows whose stored receipt is malformed or contradictory.</comment>

<file context>
@@ -93,7 +97,10 @@ def verdict_for(conversation: Mapping[str, Any]) -> Optional[str]:
+    if is_user_curated(conversation):
+        return None
+    decision = conversation.get('relevance_decision')
+    if decision and not (isinstance(decision, Mapping) and decision.get('reason') in REJUDGED_KEEP_REASONS):
         return None
     if _has_calendar_evidence(conversation):
</file context>
Suggested change
if decision and not (isinstance(decision, Mapping) and decision.get('reason') in REJUDGED_KEEP_REASONS):
if decision is not None and not (
isinstance(decision, Mapping)
and decision.get('verdict') == 'keep'
and decision.get('reason') in REJUDGED_KEEP_REASONS
):

return keep
segments = getattr(conversation, 'transcript_segments', None) or []
texts = [segment.text for segment in segments] or [getattr(conversation, 'text', None) or '']
rule = content_free_rule(texts, has_photos=False, trusted_wake_word=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: This hard-codes trusted_wake_word=False, so a short clip admitted by quiet_minimum can discard a detected wake-word invocation as filler before the normal wake-word/model protection runs. Pass bool(find_wake_word_matches(segments)) here.

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/utils/conversations/relevance_io.py, line 220:

<comment>This hard-codes `trusted_wake_word=False`, so a short clip admitted by `quiet_minimum` can discard a detected wake-word invocation as filler before the normal wake-word/model protection runs. Pass `bool(find_wake_word_matches(segments))` here.</comment>

<file context>
@@ -204,6 +205,26 @@ def rules_only_relevance(
+        return keep
+    segments = getattr(conversation, 'transcript_segments', None) or []
+    texts = [segment.text for segment in segments] or [getattr(conversation, 'text', None) or '']
+    rule = content_free_rule(texts, has_photos=False, trusted_wake_word=False)
+    if not rule or calendar_retains(
+        uid, getattr(conversation, 'started_at', None), getattr(conversation, 'finished_at', None)
</file context>
Suggested change
rule = content_free_rule(texts, has_photos=False, trusted_wake_word=False)
rule = content_free_rule(
texts, has_photos=False, trusted_wake_word=bool(find_wake_word_matches(segments))
)

…ler rules

Hide live episodes whose only rows are still settling, keep starred and
foldered short clips through finalize, and narrow the katakana filler set to
laughter and "hai" so names such as アイ stay out of the rules' discard.

Failure-Class: FC-rule-discard-left-visible

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 2edb128 into main Nov 2, 2026
70 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/offlinesync-noise branch November 2, 2026 17:03
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