Skip to content

perf(backend): stable notes/L1 reuse key and skip L1 for noise rows - #25046

Closed
Git-on-my-level wants to merge 1 commit into
mainfrom
lane/llmreuse
Closed

Git-on-my-level wants to merge 1 commit into
mainfrom
lane/llmreuse

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Stable reuse key, and no L1 call for noise or short owner speech

Fable LLM-efficiency #5 and #7 (data/run-2026-11-08-pipeline-refactor/fable-llm-efficiency-2026-11-10.md,
sections 3 and 4). Both changes are on by default; #7 has an env kill switch.

What changed

#5 — the notes/L1 reuse key is an explicit prompt version

utils/conversations/llm_input_dedupe.implementation_digest hashed about 35
source files plus two dependency versions. Any deploy that touched one of them
changed the key for both features, so every stored notes/L1 hash missed and
unchanged input was re-bought.

The key is now one explicit constant per feature
(config/llm_input_versions.py: NOTES_PROMPT_VERSION, L1_PROMPT_VERSION).
tests/unit/test_llm_input_prompt_version.py pins a digest of the prompt
sources per version and fails when they change without a bump, so a missed bump
is a red test rather than stale notes in production. The digest lives in the
test, not on the runtime path.

Model routing, client construction, logging and metrics are deliberately no
longer part of the key: they cannot change the output for the same input, so
they must not re-buy anything. test_route_module_changes_do_not_invalidate_feature_fingerprints
locks that in.

#7 — skip L1 for noise rows and short owner speech

utils/conversations/l1_admission.skip_reason runs at the memory admission
boundary (extract_memories) before any extraction work. It skips when:

  • the row is noise on Home: a server minimum, or a media/noise content kind;
  • the owner spoke fewer than L1_MIN_OWNER_WORDS (30) words.

Unknown owner attribution is never read as owner absence. When no owner is
positively identified, the whole-transcript word count is used as an upper
bound: the owner cannot have spoken more than the transcript, so a short total
is still a sound skip. A curated row (user title, photos, starred, folder,
user-kept) always extracts. Imported external text is not measured by words.

Nothing is written and no hash is stamped on a skip, so a later reprocess with
more speech extracts normally.

Threshold basis. No existing constant is 30. The neighbours are
NOTES_MIN_WORDS/WORD_FLOOR = 12 (the paid-notes floor, so a row that reaches
L1 already has notes) and KEEP_WORD_COUNT = 100 (above which the model is
never asked). 30 sits between them: at a normal speaking rate it is 12-15
seconds, the shortest span that can state a fact about the owner rather than an
acknowledgement. FUNCTION_ONLY_MAX_TOKENS = 25 was rejected because it
measures function-word-only runs, not owner speech.

Tuning disclosure

Measured inputs are the 24 hours ending 2026-11-10 08:50Z from the report
(gateway counters and receipts); the reuse rates are the 2026-11-01 live
readback recorded in the CONVERSATION_LLM_INPUT_DEDUPE_ENABLED registry row.

Before After
Reuse key inputs 35 files + 2 dependency versions 2 explicit version constants
Key changes when any of those files changes by one byte a version is deliberately bumped
Notes reuse 4.8k skips/day (9.5%) unchanged in steady state; no deploy-triggered reset
L1 reuse 7.6k skips/day (16%) unchanged in steady state; no deploy-triggered reset
L1 calls 1 per processed, non-discarded conversation (42.8k/day, 235M prompt tokens, ~$20/day input) minus noise rows and rows with <30 owner words

One-time cost of this PR. The key changes from a 64-hex digest to
notes-1/l1-1, so every stored hash misses once. At the measured reuse rates
that is about 4.8k notes and 7.6k L1 calls that would have been skips, about
111M prompt tokens, about $6.5 at the placeholder rate card
(backend/llm_gateway/config/cost_rate_cards.yaml). It is paid once, on the
first processing run after deploy.

Steady-state saving of #5. One full re-buy avoided per deploy that touches
any of the 35 files. The deploy rate is not measured, so the daily saving is
not claimed as a number.

Saving of #7. The affected band is rows with 12-29 owner words (below 12
already skip notes) plus noise rows that reach L1. That share of processed
conversations is not measured, so the call reduction is not claimed as a
number. The report's own estimate is "small in dollars (short calls)"; the
value is one call removed per noisy or short row, and the counter
omi_memory_l1_skipped_total{reason} measures it from the first day.

New states and their exit

  • omi_memory_l1_skipped_total{reason="noise"}: the row is noise on Home. Exit:
    a later reprocess that is no longer noise extracts normally; the kill switch
    restores extraction immediately.
  • omi_memory_l1_skipped_total{reason="short_owner_speech"}: the owner spoke
    under 30 words. Exit: a later reprocess with more owner speech extracts
    normally; the kill switch restores extraction immediately.
  • A prompt-version bump: exit is the pinned-digest test, which names the bump
    and the re-pin in its failure message.

Flag registration

  • config/feature-flags.yaml: MEMORY_L1_NOISE_SKIP_ENABLED, ops_kill,
    fail: open, owner refactor-lead, terminal keep. ops_kill rows must
    omit review_by (scripts/feature_flag_registry.validate_registry), so the
    review date is recorded in the row's notes: review by 2026-12-10.
  • backend/docs/feature-flag-registry.md: regenerated.
  • config/deployment-setting-classification.json: classified config.
  • backend/config/flag_budget.json: not applicable. ADR 0006's budget
    covers the transcription pipeline scope (utils/batch_pipeline,
    utils/sync, utils/stt, config/policy, ...). This read is in
    config/memory_l1_admission.py, outside that scope, and the budget test
    rejects a name that is not read in scope unless it is a registered helper
    kill switch. The registry row is the authority here, as it is for the
    neighbouring CONVERSATION_LLM_INPUT_DEDUPE_ENABLED.

#5 has no new flag: it is already behind the existing
CONVERSATION_LLM_INPUT_DEDUPE_ENABLED kill switch, and false restores one
call per processed conversation.

Rollback

  • chore: Update .gitignore to remove build artifacts #7: MEMORY_L1_NOISE_SKIP_ENABLED=false on the serving roles. One call per
    processed conversation returns; no data migration.
  • Making setup process better #5: CONVERSATION_LLM_INPUT_DEDUPE_ENABLED=false restores unconditional
    generation and clears the stored checkpoints on the next write. Reverting the
    code alone also works: the old digest is recomputed and misses once.

Pipeline change note:
backend/docs/listen_pusher_pipeline/changes/2026-11-10-l1-noise-skip.md.

Tests

Run through bin/omi-heavy (host load was high; slots were waited for, never
bypassed). Each file runs in its own pytest process, as CI does, because
sharing a session is blocked by sys.modules contamination:

cd backend
for f in \
  tests/unit/test_l1_admission.py \
  tests/unit/test_llm_input_prompt_version.py \
  tests/unit/test_conversation_llm_input_dedupe.py \
  tests/unit/test_short_clip_rollout.py \
  tests/unit/test_process_conversation_usage_context.py \
  tests/unit/test_wave2_owner_memory_admission.py \
  tests/unit/test_memory_replace_policy.py \
  tests/unit/test_upstream_boundary.py \
  tests/unit/test_conversation_memories_telemetry.py \
  tests/unit/test_flag_budget.py \
  tests/unit/test_config_refactor_w6.py \
  tests/unit/test_llm_feature_prompt_cache_prefix.py \
  tests/unit/test_resolved_model_prompt_cache.py \
  tests/unit/test_memory_l1_deadline_invariance.py \
  tests/unit/test_memory_l1_foreground_deadline.py \
  tests/unit/test_working_observations_extractor.py \
  tests/unit/test_working_observations_owner_neutral.py \
  tests/unit/test_l1_prompt_schema_parity.py \
  tests/unit/test_known_spellings.py \
  tests/unit/test_conversation_notes_v2.py \
  tests/unit/test_home_step.py \
  tests/unit/test_media_noise_policy.py \
  tests/unit/test_required_memory_intake.py \
  tests/unit/test_feedback_media_consumers.py \
  tests/unit/test_home_transcribing_hold.py \
  tests/unit/test_client_processing_trust_boundary.py; do
  .venv/bin/python -m pytest "$f" -q || exit 1
done

All green. The pre-push hook then runs the changed-file selector.

New coverage:

  • test_l1_admission.py: noise content kind, media content kind, server
    minimum, short owner speech, the exact floor, unknown-owner upper bound,
    owner-vs-total measurement, curated rows, external imports, the kill switch,
    and the admission boundary (noise and short rows never reach
    _extract_memories_inner; a real row does).
  • test_llm_input_prompt_version.py: the pinned prompt-source digest per
    version, the newest-version rule, unknown-feature fail-closed, and that the
    runtime key is the version.

Two existing tests changed because their fixtures were below the new floor and
they measure a different boundary: _ledger_gate_conversation now carries real
owner speech, and the non-minimum case of
test_memory_boundary_skips_all_l1_l2_work_only_for_persisted_minimum does too.

Failure-Class

Failure-Class: none

This is a cost change with a clean revert, not a fix for a recurring failure
class. The prompt-version guard is a new test, not a new class.

Product invariants affected

  • INV-MEM-4
  • INV-TASK-2

INV-MEM-4 (memory promotion authority): the change only decides whether the L1
extraction call runs. It does not touch tiers, promotion admission, the
consolidation route, or any write. A skipped row writes nothing at all, so no
Short-term item is created without exactly one consolidation route, and no
promotion path is added.

INV-TASK-2 (task capture is suggestion-only): the gate runs before memory
extraction and returns before any action-item or Candidate work. The action-item
writer, the Candidate path and the capture policies are unchanged.

Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3394 -> 3398 | The L1 admission gate is four lines at the existing memory admission boundary; splitting the 3,400-line finalization module is out of scope for a cost change.

View guided diff Turn on auto-fix

Replace the 35-file source digest that keyed notes/L1 reuse with an explicit
prompt version, guarded by a pinned prompt-source digest in the test. A deploy
that touches unrelated code no longer voids every stored hash.

Skip the L1 memory-extraction call for noise rows and owner speech under 30
words. Unknown owner attribution is never read as owner absence; a curated row
always extracts; nothing is written on a skip.

Fable LLM-efficiency #5 and #7.
Git-on-my-level added a commit that referenced this pull request Nov 11, 2026
## What/why

L8a: preserve successful notes/L1 work across unrelated deploys and skip
L1 for deterministic noise or fewer than 30 owner words. Unknown
attribution uses the whole transcript as an upper bound;
curated/imported content retains extraction.

Stack order: L8a (this PR) → L8b #25065 → L9 #25075. Base main; L8a has
no dependency. Normal merges only. Supersedes #25046.

## Flags, ramp and rollback

`EPISODE_COMPOSER_REUSE` is default ON (unset=on). Off restores
source-key writes and L1 extraction. Both directions accept compatible
successful stable and pre-deploy keys; unchanged eligible work does not
regenerate on deploy/rollback/toggles. Model routing changes and
installed pydantic/langchain-core version changes invalidate keys.
Installed versions are snapshotted once at import; historical aliases
require their recorded locks (pydantic 2.11.10, langchain-core 1.3.3). A
future dependency bump intentionally costs one successful notes
recomputation and one admitted L1 recomputation per unchanged effective
input on next processing, then reuse resumes. The population is bounded
to work actually reprocessed; no proactive backfill. Existing provider
retries and concurrent processing can add calls before success is
persisted. No spend estimate is claimed. L8b and L9 have independent
switches.

Normal gates, then watch notes/L1 miss/skip ratios, checkpoint errors,
memory yield and processing failures. Refactor-lead owns
expansion/rollback. No measured margin claim. Rollback:
`EPISODE_COMPOSER_REUSE=off`, or revert this PR; compatibility reads
remain enabled during flag rollback so rollback does not re-buy stored
work.

## Product invariants

INV-MEM-4: preserves canonical promotion authority. No new memory
writer; admission only avoids extraction, with successful checkpoint
validation unchanged. INV-TASK-2: preserves capture suggestion
authority, no task creation changes.

## Dispositions

- Cost P1 / tests-merge P1-4: compatible pre-deploy source aliases and
cross-mode reads prevent toggle-driven reciprocal invalidation. Exact
effective inputs, content revision and successful output validation
remain required.
- Luna FIX-FIRST at c704ac9: installed dependency versions now
participate in stable keys and gate every historical alias. Tests change
either dependency independently, reject all historical aliases at a
mismatch in both flag modes, preserve locked-version aliases, and verify
one notes recomputation followed by reuse across flag flips. Metadata is
never queried per call.
- Correctness P2-7: independent model-routing digest invalidates both
stable keys and historical aliases.
- Tests-merge P0-1: based on current main; separate owned flag-budget
entry and live name count. Each stack member merges current main
normally before publication.
- Split correction: the L1-dependent Hermetic E2E and Parakeet stack
fixtures belong here. Their speech now clears the 30-word floor,
preserving the real memory and exactly-once assertions. Correction
8cf55aa was carried at earlier head c704ac9 with normal main
merges. Full Hermetic E2E, Listen Pusher Stack Gauntlet and the isolated
lifecycle runner pass locally; assertions and admission thresholds
remain intact. David approved one corrective full-hook push after the
initial split publication exposed these fixture omissions.
- L8b findings stay in #25065; notes-first findings stay in L9. No
source PR is closed or merged.

## Tests

For the dependency correction: all 13 focused backend files pass (47
dedupe tests, including 23 new dependency cases) through file-isolated
backend/test.sh (3600s per-file budget); make preflight passes all 44
checks. At earlier head c704ac9, full Hermetic Backend E2E passed
(202 passed, 3 existing skips, 2 existing xfails), and all three
formerly failing CI checks passed; the new head will run CI again. The
fixture correction also passes the full Listen Pusher Stack Gauntlet and
13 emulator contention tests, plus the separately isolated lifecycle
runner (31 passed, 3 existing xfails). Regression tests cover pre-deploy
checkpoints through on/off/on/off, changed model route, exact changed
inputs, invalid output, admission and flag budget.

Line-Count-Exception:
backend/utils/conversations/process_conversation.py | 3394 -> 3398 |
Four-line admission at the existing canonical memory-extraction
boundary; extraction authority stays in its existing owner.

UI-Evidence: none -- backend only

Failure-Class: none

Non-test diff versus main merge base: +359 / -23 (382 changed). Own
stack delta: +359 / -23 (382 changed), excluding tests and render
evidence.
Git-on-my-level added a commit that referenced this pull request Nov 11, 2026
…en (#25065)

## What/why

L8b keeps paid composer results, maps eligible single-member notes
without another call, labels compose triggers, and composes late
deferred episodes on first open. It preserves paid notes while a newly
joined member is processing and retains the guarantee that late members
eventually appear in episode notes.

L8a #25073 is merged into main as 7ec9a04. Under lead2 1c606e, this
branch merges origin/main without rebasing and preserves main’s L8a
dependency-version fencing alongside L8b. L9 #25075 remains separate. No
PR is merged or closed by this work.

## Flags and defaults

- `EPISODE_COMPOSER_THRIFT`: default ON, unset=on. Controls
keep-paid/repair, single-member mapping and late deferral/read trigger.
Off restores paid single-member composition, discard/retry and finalize
scheduling; detail reads schedule no compose. Durable deferrals still
drain through ordinary recovery.
- Dependency `EPISODE_COMPOSER_REUSE`: independently default ON; its
deploy/rollback compatibility preserves successful notes/L1 work. Thrift
rollback never changes reuse keys or L1 admission.
- L9's `EPISODE_COMPOSER_NOTES_FIRST` is absent from this PR's final
tree and stays default OFF in its separate PR until David's side-by-side
verdict.

Numeric late age/grace settings remain tuning. Late age means episode
recorded-start age (48h), not individual member upload age. Read
recovery exits after seven days. Notes gain an additive bounded gist in
their existing call; older successful notes remain eligible without
buying gists in a regeneration wave.

## Ramp

L8b may serve after normal gates. Refactor-lead watches
failures/conflicts, paid logical calls/repairs, input/output tokens,
waiting-member retention, deferred/open/grace completion and notes
freshness. Roll back on a regression. L9 stays OFF until David compares
content and cumulative billed input/output, retries and failures on the
same episodes; no paid side-by-side or deployment is run here. No
variable-margin attainment claim.

## Product invariants

INV-MEM-4: canonical memory promotion stays the authority; the L8a
dependency only avoids extraction. INV-TASK-2: episode follow-ups show
existing open actions and create no tasks. INV-UI-1 / INV-UI-3: existing
mobile primitives and styling retained. Visibility fences discard a paid
result if an original member is hidden/removed, including during a
waiting-member race. Ownership tokens fence stale paid writes and lease
release.

## Dispositions

- Tests/merge P0-1: normal main merge, preserved
HOME_EMPTY_OUTPUT_NOISE, exact live flag-budget count. Separate helper
entries for reuse and thrift.
- Tests/merge P0-2: removal is checked against retained episode ids and
original-member visibility, not the empty waiting-member result. A
present processing member keeps paid output pending; regression asserts
one paid call and later waiting without re-buy.
- Cost P1 lease: size for both 90s provider attempts plus retry headroom
for every permitted turn and repair, plus final-write margin. Refuse a
turn without remaining headroom; fence completion and release by claim
token. Two-replica repair regression crosses 240s. L9 extends/tests this
bound for tool turns.
- Correctness P1-1: shortcut fingerprint includes complete structured
notes, action completion, cited segment ids/end times and recorded span;
member-final notes-only changes reach the shortcut.
- Correctness P1-2: shortcut requires a readable lede or points;
title-only and previously stamped empty bodies fall through to paid
composition and later notes can refresh.
- Correctness P1-3 / tests P1-5: schedule_opened requires THRIFT on and
a durable deferral. Ordinary processing pages cause one detail read,
without foreground paid work or extra polling.
- Tests P1-1/P1-2: close and member-final regressions cover re-deferral
after a new member; deferral write faults emit fallback telemetry and
fall through to normal scheduling.
- Tests P1-3 / siblings: supersedes #25062. #25053's attach-time
guarantee is preserved through the same two attach funnels, under
THRIFT, with durable deferral plus first-open/grace recovery even if
finalization is memoized. Keep #25053 open for lead reconciliation; do
not merge both implementations blindly. #25022 lands second and must
resolve its page/provider overlap by retaining this small refresh
contract. No page redesign or task affordance is added here.
- Waiting first open: persist the opened deferral epoch. A member
completing after the bounded client poll schedules normally on any
replica and bypasses the seven-day unopened hold; completing compose
clears the epoch. A read that finds waiting members releases its local
read throttle so a later bounded poll can finish.
- Client polling: server `compose_deferred` signal; one initial read
plus at most eight 5s polls, each read <=4s and total deadline 45s.
Concurrent opens coalesce; page exit/account change/disposal fence
results and stop further reads. Home retains its filtered membership;
opened cache is invalidated with Home/delete visibility.
- Correctness P2-2/P2-11/P2-12: kept-pending output waits for the settle
timer; trigger stamping clears deferral; unused call label removed.
- Correctness P2-4/P2-5/P2-9: detail cache is separate from Home,
invalidated on delete, bounded and refreshed on open; only explicit
deferrals poll. Cache eviction remains insertion order with a cap of 16,
acceptable bounded storage rather than an LRU promise.
- Tests P2: unknown duration cannot justify short sectionless output;
positive/finite grace settings and single-member window-refusal retry
are tested. Prompt digest guard remains live. Gist is an additive
prompt/schema capability, not an extra paid call or rollback gate
(correctness P2-6).
- Metrics: reported billed input/output is counted on every reply,
including terminal malformed/repair outcomes; logical paid calls,
repairs and failures are labeled. Hidden SDK retry attempts/billing
remain an explicit usage-ledger follow-up. Update
dashboard/recording-rule aggregations for `trigger`; refresh the
measured production inventory after these families serve. The inventory
is not fabricated from unserved code. L9 enablement requires the
authoritative ledger, not these counters alone.
- Remaining L9 tool/failure findings are disposed in its PR. No test is
skipped or weakened.

## Tests

At earlier head d7a1112, merge-main
validation passed: backend/test.sh passed 1,398 tests across 43 files,
covering every episode/composer suite, test_flag_budget.py and the seven
L8a unit suites (dedupe, dependency upgrades and aliases, prompt
versions, L1 admission, usage context, short-clip rollout and
owner-memory admission). Tests use file isolation and
BACKEND_UNIT_FILE_BUDGET_SECONDS=3600. backend/scripts/typecheck.sh
reports zero errors. make preflight passes all 75 selected checks on the
clean merge commit.

Regenerated with owning scripts:
scripts/render_feature_flag_registry.py,
backend/scripts/generate_firestore_indexes.py --write,
backend/scripts/openapi_runner.sh with export_openapi.py --surface
app-client --write, generate_dart_models.py --all and
generate_swift_openapi_types.py. All outputs reproduce the merged tree.

At earlier head 78a6c22, the full hook and the original
backend/Flutter/render verification passed. At earlier head
bb6907c, the copyWith regression, 108
Flutter episode tests, 138 spine tests, backend typing, preflight and
the full hook passed; CI was terminal green. Those are historical
receipts, not validation claims for this merge.

## UI-Evidence

Real Flutter widget renders from
app/test/widgets/episode_composed_render_test.dart, fictional fixtures,
light/dark composed pages and lede-only detail result. Client layout is
unchanged by the split; refresh behavior is exercised by provider/widget
regressions.

![Composed
light](https://raw.githubusercontent.com/BasedHardware/omi/a2e5ab0c81/.agent-artifacts/ui-evidence/composer-thrift/001-mobile-ios-episode-composed-light.png)
![Composed
dark](https://raw.githubusercontent.com/BasedHardware/omi/a2e5ab0c81/.agent-artifacts/ui-evidence/composer-thrift/002-mobile-ios-episode-composed-dark.png)
![Lede-only
result](https://raw.githubusercontent.com/BasedHardware/omi/a2e5ab0c81/.agent-artifacts/ui-evidence/composer-thrift/003-mobile-ios-episode-late-open.png)

UI-Evidence: .agent-artifacts/ui-evidence/composer-thrift/ (tracked PNGs
and evidence.json).

Failure-Class: none

## Rollback

`EPISODE_COMPOSER_THRIFT=off` independently restores finalize
composition; existing deferrals drain through ordinary read recovery.
`EPISODE_COMPOSER_REUSE=off` restores source-key writes/L1 admission
while compatibility reads avoid buying stored work. L9's separate switch
restores full-transcript input. No data migration.

Salvage: restored composed-episode re-deferral with an explicit client
signal; completed the stamp-fault and client lifetime gaps. Dropped only
redundant late-compose and L9-percentage switches, replaced by the
independent stack controls. No incomplete salvage feature remains.

Supersedes #25039 #25046 #25048 #25057 #25062 (L9 source #25039 moves to
the separate L9 PR; #25046 moves to #25073).

Line-Count-Exception: backend/utils/episodes/composer.py | 1105 -> 1734
| Preserve the existing canonical lifecycle, CAS, visibility and lease
authority; scoped additions delegate admission/attach signaling to small
helpers.

Line-Count-Exception: backend/utils/episodes/service.py | 2222 -> 2223 |
Preserve the existing canonical lifecycle, CAS, visibility and lease
authority; scoped additions delegate admission/attach signaling to small
helpers.

Luna FIX-FIRST disposition (earlier head 78a6c22): fixed the stale
single-member write and the same empty-result clearing race with an
atomic episode/member revision fence; newer member or episode snapshots
return superseded without retrying the stale payload. Both the normal
write and window-only fallback retain the guard. Regression tests
exercise real episode persistence with StrictFirestore. At that earlier
head, other pre-read writes (paid compose gap, provisional deferral
title, scheduling stamps) were explicitly listed in
backend/docs/listen_pusher_pipeline/changes/2026-11-10-composer-snapshot-fence.md;
the paid gap is closed by the disposition below. Validation at that
earlier head: all 36 episode suites passed through backend/test.sh; the
final focused rerun passes 33 single-member tests and 126 composer
tests; make preflight passes all 77 selected checks; the full hook and
CI results are reported separately.

Luna #25075 review disposition (earlier head fa02849, L8b-owned
schema): added an optional composeDeferred override to Episode.copyWith.
Omitted overrides preserve the current value; an explicit false clears a
deferred episode. app/test/unit/episode_schema_test.dart covers both
behaviors. Validation at earlier head
bb6907c: app/test.sh passes all 108
selected episode tests plus its 138 spine tests; backend
scripts/typecheck.sh passes with zero errors; make preflight passes all
77 selected checks. The stale single-member/empty-result transactional
fence and regression coverage are included at that earlier head and
preserved in the merge. L8a and L9 branches are untouched.

Merge-main disposition (lead2 1c606e): merged origin/main at
9ca056a, including L8a merge 7ec9a04,
without rebasing. The sole conflict was adjacent appended tests in
backend/tests/unit/test_conversation_llm_input_dedupe.py: retained
main’s dependency-version tests verbatim and L8b’s additive-gist
checkpoint test. Main’s installed-dependency compatibility guard remains
in place; the L8b notes-2/gist aliases remain inside that guard. No new
scope or L9 branch changes. David authorized one full-hook fast-forward
push for this merge; the PR remains unmerged.

Luna FIX-FIRST disposition (earlier head
d7a1112): paid multi-member completion
and its window-only fallback now pass canonical member revisions
captured at the final visibility reads to the existing episode/member
transaction fence. Any subsequent member revision change or deletion
refuses publication; the episode CAS guard also rejects original-member
removal. Hidden originals refuse unconditionally, including a hide
during the final visibility pass after the evidence fingerprint check.
Refused paid notes are discarded, never published or stamped current,
and the lease is released under its ownership token. Existing superseded
scheduling provides bounded recomposition: background settling buys one
call before the quiet timer; settling rollback remains capped at three
attempts. No L8a or L9 branch changes, new flags, or paid retry loop.
The snapshot-fence change doc now describes the closed paid-write gap.

At earlier head ef71cfa, validation:
backend/test.sh passed every episode/composer suite plus flag-budget and
the seven L8a suites: 1,413 tests across 44 files (43 files passed
initially; the flag-budget file passed after the merge-count
reconciliation). The 15 new strict-transaction regressions cover
hard/soft deletion, discard, merge-away, revision changes, unchanged
publication, both paid-write variants, hiding during the final
visibility pass, and bounded recompose scheduling with settling on/off.
backend/scripts/typecheck.sh passed with zero errors. make preflight
passed all 75 selected checks on the clean commit. No live account data
or production calls were used.

Main reconciliation at earlier head
ef71cfa: merged origin/main at
4e9c704 without rebasing. The sole
conflicted file was backend/tests/unit/test_flag_budget.py; retained
main's projection-debt entry and L8b's thrift entry, with the shared
owner checks. Reconciled the declared count to the actual merged
inventory (269). Regenerated feature-flag-registry.md and
firestore.indexes.json with their owning scripts. No OpenAPI/wire
sources changed in this fix or main reconciliation. The PR remains
unmerged.

Luna FIX-FIRST disposition (earlier head
ef71cfa): removed the visibility loop's
revision overwrite. The post-call _members fingerprint snapshot supplies
the only expected revisions. The visibility pass now compares against
that unchanged map; a revision difference, a missing snapshot entry, or
a missing/hidden/discarded member refuses publication before the notes
write. Both normal and window-only publishing transactions continue to
validate the same snapshot map. The unsafe paid result is discarded, its
lease is released under the existing token guard, and superseded uses
the existing bounded recompose scheduling. No new retry path, scheduler,
flag, or unrelated production change.

Current validation: backend/test.sh passed 1,416 tests across 44 files
(all episode/composer suites, flag budget, and the seven L8a suites).
The three added cases failed against the earlier implementation and pass
with this fix: visible notes changing between the fingerprint snapshot
and visibility reread never publish, and recompose remains bounded with
settling on/off. Existing unchanged-member and fallback transaction
tests still pass. backend/scripts/typecheck.sh passed with zero errors.
make preflight passed all 75 selected checks on the clean commit. Full
hook and CI results are reported separately. The snapshot-fence change
doc describes the immutable snapshot revision rule.

GitHub reported CONFLICTING/DIRTY before this work, so origin/main at
6d45be4 was merged without rebasing.
The sole conflict was the flag-budget count: main declares 268 entries,
while this branch includes the thrift entry and correctly declares 269;
retained 269, verified against the actual entries and
test_flag_budget.py. The merge has no other tree changes. No generated
sources or registry inputs changed. L8a/L9 branches are untouched; this
PR remains unmerged.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Closed from SCA-4838 on the Margin owner's call of 2026-11-26 (R38: a lever must be worth at least $20/day net, and this PR's evidence does not establish that). Dropped as a savings PR, not because the code is wrong.

Reopen on: At least $20/day in net avoided notes and L1 charges, based on affected traffic and deploy frequency. The $20/day figure is baseline L1 input spend.

@github-actions

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