Skip to content

feat(episodes): summaries use the owner's context, scale with length and wait for the full transcript - #25340

Merged
Git-on-my-level merged 51 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-composer
Nov 15, 2026
Merged

Git-on-my-level merged 51 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-composer

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Episode summaries wait for retained pending transcripts, recover committed late speech through transactional revision markers, and scale detail to the episode. Owner ruling 2026-11-15 permits all memory categories, attributions and tiers inside the account as summary background; account isolation, deletion, explicit rejection/invalidation and chat's paid-plan lock checks remain.

The composer uses the shared is_prompt_memory_visible quality/paywall predicate. It does not use chat's additional canonical self-profile/slot predicate: summary background can describe another person, a document or external wisdom. Category, kind, subject, attribution and date accompany memories; missing attribution remains unknown. Background cannot establish episode events, attendance, speaker identity or a new commitment. Chat behavior and canonical memory writes remain unchanged.

Profile context always includes name/language; successful bounded gathering adds timezone, stored ai_user_profile.profile_text, five active goals and up to20 people already resolved in the transcript. Failures/timeouts retain name/language only and count a shared fallback. Every context source shares one8-second caller deadline, four optional-context workers with no queue, and640 charged data reads; late results cannot publish. No cache keeps memory content.

The episode_composer gateway lane currently rejects tools (config_loader.py:568), so this change uses at most3 deterministic retrieval queries: whole episode, named people/projects, and recurring topics/commitments. Each query returns at most10 unified matches. Canonical and historical memory generations both participate after canonical authority succeeds; suppression wins over any legacy duplicate. A canonical/provider failure never falls back to legacy data. Results deduplicate and rank into the existing3500-token memory block plus1000-token profile block. Real read-only chat-registry tools are the immediate follow-up; no unbounded loop, gateway capability change, new calendar context or prior-episode context is implemented tonight.

Worst logical cost:6 embedding calls+6 Pinecone queries+0 Typesense/compose, compared with1+1+160 reads before the owner ruling. Each optional search makes one whole-operation attempt; real proxy/owner-index autospecs guard signatures. At the supplied27000/day baseline this is at most162000 embeddings and162000 vector queries. The640-read data allowance covers profile, goals, people, canonical hydration/lineage and legacy hydration/suppression; provider routing, BYOK/quota/readiness/control reads and SDK retries are additional. There is no extra LLM planning turn; context gathering still returns within8 seconds, but live recall/fallback rate is unverified.

Cost scenario (not a measured invoice): repository Luna input$0.10/M/output$0.60/M gives maximum4500-token context$0.00045/compose or$12.15/day; each extra1000 generated tokens adds$0.00060/compose. The repo has no retrieval rate card. Using documented vendor-list assumptions of embedding$0.13/M tokens at1000 tokens/call, regional Firestore$0.03/100k reads, and Pinecone$16/M RU: six embeddings+646 modeled data/routing reads+six1-RU queries total$0.0010698/compose or$28.8846/day, versus the old$0.0001943/$5.2461. At10RU/query retrieval is$0.0019338/compose or$52.2126/day. Add maximum context input$12.15/day and any longer output/control reads/retries. Actual region, contract and namespace RU are unmeasured. Sources and assumptions: backend/docs/listen_pusher_pipeline/changes/2026-11-15-composer-review.md.

The five independent default-on controls bind on dev/prod Cloud Run backend, backend-sync, backend-sync-backfill, backend-integration and GKE backend-listen/pusher. Rollback the affected behavior with EPISODE_COMPOSER_CONTEXT_ENABLED, EPISODE_COMPOSER_DETAIL_ENABLED, EPISODE_COMPOSE_TRANSCRIPT_WAIT_ENABLED, EPISODE_COMPOSE_TRANSCRIPT_READY_ENABLED or CONVERSATION_NOTES_SCALED_DETAIL_ENABLED=false and roll its hosts. No new flag or budget increase. COMPOSER_VERSION remains episode_composer_v2 and context stays outside fingerprint(): deploying alone recomposes no old episode.

The existing batch assignment transaction writes episode_transcript_updated_at with accepted speech, including appends/rollovers; exact retries preserve it. No extra assignment document write/transaction or heavy producer import. Process-local receipts are a fast path; a lost receipt recovers on the next qualifying Home list/page read, with no periodic receipt sweep and no wall-clock bound before that read. The composed_transcript_updated_at watermark acknowledges covered/unchanged evidence without another paid call. Removed members contribute no Home recovery signal; historical revision timestamps stay. Wait blocker IDs suppress unrelated receipt churn, honor the wait kill switch, and preserve membership/visibility/regeneration wakeups. Active waits add0 Home database reads; bounded wait remains6h.

Notes density scales only above threshold; short packets stay byte-for-byte unchanged. notes-4 and its scaled discriminator invalidate long-note checkpoints only on already-requested processing; unchanged short/flag-off notes-3 checkpoints are reusable. Deploy schedules0 notes regeneration jobs. Existing #25304 lifecycle ledger writers and independent member-notes hold remain intact; receipt and notes completion tests cover one paid episode compose without a restarted delay.

Earlier paid comparison used snapshot-injected memories and bypassed production vector search; it did not verify this new retrieval. No new paid calls occurred after the dev gateway token was deleted. Live grounding, provider latency/cost and serving behavior for the owner-ruling head remain unverified. Prior durable head796eb506dd305 passed467 affected files (16089cases/16skips) and the exact installed hook; this owner-ruling head reruns affected tests/typecheck/hook.

Failure-Class: none
INV-MEM-1: exactly three tiers and one canonical collection remain. The explicit owner-summary Archive/background exception follows owner ruling2026-11-15; default chat/MCP/third-party access is unchanged.
INV-MEM-2: vectors supply IDs only; authoritative owner-scoped hydration supplies content. No raw vector payloads become prompt facts.
INV-MEM-3: canonical readiness, identity, deletion and suppression checks still fail closed. The historical adapter remains a read-only input to MemoryService after successful canonical checks, never a recovery route around a failure.
INV-MEM-4: no memory writes, promotions, lifecycle mutations or shared-graph changes; canonical promotion authority remains unchanged.

Author model: GPT-6.1 Sol. New local head awaits the lead's push, CI and independent review. No push or deploy by this lane; origin/main merged locally at the lead's instruction.

Line-Count-Exception: backend/database/vector_db.py | 1442 -> 1506 | Keep the existing lifecycle owner; bounded owner-summary read options preserve chat defaults and authoritative hydration.

Line-Count-Exception: backend/utils/batch_pipeline/projection.py | 1774 -> 1778 | Keep the existing lifecycle owner; bounded owner-summary read options preserve chat defaults and authoritative hydration.

Line-Count-Exception: backend/utils/episodes/composer.py | 1734 -> 2025 | Keep the existing lifecycle owner; bounded owner-summary read options preserve chat defaults and authoritative hydration.

Line-Count-Exception: backend/utils/memory/canonical_memory_adapter.py | 3970 -> 4035 | Keep the existing lifecycle owner; bounded owner-summary read options preserve chat defaults and authoritative hydration.

Line-Count-Exception: backend/utils/memory/memory_service.py | 4709 -> 4764 | Keep the existing lifecycle owner; bounded owner-summary read options preserve chat defaults and authoritative hydration.

Line-Count-Exception: backend/utils/sync/assignment.py | 1574 -> 1580 | Keep the existing lifecycle owner; bounded owner-summary read options preserve chat defaults and authoritative hydration.

Final local evidence at a346cd0: the exact installed pre-push hook passed end to end at04:16:38Z (55 preflight checks; canonical backend typecheck0 errors/83,294 warnings;21 backend-unit files/1205 cases;2080 passing cases across phases). The467-file affected selection passed16098 cases with16 normal marker skips at04:22:08Z; a five-file combined context/chat ordering probe passed58 cases without collector errors. Source is clean; new-head CI/review awaits the lead's push. No paid/live retrieval acceptance is claimed.

Final merged head 07fad0a9228fa32501b18a7b828791e630f14b0c includes origin/main e50f1f20bf40bb17066290b607779305cf77c945, without conflicts. Regenerated runtime env and registry reproduce the committed files; read-lever manifest is current; flag count287 equals len(names). Installed pre-push PASS2026-11-15T04:30:54Z:56manifest checks, canonical typecheck0errors/83532warnings,21backend-unit files,2082passing cases across phases. Full affected selection467files/16100passed/16normal skips at04:41:29Z; deploymentcontracts461passed/3skips; durable/importclosure359passed/3skips. No guard or allowlist changes. No push or deploy by this lane.

Final review delta: dedicated cancellable owner-summary clients disable provider retries and key/route fallback. Pinecone7.3.0 IndexAsyncio private retry_options=JitterRetry(attempts=1), set before the first request, redirects off; asyncio.timeout covers the request because its async SDK ignores _request_timeout. Direct OpenAI2.38.0 AsyncOpenAI(max_retries=0, timeout=remaining), HTTPX0.28.0 AsyncHTTPTransport(retries=0), bypassing LangChain1.1.14. Gateway isolated HTTPX request, existing gateway provider max_attempts=1. Maximum6embedding+6Pinecone provider attempts (gateway adds6HTTP hops); one8s context deadline cancels active IO, with cooperative transport teardown and no retry tail. No OS-level hard real-time guarantee for a stalled resolver/kernel. Fixed speech/membership withNmembers finalizing notes once costs at mostN+1successful composes; notes finishing before first compose cost1, duplicate finalizations0. Notes refresh keeps existing pending speech timing and adds no new delay. #25309 narrows but does not remove this race. No new jobstore reads.

Summary embedding construction resides in a new helper; clients.py is byte-identical to main so the existing notes/L1 routing digest and historical checkpoints do not change.

Failure-Class: FC-finalize-hook-allowlist-omits-ingestion-path
Failure-Class: FC-finalize-hook-allowlist-omits-ingestion-path
Persist active transcript waits to suppress Home read retries, wake them on a transcript receipt, and preserve the complete short-notes request bytes.

Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path
…rojects

Use chat's hydrated vector facade with a bounded episode query and entity-weighted local ranking. Preserve the cached intake as a retrieval fallback and keep transcript authority explicit.

Failure-Class: none
Preserve both Home and rollout suites, regenerate runtime env and registry, and prove the 24-hour Home label composes with the six-hour summary wait.

Failure-Class: none
A committed transcript removes the deferred timer before scheduling. Fence new wait debt against member revisions so a concurrent receipt cannot acquire a stale wait. Report semantic-memory lookup degradation through shared fallback telemetry.

Failure-Class: FC-finalize-hook-allowlist-omits-ingestion-path
Include the lead's legacy upload-identity compatibility correction for exact-head verification.

Failure-Class: none
Preserve episode switch renderer coverage alongside the lead's revised shared 24-hour wait and rollout tests.

Failure-Class: none
Keep chat and composer on one pure memory admission policy, preserving legacy and canonical eligibility while avoiding database/vector imports in offline selection. Load runtime adapter dependencies during test collection and assert selector import isolation. Refresh the pusher literal contract snapshot and verify all five switches against dev/prod pusher and listen manifests and rendered pods.

Validation: backend/test.sh with its unchanged 0.10s warning and 1.00s failure CPU guard: 141 tests passed across the three reported files.

Failure-Class: none
Merge lane/q12-integration d0d81ab, including origin/main 8614ee4 and fresh repair serving bindings. Git applied sources without textual conflicts. Regenerate runtime env, feature flag registry, and read-lever manifest from the merged sources; preserve all summary controls, Home/repair controls, main flags and CPU-cheap Home fixture imports.

Validation: union manifest/chart binding assertions for both environments and six summary hosts; eight focused backend/test.sh files passed under the unchanged CPU guard. Capture-end PR 25311 is mobile-only and does not change the pending/transcript/projection authorities.

Failure-Class: none
Layer composer-only subject/kind checks over the unchanged chat policy for vector results and list intake. Preserve absent legacy fields via exclude_unset, test mixed eligible and unsafe canonical/legacy rows at the prompt loader, and document the separate chat legacy gap.

Validation: backend/test.sh CPU guard, 12 composer context tests and 5 chat prompt tests passed.

Failure-Class: none
Bump the guarded prompt source version to notes-4, pin the current digest including scaling configuration, and hash the effective scaled-detail range and guidance only for eligible packets. Preserve exact notes-3 and prior compatible short/switch-off checkpoints with routing and dependency fences; reuse restamps metadata without a model call. Deployment itself schedules no work.

Validation: 70 tests passed through backend/test.sh across prompt-version, dedupe and notes-scaling files under the unchanged CPU guard.

Failure-Class: none
Use one eight-second caller deadline on the existing bounded context executor, preserve cheap profile data and omit memories on errors or timeout with shared fallback telemetry. Limit owner-context document reads and propagate remaining deadlines through hydration and vector calls. Composer-only vector search avoids the historical embedding/vector leg and Typesense while preserving chat defaults. Document rate-card input costs and explicit retrieval-price assumptions.

Validation: 174 tests passed across eight guarded backend/test.sh files; the complete backend suite is in progress. Full installed pre-push verification follows.

Failure-Class: none
Register the real active-goal builder with the Firestore shape driver under the composer context deadline/read budget. Its single-field filter uses existing automatic indexing; no index manifest change is needed.

Validation: Firestore query-shape and outside-query contract files pass through guarded backend/test.sh.

Failure-Class: none
Allow legacy attribution only when its fields are absent or explicitly safe. Reject explicit null kind/scope/attribution rather than treating it as absent evidence, and cover these cases through both assembled-prompt loader paths.

Validation: 175 guarded tests passed across all eight context/memory target files.

Failure-Class: none
Move batch projection imports to test collection and warm the generated native-shell probe before measuring its unchanged 100ms file timeout. The test still requires the real timeout to kill the hanging file and run its successor; CPU warn/fail and production file budgets are unchanged.

Validation: all 122 tests in runner, capture-ledger and retained-audio recovery files pass through guarded backend/test.sh; the installed Homebrew Opus path is supplied for local native audio tests.

Failure-Class: none
Merge fetched main f1b90fb, including 0714c51, preserving episode context/completeness changes and current main pipeline, billing and capture-end work. Resolve the flag catalog by keeping all five summary switches plus the new conversion and pipeline diagnostics controls. Regenerate runtime env, flag registry and read-lever manifest from their sources; runtime/read-lever outputs remain unchanged.

Failure-Class: none
Current main adds the owned admission diagnostics switch but leaves the declared catalog count at 286. Match its 287 entries without changing the 161-slot budget, flag ownership, switch defaults or any runtime behavior.

Validation: all 24 guarded flag-budget tests pass; this was the only failure in the 337-file merged-head consumer/contract run.

Failure-Class: none
Give the optional timeout keyword an exact TypedDict shape so the pinned backend typecheck does not spread a generic float dictionary across mode and ledger-kind arguments. Runtime search behavior and default chat arguments are unchanged.

Validation: all 175 context/memory tests pass through guarded backend/test.sh; the installed full hook is rerun on this head.

Failure-Class: none
Verify long notes reach the lifecycle ledger and transcript receipts share the arrival window with held member notes without another paid episode call.

Failure-Class: none
Move committed-transcript reads and scheduling to the existing composer worker. The hot projection path only coalesces bounded content-free IDs through a standard-library-only module. Guard the import graph, overflow, post-commit order and worker rearming.

Failure-Class: none
Use the text-only embedding proxy API and retain the deadline fence before vector IO. Autospec the actual embedding, owner-index, Firestore batch and document APIs so unsupported call arguments fail in tests.

Failure-Class: none
Legacy prompt facts require explicit fact kind, primary-user scope and user attribution together. No category or manual-creation exception infers owner attribution. Exercise mixed list and vector rows and each missing stamp.

Failure-Class: none
Publish profile and memories atomically only after complete successful retrieval. Errors, exhausted budgets and timeouts return name and language only; optional profile-source failures follow the same fail-empty contract.

Failure-Class: none
Persist the wait membership and let Home visibility, membership or regeneration invalidations reach member reevaluation before honoring a wait deadline. Preserve suppression for unchanged waiting episodes.

Failure-Class: none
Git-on-my-level and others added 22 commits November 15, 2026 09:36
Keep normal read admission and circuit behavior, but disable transient-error whole-operation retries for optional composer search. Chat retains its existing retry policy; SDK-internal retries remain separate from logical-call accounting.

Failure-Class: none
Stamp accepted batch speech in its assignment transaction and acknowledge covered revisions; local receipts remain only a fast path.

Failure-Class: none
Persist all pending blockers and inspect only their already-read transcript revisions; retain membership and regeneration wakeups.

Failure-Class: none
Materialize the supplied mapping at the existing dictionary-only visibility boundary.

Failure-Class: none
Build per-member wait observations only for episodes with persisted transcript blockers; leave ordinary read inputs unchanged.

Failure-Class: none
The wait kill switch also bypasses blocker-specific receipt suppression after a wait was persisted.

Failure-Class: none
Owner ruling 2026-11-15: attribution and category inform the prompt, never exclude account-owned background. Retain shared chat lock/rejection/invalidation checks and deletion/account fences.

Failure-Class: none
Owner ruling 2026-11-15: three deterministic queries search all owner tiers with attributed background; share an eight-second deadline and 640-read allowance. Keep chat defaults and canonical failure/suppression fences unchanged.

Failure-Class: none
Keep production signatures explicit and remove the retired profile-slot predicate import; no eligibility or chat behavior change.

Failure-Class: none
Brings in BasedHardware#25309 (capture-end proof lets notes start without the quiet wait).
No textual conflicts; registry doc re-rendered.

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit b101f96 into BasedHardware:main Nov 15, 2026
61 checks passed
Git-on-my-level added a commit that referenced this pull request Nov 15, 2026
…, calendar, prior discussions, open actions) (#25368)

Episode notes gain a deterministic background block with the stored
people in the recording, an overlapping stored calendar entry, the two
most recent matching conversations in a bounded recent window, and
related open actions or loops. The composer gets this account context
without an additional model turn or external calendar API request; the
transcript remains the authority for this episode.

Failure-Class: none

## Product invariants affected

- INV-MEM-1: no new memory tier, collection or write; the owner
explicitly authorizes in-account background in the governing brief.
- INV-MEM-3: related facts reuse the existing hydrated memory result,
preserving its canonical deletion, suppression and generation checks.
The block adds no direct memory reader.
- INV-MEM-4: no memory intake or promotion changes.


## Behavior and limits

Default on in code behind `EPISODE_COMPOSER_DEFAULT_CONTEXT_ENABLED`;
bound to the same dev/prod Cloud Run services and backend-listen/pusher
charts as `EPISODE_COMPOSER_CONTEXT_ENABLED`. Switching it off delegates
directly to the previous context gather. The Q12-M hook does not change
eligibility or transcript-receipt code; those behaviors come from the
merged summaries branch. No composer version/fingerprint bump or
deploy-triggered regeneration.

One worker and the existing eight-second absolute deadline cover both
gathers. Existing memory/profile retrieval runs first and retains all
640 charged data reads; the separate 48-read allowance does not charge
that budget. Default sections use only the time remaining. Successful
memory results survive a later default-section timeout. Combined charged
data-read ceiling: **688**; memory-provider routing/control/readiness
reads and SDK retries remain additional as documented by the sibling.
Combined rendered context: **4,500 existing tokenizer tokens + at most
4,800 added UTF-8 bytes/characters (at most 4,800 byte-BPE tokens), or
9,300 context tokens per prompt**. The tokenizer vocabulary has at most
128 bytes per token, yielding a conservative combined text ceiling of
**580,800 UTF-8 bytes/characters** (4,500 × 128 + 4,800); the original
token limits are the useful prompt bound. All gathers stay within the
same **8-second caller deadline**. People, calendar and prior sections
have at most 1.25 seconds of the remaining deadline. Prior reserves up
to1.25 seconds for actions, which may use up to2 seconds; errors drop
that section, no retries. Previously completed sections survive later
memory failure/timeout, and late results cannot change the returned
block. Reservations before RPCs cap the block at **48 document reads**,
including empty queries and conservative reservations for failed RPCs.
Rendering is capped at **4,800 UTF-8 bytes and characters** including
labels and provenance, with stable people first. Queries use only
existing single-field indexes, with runtime query drivers registered; no
new index deployment is required.

Candidate bounds after review: six resolved people with stored person
fields and up to three name/alias-matched facts reused from the existing
authoritative memory result; eight stored meetings starting between one
day before episode start and episode end, ranked by actual overlap;
twelve previous conversations using only manual identity receipts and
title/overview, returning up to two sharing an exact resolved person;
thirteen relation-prioritized task candidates and eight open loops,
filtered to people/prior discussion links. These bounded windows do not
guarantee exhaustive historical retrieval. No transcript text or pointer
payload is read for prior matching. Automatic-only identities without a
receipt do not match history. Current-member and surfaced-prior
conversation IDs drive linked task queries first (up to three batches
of30, eight candidates total), followed by three exact-person candidates
and two recent name-only candidates; all use explicit single-field
ordering. Open loops use the store OPEN_STATUSES. The prior section
reserves up to1.25 seconds for actions, whose own ceiling is2seconds of
the remaining deadline. Rendering appends complete JSON rows and marks
omissions. Task generation checks exclude rows retained after a task
reset. Categories, privacy/visibility labels and subject attribution do
not deny in-account context; attribution is rendered.

## Cost model

At the sibling lane's supplied **27,000 composes/day** baseline
([composer-round3-final.md](/Users/dazheng/workspace/omi/data/run-2026-11-15-quality-12h/composer-round3-final.md)),
the hard maximum is **1,296,000 added document reads/day**, or
**$0.7776/day** using the `nam5` **$0.06/100,000 reads** rate in
[Google's official nam5
example](https://firebase.google.com/docs/firestore/billing-example?hl=en).
The live read-only database descriptor confirmed `nam5` on 2026-11-15.
Queries have at most one range field; no query offsets, vector requests
or added writes.

The 4,800-byte cap is also a conservative maximum of **4,800 added input
tokens** with the composer's byte-BPE tokenizer; typical English text is
smaller. At the sibling's repository Luna input rate of **$0.10/million
input tokens**, worst-case added prompt cost is **$12.96/day**, for
**$13.7376/day** with one charged provider prompt per compose, before
bandwidth/infrastructure. Existing composer retries permit up to two
logical turns with two provider attempts each; at four charged prompts,
the conservative incremental input-plus-read ceiling is **$52.6176/day**
($51.84 input +$0.7776 reads), without adding calls or changing retry
policy. **Zero additional LLM calls**, embeddings, vector queries or
external calendar calls. No claim of measured fleet latency, token
growth or vendor bills. The corrected review census at
**2026-11-15T06:00:05Z** averaged **13.4 added reads/episode** (maximum
**27**), yielding a sample-based read projection of **$0.21708/day** at
the supplied volume and rate. This owner sample is not a fleet estimate;
fleet-typical reads/tokens remain unmeasured.

## Verification

- Owner-only shape/coverage census:
[owner-default-context-review-counts.json](/Users/dazheng/workspace/omi/data/run-2026-11-15-quality-12h/owner-default-context-review-counts.json),
measured **2026-11-15T06:00:05Z**, `ro-prod`, prescribed owner guard,
counts only. Same **20 healthy episodes / 190 retained transcribed
members**, **2026-11-09 06:27:53Z–2026-11-14 06:58:58Z**. Coverage:
stored resolved people **11/20**, calendar **0/20**, prior shared-person
discussion **0/20**, related open actions **8/20**, related open loops
**0/20**. **Zero section failures or timeouts**. Reads **268 total,
mean13.4, max27**; rendered blocks at most1286bytes in this sample.
Account totals: **53 people, 50 meetings, 1035 actions, one live open
loop**. A separate projection-only census of all50 stored meetings found
**zero entries overlapping any of the20 episode intervals**: calendar is
correct but not useful for these recordings. Transcript-free prior
matching uses manual identity receipts; it cannot recover automatic-only
assignments from encrypted transcript text, and its owner coverage is
now zero. This recall limitation is explicit; no new producer projection
or index is introduced. Setup/member/calendar-validation reads455 plus
five count aggregation queries are separate. The census does not run
paid memory/vector retrieval, so combined live latency/recall remains
unverified.
- Production SDK query builders and autospec RPC mocks cover all four
sections, independent errors/timeouts, full candidate-window and 48-read
cap coverage, byte/character bounds, off parity, real nanosecond
timestamps, canonical deletions, task resets and account scoping.
- Final source head **`0d8ccef0c87893d1fc4ee5f676b43c1f7add4203`**
includes summaries **`b417032dfa1a8`** and main **`65f46cce8306`**. **81
affected/importing files: 3508 passed, 3 skipped, 1 deselected**. This
includes42 default-context tests, cross-service deployment
contracts33passed/3skipped, Firestore guards and receipt import closure.
No new test CPU warning above0.1s. The exact installed pre-push hook
passed end to end **2026-11-15T06:18:24Z**: **55 manifest checks**,
canonical typecheck **0errors/84070warnings**, and2160passing cases
across overlapping hook phases. Explicit flag-budget count **295 equals
len(names)**; feature registry/runtime outputs regenerated and runtime
reproduction check passes. Provider type fixes match the merged sibling;
local receipt conversion satisfies the production assignment signature.
No guard changes, skip hatches, push, PR or deploy by this lane.

Rollback: set **`EPISODE_COMPOSER_DEFAULT_CONTEXT_ENABLED=false`** on
composing hosts and roll the same image. This restores the previous
context gather exactly and removes all added default-block reads/prompt
text.

## Review and measurement

One independent review round (GPT-6 Luna); its four findings (open-loop
statuses from the store constant, action items linked to current
members, whole-row truncation, prior-episode projection and time
reservation) are fixed in this head. Measured read-only on the owner's
last 20 healthy episodes: resolved people 11/20, open actions 8/20,
calendar 0/20 (no stored meeting overlaps), prior discussion 0/20, open
loops 0/20; 13.4 mean and 27 maximum reads; no section timeouts.
Summaries base #25340 is merged (b101f96), so this diff is the
default-context block only.

Author model: GPT-6.1 Sol; integrated by Claude Fable 5.2.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


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

Two slow-suite guards went red on main with #25340 and #25368, which the pull requests'
own path-selected CI did not run:

- the direct-provider inventory did not list utils/llm/summary_embeddings.py (AsyncOpenAI,
  the non-gateway branch of the composer's single bounded embedding request);
- two context-budget tests handed production code a real-clock budget under 0.5 s.

The inventory entry states its gateway policy. Both tests now let the caller's whole budget
elapse on an injected clock while the provider call is still running, and assert the caller
returned before the provider finished. No production code changes.

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 15, 2026
…es (#25372)

Two slow-suite guards are red on main since #25340 and #25368 merged.
This repairs both with test and inventory changes only; no production
code changes.

Failure-Class: none

## What was wrong

-
`test_llm_gateway_coverage_guardrails.py::test_direct_provider_usage_stays_inside_approved_boundaries`
reports `DirectUse(utils/llm/summary_embeddings.py, AsyncOpenAI)`: the
file added by #25340 was not in the direct-provider inventory.
-
`test_real_clock_budget_ratchet.py::test_no_new_tiny_real_clock_budgets`
rejects two tests that set `COMPOSER_CONTEXT_TIMEOUT_SECONDS` to 0.1 s
(#25340) and 0.04 s (#25368), real-clock budgets under the 0.5 s limit.

Both guards are marked slow and are selected by path, so the two pull
requests' own CI did not run them; other pull requests (#25314, #25131)
inherited the failures.

## The repair

- Inventory: `utils/llm/summary_embeddings.py` is registered with its
policy stated beside the entry. It is the composer's single bounded
embedding request for owner-memory retrieval. It enforces the
generated-compute budget and resolves the BYOK key before any IO, and
routes through the LLM gateway whenever gateway feature mode is on,
which is the production setting on backend, backend-sync and
backend-sync-backfill (`OMI_LLM_GATEWAY_FEATURE_MODE=gateway`, read from
the serving specs). The direct client is the non-gateway branch only:
same provider, key custody and model as `clients.py` `OpenAIEmbeddings`,
with SDK retries off and the caller's absolute deadline. It lives
outside `clients.py` so the notes routing digest and paid checkpoints
stay unchanged. Both branches are exercised with the real SDK in
`test_episode_summary_provider_bounds.py`. No gateway, BYOK or quota
path is bypassed.
- Tests: both context-budget tests now inject the clock and the
completion event of `composer_context_budget`, so the caller's whole
budget elapses deterministically while the provider call is still
running. They still assert the properties the originals covered: the
caller returns at the deadline and not when the non-cooperative provider
finishes, partial context is discarded, completed sections survive, late
results are never published, and the timeout fallback is recorded once.
The ratchet and its allowlist are unchanged.

## Verification

Both guards, the ratchet's stale-entry checks, the provider-bounds tests
and the two edited test files: 89 passed locally with slow tests
selected (`-m "slow or not slow"`). No tuning value, flag, state or
schema changes.

Rollback: revert this commit; main returns to the two red guards.

Author: Claude Fable 5.2.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant