Skip to content

chore: feature-flag registry as source of truth + graduate/kill dead flags - #18722

Merged
Git-on-my-level merged 15 commits into
mainfrom
chore/flag-registry-cleanup
Sep 25, 2026
Merged

Git-on-my-level merged 15 commits into
mainfrom
chore/flag-registry-cleanup

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

What changed and why

The former hand-written feature-flag catalog was stale (including notes v2's _base value) and omitted backend and client gates. config/feature-flags.yaml now 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

  • INV-CHAT-1 — macOS agent runtime changes must leave one shared transcript; no transcript ownership migration.
  • INV-MEM-1, INV-MEM-3, INV-MEM-4, INV-MEM-5, INV-MEM-6 — memory tier/API compatibility, canonical promotion, universal authority and the proposed ledger contract stay intact; only old env aliases disappear.
  • INV-TASK-2 — task capture still suggests rather than silently creating tasks; removed cohort plumbing does not add a capture path.
  • INV-AGENT-* — projector/agent process changes retain existing tool admission except for the explicit production YOLO restriction.
  • INV-DATA-1 — the notifications-job workflow only retires the indexed-selector env var; customer-data-plane authority remains unchanged.
  • INV-UI-1, INV-UI-2, INV-UI-3 — matched app source globs; no design system primitives or brand policy changed.

Part B — graduates

  1. CONVERSATION_NOTES_V2_ENABLED — skipped. _base sets true on backend-listen, pusher, Cloud Run backend and backend-sync and both charts set true; however the legacy branch still hosts the only path to active OMI_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.
  2. MEMORY_MODE / MEMORY_V3_GET_ENABLED — done. No declaration remains for either legacy alias in _base, overlays, charts, or .env.template. MEMORY_ENABLED=on remains 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.
  3. chat_first_ui — server compatibility retained; macOS fallback skipped. Universal task intelligence already sets intelligence_product_enabled=True; the response still emits chat_first_ui for 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.
  4. X-Omi-Memory-Canonical-Lifecycle-Exposed — server compatibility retained; macOS fallback skipped. The memory endpoint emits true both 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.
  5. task_intelligence/rollout.py — done. The resolved authority was already universal; its fixed booleans are now constructed at the remaining server call boundary while preserving workflow mode, account generation, and validation. The chat_first_ui wire field remains for older clients.
  6. DAILY_SUMMARY_SELECTION_MODE — done. _base declared indexed for 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

  1. context_buckets — done. Removed only unused Swift flagName; the bundle-identity isEnabled and context_buckets_kill gates are untouched. The active PostHog row is now a read-only retired: delete candidate for the coordinator after merge.
  2. jit-processing-ledger-migration-v1 — done. Removed the inert JIT_LEDGER_MIGRATION_FLAG_KEY and the test that checked a non-authorizing name; JIT admission remains governed by jit-processing-v1 plus its kill switch per backend/docs/jit_rollout_authority.mdx.
  3. daily-memory-sweep-v1 — done. The JIT_DAILY_SWEEP_FLAG_KEY was a decoy, never admission. MEMORY_DAILY_MEMORY_SWEEP_COHORT_FLAG remains 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.
  4. JIT_CONVERSATION_RETRIEVAL_ENABLED — done. Removed the unused env-name constant and alias; the request-scoped jit_conversation_retrieval_enabled admission key and tests remain.
  5. memory_ingestion/rollout.py — skipped. Although decide_rollout has no non-test caller, the same module's migration/parity functions have live callers in migrations/007_genesis_ledger_backfill.py and rollout_cli.py. Deleting the module would break those callers; no relocation outside the brief was attempted.
  6. OMI_LOCAL_PROACTIVITY — done. Removed two empty-bodied reads; both paths still throw the same .planGated error.
  7. OMI_FORCE_MEETING_NOTE_SCREENSHOTS — done. Removed sole run-script forwarding; no code consumes this env var.
  8. OMI_TOOL_RESULT_PURPOSE_RANKING_ENABLED — done. Removed the flag, option, and ranking branch; unranked section order, budgeting and omitted accounting remain covered by the agent tests (12 passed).
  9. shippedCohortsEnabled — done. Removed the field and dev automation bridge parameter/output. Dev opt-in enrollment remains; Beta/stable never enroll. Behavioral Swift tests decode prior JSON carrying the unknown field without failure (105 focused Swift tests passed).
  10. web/app omi_experimental_features — done. Removed four no-consumer Settings toggles, local state/write plumbing and empty Experimental navigation. The first Settings mount removes the old key with a guarded best-effort localStorage cleanup.
  11. NEXT_PUBLIC_ENABLE_GLEAP — done. Deleted fully commented-out widget and layout import/mount; its unused config key is gone. No NEXT_PUBLIC_ENABLE_GLEAP declaration existed in web/frontend/.env.template to retire.
  12. mobile devModeJoanFollowUpEnabled — done. Removed unused provider setter/field and SharedPreferences getter/setter; no UI caller or feature reader existed.
  13. Windows VITE_ENABLE_GOOGLE_INTEGRATION — done. Both .env.example and .env.beta.example declared 0; git log --since=2026-09-10 found 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 under VITE_ENABLE_GMAIL_SESSION.
  14. DEEPGRAM_SELF_HOSTED_ENABLED — skipped. The production pusher chart sets it to true (backend-listen sets false); 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 current AcceptSharedTasksRequest/get_task_share/get_action_item contract in backend/routers/action_items.py; tests/unit/test_task_sharing.py already covers self-accept, duplicate, success, and post-claim race. The three targeted tests pass through backend/test.sh; production task-sharing code is unchanged.

Infrastructure hardening

  • Production-family macOS bundles and packaged Windows/Linux builds strip OMI_YOLO_MODE before agent launch; dev/named builds retain their explicit override. Behavioral tests cover both sides.
  • The ignore: block names shipped local UserDefaults/env knobs with their explicit rationale; no local knob behavior changes.

How it was verified

  • Backend Python 3.11.15 via the pinned uv interpreter, then dependencies synced from 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.py was not run because it sends real Firebase notifications; backend/testing/e2e/test_conversation_processing.py is explicitly excluded by backend/test.sh and 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, and firebase 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.
  • macOS: bash -n desktop/macos/run.sh passed; agent projector npm test -- tests/tool-result-projector.test.ts 12 passed, npm run build passed, full agent npm test 884 passed; desktop/macos/scripts/agent-logic-harness.sh passed all stages. xcrun swift build --build-tests --package-path desktop/macos/Desktop passed; 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.
  • Windows: npx pnpm@10 typecheck clean; npx pnpm@10 lint 0 errors (706 pre-existing formatting warnings, none in touched files); npx pnpm@10 test 5,549 passed, 0 failed. Packaged/unpackaged pi-mono spawn-env test passed.
  • Web app: bun run check clean types, 543 Vitest + 5 Bun tests passed. Frontend: npm test 90 passed, npm run lint clean. Mobile: bash test.sh 2,919 passed (5 skipped); scripts/analyze_ratchet.sh no new findings.
  • python3 .github/scripts/test_run_checks.py passed 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 HEAD 23a625a5ab; bounded pre-push gate also passed with one backend worker. GitHub CI is running.

New guards

The prior catalog had an incorrect notes-v2 _base value 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

Git-on-my-level and others added 6 commits September 25, 2026 05:05
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.
@Git-on-my-level
Git-on-my-level force-pushed the chore/flag-registry-cleanup branch from 23a625a to 8dc6db6 Compare September 24, 2026 22:41
@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!

@Git-on-my-level
Git-on-my-level merged commit 43c27b7 into main Sep 25, 2026
66 checks passed
@Git-on-my-level
Git-on-my-level deleted the chore/flag-registry-cleanup branch September 25, 2026 11:43
summersmile1984 added a commit to summersmile1984/omi that referenced this pull request Sep 26, 2026
…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
summersmile1984 added a commit to summersmile1984/omi that referenced this pull request Sep 27, 2026
…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
summersmile1984 added a commit to summersmile1984/omi that referenced this pull request Sep 27, 2026
…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
aryanorastar added a commit to aryanorastar/omi that referenced this pull request Sep 27, 2026
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]>
Wizard815 pushed a commit to Wizard815/omi-local that referenced this pull request Nov 25, 2026
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
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