Repository navigation
fix(flags): count validated manifest/chart pairs as one source, retire the duplicate-declaration allowlist - #24959
Conversation
Retire the duplicate-declaration allowlist and reject repeated runtime env mapping keys while preserving serving values and admission guards.
Codex Review Summary: ✅ CompletedThis 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. |
#24954 (registry checker v2) landed on main. Both sides deleted a module-level exception table in scripts/check_feature_flag_registry.py: this branch removed DUPLICATE_DECLARATION_ALLOWLIST and main removed REVIEW_OVERDUE, so neither survives. Both sides added --as-of; main's form (with the stdout flush) is kept. The rendered registry doc is regenerated and equals main's. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b76fa0840
ℹ️ 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".
| if len(parents) == 4 and parents[0] == "cloud_run" and parents[1] in {"services", "jobs"} and parents[-1] == "env": | ||
| platform = "cloud_run_service" if parents[1] == "services" else "cloud_run_job" | ||
| return platform, "/".join(parents[:3]) | ||
| return None |
There was a problem hiding this comment.
Preserve discovery of gateway manifest declarations
The new workload filter does not recognize llm_gateway.env, so declarations in that existing manifest section are silently skipped. For example, DREAM_ON_DEMAND_ENABLED in _base.yaml and LLM_GATEWAY_ACCOUNTING_ENABLED in prod.overlay.yaml no longer appear as gateway manifest declarations. Previously these entries were scanned, so an unregistered or retired flag introduced in this section produced an error; now the registry check accepts it unless it also appears in another scanned source. Add a gateway workload identity so the new source-grouping logic preserves validation of this deployment surface.
Useful? React with 👍 / 👎.
Requested by David
Summary
Count logical declaration sources per flag, platform, workload and environment instead of counting raw files. Base plus overlays compose one manifest source. A GKE section and the chart named by its effective
values_fileare one validated source:_validate_gkeenforces the expected/actual contract through_validate_env_entries. Pairing is derived from the manifest, including environment-specific overrides, with no hard-coded service or flag list.Keep the GKE manifest entries because
_validate_gkeenforces them against the charts and the lake-admission guard readsOBJECT_LAKE_WRITE_PERCENT/OBJECT_LAKE_WRITE_ENABLEDfrom them. The Parakeet admission contract,test_backend_runtime_env_validator.pyandtest_render_backend_runtime_env.pyremain exactly as on main.No runtime_env value changed except collapsing identical doubled lines. The 16 duplicate scalar mapping lines have identical values (two are under AUDIO_ARCHIVE_REGIONAL_CACHE_PERCENT; the others are under AUDIO_ARCHIVE_STOP_PCM_PERCENT). No declaration entries are removed. The redundant DEMAND_PROCESSING prod zeros stay. Regenerating runtime_env.yaml yields output byte-identical to main, including every GKE, Cloud Run, desktop and jobs section. Charts and all guard implementations are unchanged.
Delete
DUPLICATE_DECLARATION_ALLOWLIST, its expiry, and its warning/expiry/stale branches without a replacement allowlist. Independent declarations still fail for the same key/platform/workload/environment. Platforms are distinct: Cloud Run services, Cloud Run jobs, GKE, desktop and generic actions. Agcloud runaction uses its Cloud Run target platform and remains a separate file source; matching a GKE chart name never changes its platform. Two GKE charts for one workload/environment still fail. Add--as-ofto main(), retaining unrelated review-date/backlog policy. YAML node discovery covers quoted/compact mappings and aliases using the existing CI PyYAML dependency.Product invariants affected
Failure class (fixes)
Failure-Class: none
Preventive checker maintenance removes an expiring CI exception while recognizing an already enforced expected/actual contract. No runtime failure class or guard relaxation is introduced. The reusable protections are the platform-aware logical-source checker fixtures and the composer's duplicate-mapping-key rejection.
Per-key table
Every existing declaration stays. Charts serve the GKE values; the manifest declares expected values and supplies guard inputs. Cloud Run, desktop and jobs retain their own declarations.
AUDIO_ARCHIVE_PERCENTAUDIO_ARCHIVE_REGIONAL_CACHE_PERCENTAUDIO_ARCHIVE_STOP_PCM_PERCENTAUDIO_ARCHIVE_UID_ALLOWLISTBATCH_LIVE_STT_RETIRE_PERCENTBATCH_PIPELINE_RECOVERY_UID_ALLOWLISTBATCH_PIPELINE_SHADOW_PERCENTBATCH_PIPELINE_UID_ALLOWLISTCONVERSATION_RELEVANCE_JEV_PERCENTDEMAND_PROCESSING_PERCENTDEMAND_PROCESSING_UID_ALLOWLISTDREAM_AGENT_UID_ALLOWLISTFIRST_SUMMARY_DEADLINE_PERCENTMOBILE_STANDARD_BATCH_PERCENTOBJECT_LAKE_WRITE_PERCENTPARAKEET_STREAM_ALLOCATION_PERCENTPARAKEET_WINDOW_ALLOCATION_PERCENTSPEAKER_GROUPING_SHADOW_PERCENTSPEAKER_GROUPING_SHADOW_UID_ALLOWLISTSTT_LIVE_DEMAND_PERCENTSTT_LIVE_DEMAND_UID_ALLOWLISTSTT_NON_EN_MULTI_PREFER_HINTABLE_PERCENTSTT_ROUTING_ON_PERCENTSYNC_LINEAGE_RESOLVE_UID_ALLOWLISTTRANSCRIPTION_FINAL_PASS_PERCENTTRANSCRIPTION_FINAL_PASS_UID_ALLOWLISTTRANSCRIPTION_SHADOW_PERCENTTRANSCRIPTION_SHADOW_UID_ALLOWLISTValue preservation and compose proof
out-dupes-compose-diff.txtin/Users/dazheng/workspace/omi/data/run-2026-11-08-audit-fixes/records the measured UTC time, main SHA, commands and equality proof. The three source documents parse to exactly the same mappings as main; only the 16 identical repeated fields are collapsed. Generatedbackend/deploy/runtime_env.yamlis byte-identical to main. The PR does not edit charts, the Parakeet contract, backend runtime validator tests,_validate_gke,_validate_env_entries, and lake-admission guard code are unchanged.The review correction restores every runtime-env source file, its pending patch, the matching rendered registry row,
test_render_backend_runtime_env.pyand its served-defaults fixture from current main before reapplying only hygiene. This preserves #24934's currentFIRESTORE_READ_LEVERS, includingprivacy_checks_shadow,privacy_negative_lookup_cache:100andbatch_timeliness_leader:0.Measured 2026-11-09T01:12:55.181983+00:00 against main
6a03440964b9ecf21330cc87a8b2c30dcce712da:git diff origin/main -- backend/deploy/runtime_env/ git show origin/main:backend/deploy/runtime_env.yaml | cmp - backend/deploy/runtime_env.yamlThe first command shows only 16 deleted identical scalar lines across the three source YAML files. The second exits 0: the entire generated manifest is byte-identical to main.
python3 backend/deploy/compose_runtime_env.py --checkalso exits 0. The proof file includes the complete source diff and generated SHA2568345aa3d7f1025eaaf147847223128a822f0e59ebd5c635d9df4ce82e0325bb9.The composer now rejects repeated mapping keys, including identical duplicates, rather than applying YAML's last-value-wins behavior. Fixtures cover repeated value/category keys and compact mappings.
Verification
Measured UTC on 2026-11-09:
python3 scripts/test_check_feature_flag_registry.py: 77 passed, 00:56:07–00:58:51.python3 scripts/test_posthog_flag_sync.py: 11 passed, 00:58:51–00:58:51.python3 -m pytest backend/tests/unit/test_runtime_env_sources.py -q: 3 passed, 00:58:51–00:58:55.python3 backend/deploy/compose_runtime_env.py --check: passed, 00:58:55–00:58:56.python3 backend/scripts/validate-backend-runtime-env.py --env dev --check-workflows: passed, 00:58:56–00:58:58.backend/scripts/pre-deploy-check.sh: 511 passed plus source/admission checks, 01:00:30–01:01:27, throughomi-heavywith the 900-second local budget.python3 -m pytest backend/tests/unit/test_qualify_usage_month.py -q: 107 passed, 01:01:05–01:01:11.backend/scripts/cross_service_contract.py: 0 new violations, 34 known gaps, 0 stale gaps, 00:59:55–01:00:46.make preflightthroughomi-heavy: 44 selected checks passed, 01:06:31–01:12:32, with the 900-second local budget, UTC and serial checks.omi-heavy run --wait 3600 -- git push -u origin lane/dup-decl: passed, 01:13:04–01:20:11, with credential variables unset, the 900-second budget, UTC and serial checks. No pre-push gate was bypassed.scripts/pr-preflight --suggestandscripts/pr-preflight --metadata-only --pr-body-file ...: passed (00:54:39–00:54:42 and 00:58:14–00:58:23).The documented local setting is
BACKEND_UNIT_FILE_BUDGET_SECONDS=900 TZ=UTC; heavy suites and the normal guarded push run throughomi-heavywithout bypassing gates.The Nov 21 checker has zero duplicate errors and exactly the same 204 unrelated review-date errors as measured main
6a03440964b9ecf21330cc87a8b2c30dcce712da(2026-11-09 00:54:55–00:55:06 UTC, exit 1). The original main checker/declarations were read from that immutable ref; its 28 retired duplicate-exception errors are removed. No review exceptions are extended. The full list is saved toout-dupes-unrelated-errors.txtin the run directory.Unrelated 2026-11-21 baseline errors (204)
Landing and rollback
Merge after #24954; no serving value changes; rollback = revert this PR.
Rebase after #24954 merges, keeping both its registry v2 changes and this PR's duplicate logic/main() changes. No GCP tier was used; there were no production reads/writes, flag flips, deploys or merges.
🤖 Generated with Claude Code