Repository navigation
chore: feature-flag registry as source of truth + graduate/kill dead flags - #18722
Conversation
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream SCA-542 declared CONVERSATION_RELEVANCE_JEV_ENABLED and MEMORY_OWNER_JEV_FLIP_ENABLED in deploy manifests, so the rendered registry moved both out of the undeclared section.
23a625a to
8dc6db6
Compare
…ag-registry-cleanup # Conflicts: # backend/docs/feature-flag-registry.md
The flag-registry line grew the guide to 39011 bytes against its 39000 budget, failing the Hygiene agents-md-lean check. Same facts, tighter wording: 38986 bytes.
|
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:
Before your next PR, please skim:
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! |
…leanup # Conflicts: # desktop/macos/CHANGELOG.json
…leanup # Conflicts: # web/app/src/components/settings/SettingsPage.tsx
…definition Upstream BasedHardware#18722 (43c27b7) deleted backend/utils/task_intelligence/rollout.py but left its scope_hint in .github/failure-classes/FC-gate-principal-outside-consolidated-entitlement.json; scripts/failure-class treats a hint matching zero tracked paths as an error, so failure-class-protocol fails for any range spanning that deletion — ours does. Retarget the hint to the surviving task_intelligence directory (upstream repairs dead hints the same way: BasedHardware#14493, BasedHardware#14466, BasedHardware#14495). Registered as T1 (max_added_lines 1) with upstream-prs queue row #18. Evidence: scripts/failure-class validate --base origin/main --head HEAD --pr-body-file /tmp/pr-body.md passes the declaration and this error; re-run after commit. Failure-Class: none
…ners Review of bf7f4f6..8d1f8e2 (the 2026-09-26 sync, 1011 upstream commits) for every owner this registry records: - BasedHardware#18722 (43c27b7) retired the orphaned Google OAuth lane: googleSync.ts is deleted, the google* bridge methods leave src/preload/index.ts, the Google* types leave src/shared/types.ts, jitRuntime loses its calendarObservation, env.d.ts loses MAIN_VITE_GOOGLE_CLIENT_ID/SECRET, and DataSourcesStep/IntegrationsTab drop the Gmail/Calendar OAuth rows. None of that touches the fork identity contract: registerAuthHandlers → registerIdentity, makeRendererTokenRefresher → currentBackendSession, the seven retiredBridge properties and the aiProfileGenerateNow span are all still present, so source-stage.mjs applies byte-exactly. googleSync.ts has no consumer left in the tree (only its registry entry), so that entry is removed instead of re-recorded. - 14d6b28 / 46c7588 / 24252b7 / 83133af add the tray "Toggle OMI Bar" Wayland fallback (window.ts summonFromTray, index.ts tray wiring, tray/trayState menu entry). Presentation only; the new menu label is classified in fork/brand-text.json as "Toggle {product} Bar" so the brand catalogue's omi-gate stays closed, and the identity spans the stage rewrites in index.ts are unchanged. - 6eda685 reworks MCP connector status (claudeMcpConnected → claudeMcpStatus, cliConnected → cliConnectionState) and BasedHardware#18722 gates OMI_YOLO_MODE to unpackaged builds. No identity, credential or Origin semantics. Re-record: sha256 of each of the 12 stale paths rewritten into desktop/windows/fork/source-owners.json (there is no acceptance mode in the tooling — desktop/macos/fork/README.md: "There is no automatic hash acceptance mode"); googleSync.ts dropped from the same file. Verification: bash desktop/windows/fork/test.sh exit 0 on node 22.23.2 — vitest 14/14, unittest 4/4 (test_prepare.SourceStageContract is the test that raised the CI ValueError, and brand-stage now passes the classified tray label), ci_build two-target byte-code builds. Failure-Class: none
…6 sync fork-cloudflare-routes failed in CI at the first step (three RatchetTests spawning check_projection_names.py, which died with ValueError 'memory kernel source must be an ordinary repository file'). Root causes, in the order the lane now hits them: 1. Upstream BasedHardware#18722 (43c27b7, 2026-09-25) deleted backend/utils/task_intelligence/rollout.py while MODULES still mapped it to candidate_kernel_rollout, so generate() raised before anything ran. The projector now stages candidate_kernel_rollout from utils/task_intelligence.chat_first_eligibility's pure resolver (the module still imports the control table the Worker never stages, so only the node is selected), and candidate_control_routes.py performs the endpoint projection upstream now does inline in /v1/candidates/control. The new staged owner is registered in fork-cloudflare-routes triggers. 2. Upstream a22eb2a (BasedHardware#13953, 2026-09-15) landed four regressions behind the then-red lane: - Memory.capture_context annotates MemoryCaptureContext; the staged wire lacked the class and both Annotation anchors, so every MemoryDB build raised PydanticUserError and canonical routes answered 503. The wire now selects MemoryCaptureContext and binds Literal/AwareDatetime. - read_ledger_history_page gained a provider_kwargs prelude reading self.db_client; page_policy drops those statements and fails loudly if upstream moves them (NameError -> 503 before the fix). - the adapter's scan predicate lazy-imports ledger_history_policy and normalize_temporal_read_view; the api-core oracle execs those policy modules into its controlled namespace instead of importing models.memories -> database._client -> google. - belief_computed_at joined the read-time belief overlay; the snapshot store's stable_projection excluded only three of upstream's BELIEF_VIEW_FIELDS, so belief-on receipts read stale every time. It now excludes upstream's own set. 3. Two upstream-inventory ledgers the early failure had masked: - backend-routes.json: twenty new slots (MCP canonical root, speaker tag prompts, voice profile settings, capture-group separate, local-dev token, mobile feedback) recorded as blocked with migration notes under a new #cf4-upstream-route-additions-2026-09-26 ledger section; counts move 625 -> 645 (602 owned, 43 blocked). - redis-primitives.yaml: new family x-sync-window-lock for upstream a92d9af's try_acquire_x_sync_window_lock, and three new direct callers from the MCP modernization classified. Evidence (deploy/cloudflare, Node 24.18.0, full lane): bash deploy/cloudflare/ci/routes.sh -> exit 0 test:route-inventory 13 OK; validate:backend-routes 'matches 645'; validate:manifest '656 CF routes, 645 backend (0 legacy-owned, 43 blocked)'; tsc clean; vitest 138 files/1157 passed; projection-names '10 known unbound; no new ones'; api-core 1299 passed; api-ai 151 passed. check-upstream-touch.py --aggregate exit 0. Failure-Class: none
main's feature-flag registry (BasedHardware#18722) graduated DAILY_SUMMARY_SELECTION_MODE: no backend code reads it any more, and check_feature_flag_registry now rejects it as an undeclared flag. This branch still carried three references that main's cleanup could not reach, because this PR had rewritten the same regions: - the flag on notifications-job in runtime_env/_base.yaml - a runtime-env validation rule requiring it to stay on notifications-job and never travel with x-connector-sync-job - the two test assertions pinning that rule The rule and its tests were this PR's own guard for the split. Their premise -- that the daily summary reads this flag at import and silently falls back to 'legacy' when it is unset -- stopped being true when the flag graduated, so the guard now demanded a dead flag. All three are removed and runtime_env.yaml is recomposed. main's own --remove-env-vars entry for the flag in gcp_notifications_job.yml is left in place: that is the correct cleanup of the already-deployed value. Verified: check_feature_flag_registry OK; compose_runtime_env --check rc=0; test_render_backend_runtime_env 47, test_backend_runtime_env_validator 127, test_notifications_job_orchestrator 11 -- all passed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/failure-class fails closed when a changed definition has a scope_hint matching no tracked file. The upstream sync adds every upstream definition at once, so it trips on four hints whose files upstream itself has since removed: - desktop/windows/src/main/jit/** (BasedHardware#20494, BasedHardware#22209), in FC-client-rederives-authority-verdict and FC-sync-gated-on-consumer-trigger; - backend/utils/free_tier_cohort.py (BasedHardware#22238) and free_tier_memory_policy.py (BasedHardware#22209), in FC-cohort-gate-consulted-without-its-subject; - backend/utils/task_intelligence/rollout.py (BasedHardware#18722), in FC-gate-principal-outside-consolidated-entitlement. Each definition keeps its remaining, live hints. Verification: scripts/pr-preflight --suggest reported exactly these four scope_hint_matches_nothing errors before; git cat-file confirms none of the paths exist on upstream/main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0148HLrpWR8Mimn43rkNvGKg
What changed and why
The former hand-written feature-flag catalog was stale (including notes v2's
_basevalue) and omitted backend and client gates.config/feature-flags.yamlnow records intent only; CI verifies code reads, deploy declarations, retired names, schema, and deterministic rendered documentation. A separate PostHog utility defaults to a read-only diff and can only create missing 0%-armed kill rows when explicitly invoked after merge. The registry has 123 active entries (4 experiments, 70 rollouts, 25 ops kills, 24 config switches) and 3 retired names; no review date is overdue as of 2026-09-24. No PostHog writes or deployments were performed for this PR.Product invariants affected
Part B — graduates
_basesetstrueon backend-listen, pusher, Cloud Run backend and backend-sync and both charts settrue; however the legacy branch still hosts the only path to activeOMI_LLM_GATEWAY_CONVERSATION_STRUCTURE_SHADOW_ENABLED/ action-items shadow gates. Deleting it would silently kill out-of-scope Decide traffic. The flag and both shadow branches remain; this needs a separate shadow-traffic decision._base, overlays, charts, or.env.template.MEMORY_ENABLED=onremains declared on all memory hosts; its ops kill, fail-closed-on-unset behavior is preserved. Emulator/dogfood/E2E harnesses explicitly use the canonical flag, and operational docs and tests name the surviving control.intelligence_product_enabled=True; the response still emitschat_first_uifor old desktop clients. The macOS read is entangled with generation-bound owner handoff and agent tool admission across Swift and TypeScript, exceeding the brief's ~600-line/ownership stop rule; no client fallback was removed.trueboth on its response and JSON response headers. The SceneKit legacy brain-map/view-model removal exceeds the size stop rule and shares state with the canonical atlas; the client header read and dev override remain.chat_first_uiwire field remains for older clients._basedeclaredindexedfor the notifications job in dev and prod, with no overlay override; there is no chart declaration changing that job. Recipient selection is now the indexed query only. The job deploy explicitly removes the retired env var; indexed, partial-read, lock, and daily-wear tests remain.Part C — kills
flagName; the bundle-identityisEnabledandcontext_buckets_killgates are untouched. The active PostHog row is now a read-onlyretired:delete candidate for the coordinator after merge.JIT_LEDGER_MIGRATION_FLAG_KEYand the test that checked a non-authorizing name; JIT admission remains governed byjit-processing-v1plus its kill switch perbackend/docs/jit_rollout_authority.mdx.JIT_DAILY_SWEEP_FLAG_KEYwas a decoy, never admission.MEMORY_DAILY_MEMORY_SWEEP_COHORT_FLAGremains explicitly empty in both overlays, never defaults to this name, and sweep authority remains unchanged. Retired PostHog row is a read-only delete candidate for the coordinator after merge.jit_conversation_retrieval_enabledadmission key and tests remain.decide_rollouthas no non-test caller, the same module's migration/parity functions have live callers inmigrations/007_genesis_ledger_backfill.pyandrollout_cli.py. Deleting the module would break those callers; no relocation outside the brief was attempted..planGatederror.NEXT_PUBLIC_ENABLE_GLEAPdeclaration existed inweb/frontend/.env.templateto retire..env.exampleand.env.beta.exampledeclared0;git log --since=2026-09-10found no own-login changes. Open PR feat(desktop): Google OAuth connector for Gmail and Calendar #10969 is Mac-only (no Windows files). Removed dormant renderer/main loopback OAuth path, its now-dead Google refresh-token store and misleading Hub/Onboarding Email placeholder; kept shared PKCE plus independent auth/BYOK/MCP token stores, backend-mediated Calendar connector, and the shipped Gmail-session UI/IPC underVITE_ENABLE_GMAIL_SESSION.true(backend-listen setsfalse); deleting the flag or forcing the false branch would change a declared production host. The code and chart declarations remain.Scoped test repair after integrating main
The newly merged shared-task acceptance tests from #17830 called
accept_shared_action_items(payload=…)and mocked APIs the production route does not use. To keep the required push gate meaningful, the test file now exercises deleted tasks (404), locked tasks (402), and creation-failure token rollback through the currentAcceptSharedTasksRequest/get_task_share/get_action_itemcontract inbackend/routers/action_items.py;tests/unit/test_task_sharing.pyalready covers self-accept, duplicate, success, and post-claim race. The three targeted tests pass throughbackend/test.sh; production task-sharing code is unchanged.Infrastructure hardening
OMI_YOLO_MODEbefore agent launch; dev/named builds retain their explicit override. Behavioral tests cover both sides.ignore:block names shipped local UserDefaults/env knobs with their explicit rationale; no local knob behavior changes.How it was verified
backend/pylock.toml.BACKEND_PYTEST_WORKERS=1 BACKEND_UNIT_TEST_FILE_LIST="$PWD/.devin-brief/backend-required-tests.txt" bash backend/test.sh: 70 isolated files, 1,984 passed, 0 failed, default 0.30s CPU guard unchanged. Parallel runs tripped that guard on two different tests at 0.30/0.31s despite all assertions passing; both passed alone and the complete serial run passed (one 0.17s warn).backend/tests/integration/test_notifications_integration.pywas not run because it sends real Firebase notifications;backend/testing/e2e/test_conversation_processing.pyis explicitly excluded bybackend/test.shand was not run standalone.backend/scripts/check_runtime_env_compose.sh: pass. After replacing the retired alias in test harnesses, a four-file backend selector passed 30/30, andfirebase emulators:exec --only firestore --project demo-omi-jit-qa 'bash backend/scripts/run-emulator-proofs.sh'passed every proof using a loopback Firestore emulator; its emulator process shut down. CI hermetic backend E2E remains the authority for its full multi-file suite.python3 scripts/test_check_feature_flag_registry.py: 13 hermetic fixtures passed; checker passes on the whole tree in 1.6s; renderer twice plus header reuse produced identical bytes.python3 scripts/test_posthog_flag_sync.py: 11 hermetic tests passed; no live PostHog requests or writes.bash -n desktop/macos/run.shpassed; agent projectornpm test -- tests/tool-result-projector.test.ts12 passed,npm run buildpassed, full agentnpm test884 passed;desktop/macos/scripts/agent-logic-harness.shpassed all stages.xcrun swift build --build-tests --package-path desktop/macos/Desktoppassed; 105 focused Swift tests passed; desktop test-quality check passed. Xcode 27 local build is necessary but not a substitute for CI's pinned 26.6.npx pnpm@10 typecheckclean;npx pnpm@10 lint0 errors (706 pre-existing formatting warnings, none in touched files);npx pnpm@10 test5,549 passed, 0 failed. Packaged/unpackaged pi-mono spawn-env test passed.bun run checkclean types, 543 Vitest + 5 Bun tests passed. Frontend:npm test90 passed,npm run lintclean. Mobile:bash test.sh2,919 passed (5 skipped);scripts/analyze_ratchet.shno new findings.python3 .github/scripts/test_run_checks.pypassed after integrating current main (56 cases);python3 .github/scripts/check_agent_doc_references.py,git diff --check: pass.PATH="/tmp/realgit-flags:$PATH" OMI_PR_BODY_FILE=.devin-brief/pr-body-flag-registry.md scripts/pr-preflight: 82 checks passed at HEAD23a625a5ab; bounded pre-push gate also passed with one backend worker. GitHub CI is running.New guards
The prior catalog had an incorrect notes-v2
_basevalue and omitted many current code/deployment gates; the new registry check catches those concrete failures and the fixture tests prove it rejects unregistered reads. It is not a duplicate of the deployment-setting classification: that contract classifies secret/config/public-build bindings, while this one records gate intent and live-value provenance without owning deployment values.Line-count exception
Line-Count-Exception: desktop/macos/Desktop/Sources/Chat/AgentRuntimeProcess.swift | 4365 -> 4367 | Keep production YOLO env scrubbing at the sole agent spawn boundary without splitting its process owner.
Failure class (fixes)
Failure-Class: none
Generated with Devin
🤖 Generated with Claude Code