Repository navigation
Jev rulings 10-18: kill owner flip/shadows/rescue/call-link/episode selector, graduate smart merge + wall-clock gap - #22209
Conversation
# Conflicts: # backend/database/jev_shadow.py # backend/deploy/runtime_env.yaml # backend/deploy/runtime_env/_base.yaml # backend/docs/feature-flag-registry.md # backend/tests/unit/test_conversation_notes_v2_beta_rollout.py # backend/tests/unit/test_jev_population_shadow.py
# Conflicts: # backend/scripts/run-emulator-proofs.sh
# Conflicts: # .github/failure-classes/FC-rollout-flag-absent-from-a-cohost-of-its-code-path.json # backend/deploy/runtime_env.yaml # backend/docs/feature-flag-registry.md # backend/route_policy_manifest.yaml # backend/tests/fast_unit_duration_allowlist.txt
# Conflicts: # backend/deploy/runtime_env.yaml # backend/deploy/runtime_env/_base.yaml # backend/docs/feature-flag-registry.md
# Conflicts: # backend/deploy/runtime_env.yaml # backend/deploy/runtime_env/_base.yaml # backend/deploy/runtime_env/dev.overlay.yaml # backend/deploy/runtime_env/prod.overlay.yaml # backend/docs/feature-flag-registry.md # backend/tests/unit/test_knowledge_ledger_drain_job.py # backend/utils/executors.py
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3b9750469
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let refreshedHeaders = try await APIClient.shared.buildHeaders( | ||
| forceRefreshAuth: true, expectedAuthOwnerId: authorizationSnapshot?.ownerID) | ||
| if let authorizationSnapshot, !RuntimeOwnerIdentity.isAuthorizationCurrent(authorizationSnapshot) { | ||
| log("ScreenActivitySync: signed-in account changed during auth refresh; not retried") | ||
| return false | ||
| } | ||
| request.allHTTPHeaderFields = refreshedHeaders |
There was a problem hiding this comment.
Propagate refreshed auth to frame-request delivery
When the initial sync receives a 401 and the forced-refresh retry succeeds with a nonempty frameRequests response, this updates only request; the immutable headers dictionary still contains the rejected token and is subsequently passed to both claimFrameRequests and uploadAndPromoteFrameRequests. The sync can therefore return 200 while frame delivery immediately fails authentication and waits for a later sync tick; update the shared headers or pass refreshedHeaders to the downstream requests.
Useful? React with 👍 / 👎.
| logError("ChatProvider: authoritative ledger prompt refresh failed closed", error: error) | ||
| await loadAIProfileIfNeeded() | ||
| } | ||
| await loadAIProfileIfNeeded() |
There was a problem hiding this comment.
Filter stale history rows before prompting
For users who previously loaded the beta History/All view, syncServerMemories has additively retained rejected or superseded rows in SQLite, and ordinary current-page refreshes do not prune rows absent from the server projection. Ending this method after the unfiltered getLocalMemories read removes the authoritative ledger snapshot that previously replaced those cached rows, so formatMemoriesSection now sends them to the model as current user facts on every chat turn. Filter the local read to current eligible rows or migrate/prune retired history rows before constructing prompt context.
Useful? React with 👍 / 👎.
| db_client = getattr(db_client_module, 'db', None) | ||
| budget = list_read_budget_for_request(request, route='memories-ledger-history') |
There was a problem hiding this comment.
Avoid eager ledger-history scans on every tab load
For every non-device-scoped mobile memory load, the client calls this route before the user opens History and follows up to ten returned cursors. Removing the rollout fast path means an account with thousands of current canonical rows but no history now scans 501 Firestore documents per request—up to roughly 5,010 reads merely to prove the projection empty. This is the fleet-wide scan the deleted guard explicitly avoided; defer history loading until that view is selected or provide an indexed, inexpensive history query.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a9edccf12
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| else: | ||
| result = self._canonical_write(uid, memory_db.model_dump(mode="python"), source_surface=consumer) | ||
| result = self._canonical_write(uid, memory_db.model_dump(mode="python"), source_surface=consumer) |
There was a problem hiding this comment.
Reset retained ledger writer modes before removing their writer
For any account previously cut over to WriterMode.ledger, this now sends manual creates through _canonical_write, whose non-ledger payload is classified as the compatibility writer and rejected by require_writer_admitted; batch creates fail the same way. Those persisted writer modes are explicitly retained, while this change also removes the ledger drain/daily sweep and leaves extract_memories skipping every non-compatibility mode, so affected accounts receive 503s for manual creates and silently stop forming memories from conversations. Migrate these control rows back to compatibility or preserve a user-authorized write path before retiring the ledger writers.
Useful? React with 👍 / 👎.
| export async function deleteLocalConversation(id: string): Promise<void> { | ||
| await deleteJitConversationKeyframe(id) | ||
| cachedStmt(get(), 'DELETE FROM local_conversation WHERE id = ?').run(id) |
There was a problem hiding this comment.
Preserve cleanup for legacy JIT keyframes
On upgraded Windows installs that still contain jit_keyframe_pin or cleanup-outbox rows, deleting a conversation now removes only local_conversation; this change also removes the launch retry worker. The associated Rewind JPEG and database row can therefore survive an explicit deletion for the full configured retention period, while previously failed cleanup entries are never retried. Keep the retirement-only enqueue/drain path until legacy pins and outboxes have been exhausted.
Useful? React with 👍 / 👎.
| app.include_router(desktop_experiments.router) | ||
| app.include_router(jit_ledger_snapshot.router) | ||
| app.include_router(jit_rollout.router) | ||
| app.include_router(desktop_realtime.router) |
There was a problem hiding this comment.
Register retirement shims on the desktop backend
Released macOS builds send JIT authority requests to rustBackendURL, which is served by this separate desktop-backend app. Removing the active JIT and memory-use routers here without registering retired_app_client_contracts.router means those released clients receive an unversioned 404, while only main.py serves the intended authenticated 410 retirement boundary. Register the retirement router in _build_app as well.
AGENTS.md reference: backend/AGENTS.md:L219-L223
Useful? React with 👍 / 👎.
| x_omi_jit_max_output_tokens: str | None = None, | ||
| x_omi_jit_max_input_tokens: str | None = None, | ||
| x_omi_jit_max_spend_micro_usd: str | None = None, | ||
| ) -> JSONResponse | StreamingResponse: |
There was a problem hiding this comment.
Reject legacy JIT headers before paid chat
When an older macOS runtime has a JIT relay context, it still attaches the X-Omi-Jit-* budget headers to desktop chat requests. Removing this ingress check makes those requests enter the ordinary managed/gateway chat path instead of receiving 410, so the first retired proactive provider attempt can incur spend before the old client's post-response receipt guard notices that the JIT receipt is missing. Keep a terminal 410 check for these headers while those clients remain released.
AGENTS.md reference: backend/AGENTS.md:L219-L223
Useful? React with 👍 / 👎.
|
CodeQL triage (parent session): the 7 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dec6ec806f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def retired_memory_use( | ||
| memory_id: str, | ||
| request: Request, | ||
| uid: str = Depends(get_current_user_uid), |
There was a problem hiding this comment.
Preserve the rate limit on retired memory-use requests
When a released client or another authenticated caller repeatedly posts to this retired endpoint, the new dependency performs authentication only, although route_policy_manifest.yaml still declares the memories:modify fail-closed wrapper and the replaced handler enforced it. Because this 410 boundary remains externally reachable, this change allows an authenticated user to generate unbounded auth and request-processing load; retain with_rate_limit(get_current_user_uid, "memories:modify") on the retirement shim.
AGENTS.md reference: backend/AGENTS.md:L191-L191
Useful? React with 👍 / 👎.
# Conflicts: # backend/docs/feature-flag-registry.md # backend/routers/conversations.py # backend/tests/fast_unit_duration_allowlist.txt # backend/utils/conversations/process_conversation.py # backend/utils/conversations/processing_trigger.py
# Conflicts: # desktop/macos/Desktop/Sources/ScreenActivitySyncService.swift
|
CodeQL triage, head 3f62684 (parent session): the 12 Python annotations are pre-existing main alerts with the same rule, shifted by line changes. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd1bd85955
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| request_id: str, | ||
| request: Request, | ||
| account_generation: int | None = None, | ||
| uid: str = Depends(get_current_user_uid), |
There was a problem hiding this comment.
Preserve the limit on retired frame-image requests
When a released client or authenticated caller repeatedly requests this retired image endpoint, every request now performs authentication without the frame_requests:read limiter enforced by the replaced handler and still declared in route_policy_manifest.yaml. This makes the externally reachable 410 boundary an unbounded auth/request-processing path; retain with_rate_limit(get_current_user_uid, "frame_requests:read") on the tombstone.
AGENTS.md reference: backend/AGENTS.md:L191-L191
Useful? React with 👍 / 👎.
| if not output_path: | ||
| raise RuntimeError('GITHUB_OUTPUT must be set to render workflow outputs') | ||
| with Path(output_path).open('a', encoding='utf-8') as output_file: | ||
| output_file.write(value) |
| @@ -293,7 +292,7 @@ | |||
| emit_auth_refresh_succeeded(telemetry_context) | |||
| return token_resp['access_token'] | |||
| except Exception as e: | |||
| logger.warning(f'x_connector: token refresh failed for uid={uid}: {e}') | |||
| logger.warning('x_connector: token refresh failed for uid=%s (error_type=%s)', uid, type(e).__name__) | |||
| @@ -525,7 +514,9 @@ | |||
| new_posts = tweets + bookmarks | |||
| source = 'oauth' | |||
| except Exception as e: | |||
| logger.warning(f'x_connector: official API sync failed for uid={uid}, falling back: {e}') | |||
| logger.warning( | |||
| 'x_connector: official API sync failed for uid=%s, falling back (error_type=%s)', uid, type(e).__name__ | |||
| @@ -548,7 +539,7 @@ | |||
| # deployment, not a fetch error: skip the fallback instead of | |||
| # burning retries per user on a guaranteed failure. | |||
| await run_blocking(db_executor, users_db.set_integration, uid, INTEGRATION_KEY, {'syncing': False}) | |||
| logger.info(f'x_connector: RapidAPI fallback skipped for uid={uid}: RAPID_API_KEY not configured') | |||
| logger.info('x_connector: RapidAPI fallback skipped for uid=%s: credentials are not configured', uid) | |||
| @@ -564,7 +555,7 @@ | |||
| ] | |||
| source = 'rapidapi' | |||
| except Exception as e: | |||
| logger.error(f'x_connector: RapidAPI fallback failed for uid={uid}: {e}') | |||
| logger.error('x_connector: RapidAPI fallback failed for uid=%s (error_type=%s)', uid, type(e).__name__) | |||
| 'x_connector: failed to index x_posts chunk[%s:%s] for uid=%s (error_type=%s)', | ||
| i, | ||
| i + 100, | ||
| uid, |
| logger.warning(f'x_connector: failed to clear syncing after Flex deferral for uid={uid}: {cleanup_error}') | ||
| logger.warning( | ||
| 'x_connector: failed to clear syncing after Flex deferral for uid=%s (error_type=%s)', | ||
| uid, |
| logger.warning(f'x_connector: failed to clear syncing after sync failure for uid={uid}: {cleanup_error}') | ||
| logger.warning( | ||
| 'x_connector: failed to clear syncing after sync failure for uid=%s (error_type=%s)', | ||
| uid, |
Summary
This PR implements David's 2026-10-18 rulings for the Jev experiments and the 10-14 flag-review batch. It removes retired paths and declarations, graduates the approved behavior, keeps the approved ops kill switches, and retires the JIT pipeline without deleting its stored data.
Jev rulings
MEMORY_OWNER_JEV_FLIP_ENABLED/_PERCENT, the Jev owner flip and its private writer. Labels did not reach the bar; source attribution is retained at extraction time. Legacy stored attribution overrides remain readable.CONVERSATION_RELEVANCE_JEV_PERCENT, nowops_killwith a 0% unset default. Existing host outcomes are listed below.CONVERSATION_SMART_MERGE_MODEremains theops_killstop lever (mergeby default;offstops new merges). The UID allowlist is removed. The legacy-first, proven-same-recording wall-clock rescue is now unconditional after a legacy skip;gap_path=legacy|wallclockand the metrics from the formeronpath remain. Shadow-only path logging/meters are removed.desktop_pendant_callrecords. All declared hosts wereshadow, whose code path does not write. A read-onlyro-prodcount query could not run because Firestore has no collection-group index forcapture_group.kind; no rows were read or changed.MEETING_NOTES_EPISODE_EVIDENCE_*is unchanged. Historical benchmark notes remain.typesafe/jev-1.14; other Jev callers stay on their existing models. OCR text only is sent; no images. Registry note records David's privacy approval and the rollout plan: 5% for 3 hours, then 100%, watching gate failure/fail-open rate and extraction spend.Flag-review batch
MEETING_NOTES_SCREEN_FRAMES_CONTEXT_ENABLED; approved frames are attached to meeting notes whenever present and otherwise remain a no-op. The declared prod/dev values were enabled on Cloud Runbackendandbackend-sync, GKEbackend-listen, andpusher; prodbackend-sync-backfillandbackend-integrationwere unset/off and now use eligible evidence.backend-sync-backfillandbackend-integrationwere unset/off and now use stored eligible calendar context. Stable's client flag was absent/off; Beta could enable it unless the client kill row was set. Client behavior is now unconditional. The two PostHog rows (system_calendar_meeting_contextand_kill) need separate dashboard cleanup; remote rows cannot be deleted by this code PR.backend-sync-backfillandbackend-integrationwere unset/off and now use eligible stored OCR context. Stable's client flag was absent/off; Beta could enable it unless killed. Client behavior is now unconditional. Theon_device_meeting_identityand_killPostHog rows need separate dashboard cleanup.SCREEN_FRAME_EGRESS_ENABLED; its dev/prod values were true on Cloud Runbackendand unset elsewhere. Only that service provisions the signer; other hosts remain blocked by the unchanged bucket/signer checks at route entry, beforejudge_canonical. A host without either still sends nothing to the judge. The account consent default is unchanged.FAIR_USE_ENABLEDas anops_kill; fair-use caps stay enabled.free-tier-cohort-v1exposure key and the darkFREE_TIER_MEMORY_SUPPRESSIONflag/cohort path. No user's memory formation changes from those controls. The retired PostHog row cleanup is separate dashboard work.negative_feedback_remediation_killremains the ops stop lever. The PostHog enable row needs separate dashboard cleanup.jit-processing-v1,jit-processing-kill-switch-v1, the two-UID allowlist,KNOWLEDGE_LEDGER_DRAIN_ENABLED, JIT route implementations/notifications/runtime, ledger drain, QA tooling, and scheduled daily-sweep wiring. The newerjit_first_openobligation worker and its first-open dispatch path from currentmainare removed too; funded backlog consent and demand-driven processing (feat: add demand-driven conversation processing #21905) remain. Six released JIT API paths remain as static 410 tombstones with deprecated route-policy entries; they perform no JIT work, and in-tree clients no longer call them. The same tombstone router is mounted on the deployed desktop backend, so released desktop builds receive 410 (including/v3/memories/{id}/use) rather than 404. The published app-client OpenAPI keeps those operations visible as deprecated 410s so the released request shapes remain protected by the compatibility gate. Eager memory extraction remains; prod was already off, so its extraction behavior is unchanged, and the dev rollout path is removed. No Firestore documents are deleted or migrated. Retained JIT history is injit_trigger_feedback,jit_proactivity_events,jit_proactivity_daily_budgets, andjit_proactivity_candidate_turns; retained daily-sweep history is indaily_memory_sweep_receipts,daily_memory_sweep_sources,daily_memory_sweep_onboarding_sources,daily_memory_sweep_daily_summary_staged,daily_memory_sweep_onboarding_staged, anddaily_memory_sweep_model_invocations. Knowledge-ledger history and migration state remain in place, includingmemory_ledger_reopensandmemory_control/{knowledge_ledger_migration,knowledge_ledger_prompt_projection,knowledge_ledger_writer_transition_receipt}. The two retired PostHog row deletions are separate dashboard cleanup.config_switch, kept one Jev percentage asops_kill, and left five real experiments. Registry rendering now reads deploy-action environment overlays in addition to runtime_env and chart values.The screen-task Jev move to
typesafe/jev-1.14is covered above; only OCR text is sent, no images.Deleted workflow files:
.github/workflows/gcp_daily_memory_sweep_job.yml,.github/workflows/gcp_daily_memory_sweep_job_auto_dev.yml,.github/workflows/jit_qa_cloud_run.yml,.github/workflows/jit_qa_manual_operator.yml, and.github/workflows/jit_qa_typesense_projection.yml.Relevance rollout parity (ruling 5)
Effective Jev percentage before and after this PR; a host with an unset old percentage used the old enabled default if enabled, otherwise it was off. New unset default is 0%.
backendbackend-syncbackend-sync-backfillbackend-integrationbackend-listenpusherbackendbackend-syncbackend-sync-backfillbackend-integrationbackend-listenpusherSmart-merge host values (ruling 8)
MODEbefore → afterbackendmerge→mergeshadow→ unconditional after a proven legacy skipbackend-syncmerge→mergeshadow→ unconditional after a proven legacy skipbackend-sync-backfillmerge→mergeshadow→ unconditional after a proven legacy skipbackend-integrationmerge→mergeshadow→ unconditional after a proven legacy skipbackend-listenmerge→mergeshadow→ unconditional after a proven legacy skippushermerge→mergeshadow→ unconditional after a proven legacy skipbackendmerge→mergeshadow→ unconditional after a proven legacy skipbackend-syncmerge→mergeshadow→ unconditional after a proven legacy skipbackend-sync-backfillmerge→mergeshadow→ unconditional after a proven legacy skipbackend-integrationmerge→mergeshadow→ unconditional after a proven legacy skipbackend-listenmerge→mergeshadow→ unconditional after a proven legacy skippushermerge→mergeshadow→ unconditional after a proven legacy skipUser-visible effects and rollback
CONVERSATION_SMART_MERGE_MODE=offstops all new smart merges immediately.SCREEN_TASK_JEV_*controls are unchanged.CONVERSATION_SMART_MERGE_MODE=offfor smart merge andnegative_feedback_remediation_killfor negative-feedback remediation.Validation
UI-Evidence: none -- retirement-only UI cleanup; no new layout or visual design, with changed behavior covered by component and platform tests.
backend/test.sh. App-client OpenAPI compatibility passes, its schema and generated Dart/TypeScript/Swift outputs are current, and 107 focused compatibility/generator/contract tests pass.origin/mainversus 0.30s, 0.27s, and 0.28s before the fix. The regression was a cold import of the SystemOne client solely to read its prompt identifier; moving that identifier to the already-loaded offline prompts module reduced the branch measurements to 0.01s, 0.02s, and 0.02s. All three files now passbackend/test.shwithout allowlist entries or guard overrides. The deployed desktop backend now mounts the retired app-client tombstones and tests all JIT, temporary-frame, and memory-use compatibility routes for 410. Concurrent PostHog first reads now share one lazily constructed client; a concurrent regression test verifies this. Both backend apps no longer expose the obsoleteX-Omi-Memory-As-OfCORS header.nice -n 10 scripts/pr-preflight --pr-body-file ...andnice -n 10 env OMI_PR_BODY_FILE=... make preflightpass all 110 selected checks on the integrated source committed asae8f7ba; noPRE_PUSH_SKIP_*variables were set. Earlier iterations found stale assertions tied to removed workflows, a route-policy gap for retained 410 compatibility endpoints, and three Swift formatting differences; those were corrected, and each affected check now passes. The updated Cloud Run forbidden-env test passes 2/2 in isolatedbackend/test.shand verifies renderer outputs come fromGITHUB_OUTPUTwithout stdout leakage.3f626848are pre-existingmainalerts shifted by line edits (X connector clear-text logging, runtime-env rendering at 418→456, and the ws-m-atom test regex); the seven JavaScript randomness annotations were likewise confirmed againstmain. The triage evidence is documented in PR comments. No further code changes are being made to chase these findings.origin/main(78996697a5b). The timed-out future was the test waiting for native reconciliation to start: after retirement, unsupported history correctly selects additive Siri upserts, since a current-only fetch cannot authorize deleting absent native rows. The test now injects an empty, complete owner-history projection before asserting that a native reconcile that never returns cannot hold the provider load open. The complete Siri nonblocking test file passes (3/3).Failure-Class: none
Product invariants affected