Repository navigation
fix(ci): keep routing-only push gates bounded - #11361
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_321c832b-8ba3-4f0f-86d3-2bcde9248251) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cdebc5877
ℹ️ 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".
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_bfb75dc2-519d-44c3-a065-b29e9d1c9b81) |
|
Thanks — I reviewed the current head and the implementation looks directionally sound, but I’m leaving this for human maintainer sign-off rather than approving because it changes workflow routing behavior and the PR is still carrying a failing Dart analyzer check. File-level notes:
Validation I ran locally on the PR head:
One caveat: GitHub’s Leaving this for human maintainer review specifically because this changes CI/workflow routing semantics and merge readiness still depends on the failing Dart analyzer check. — Automated maintainer review by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e46562c0-3c3b-43ab-ab6a-e4118ca13988) |
|
Re-reviewed the new head after the mobile-workflow routing commit. The implementation still looks directionally sound, but I’m keeping this as human-review-required rather than approving because it changes CI/workflow routing behavior and the current GitHub checks are not green. File-level notes:
Validation I ran locally on the PR head:
Current CI caveat: Leaving this for human maintainer review specifically because this changes CI routing boundaries and the PR is currently check-blocked. — Automated maintainer review by AI on behalf of David. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_01357b9d-0388-4455-8fe9-7ee4e9cc747e) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d1000dacc
ℹ️ 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 ".github/workflows/mobile-app-checks.yml" in normalized_paths: | ||
| selected.update({"flutter-codegen", "flutter-l10n"}) |
There was a problem hiding this comment.
Keep generated checks active for action changes
The new exception covers only mobile-app-checks.yml; a diff containing .github/actions/detect-changes/action.yml still produces has_app_codegen=false, has_app_l10n=false, and has_flutter_generated=false. That action defines and forwards these exact outputs, so a change that drops or misroutes either output skips the workflow's generated-files job instead of exercising the affected wiring. Fresh evidence since the earlier comment is that the added special case explicitly handles the workflow but still omits the shared detect-changes action.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ecf328c. The exclusion is now keyed on FLUTTER_GENERATION_DEFINITION_INPUTS / FLUTTER_GENERATION_DEFINITION_PREFIXES (.github/workflows/mobile-app-checks.yml + .github/actions/detect-changes/), so a detect-changes action diff emits has_app_codegen=true, has_app_l10n=true, has_flutter_generated=true. checks-manifest.yaml-only diffs still stay false. New test: test_detect_changes_action_change_wakes_flutter_regeneration (verified failing before the fix).
|
Re-reviewed the current head after the final analyzer-baseline ratchet. The implementation still looks technically reasonable, but I’m leaving it for human maintainer review rather than approving because it changes CI/workflow routing behavior and the current required desktop checks are not green. File-level notes:
Validation I ran locally on the checked-out head:
CI note: Keeping Reviewed by Omi maintainer automation. Human maintainer review is needed here specifically for the CI-routing behavior change and the failing required desktop Swift checks. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_07d0c57d-3aa5-4b5a-9bfc-2d506a282cdf) |
|
Re-reviewed the current head. The CI-routing change looks technically sound to me, and the current GitHub checks are green, but I’m leaving formal approval to a human maintainer because this changes workflow gate selection semantics. File-level notes:
Validation I ran on the checked-out head:
I’m keeping this as a positive signal rather than an approval because workflow-routing behavior should still have maintainer sign-off before merge. Reviewed by Omi maintainer automation. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
The pre-push CI-prediction selector treated any ROUTING_INPUTS edit (for
example .github/checks-manifest.yaml alone) as a reason to wake
flutter-codegen and flutter-l10n. A manifest-only diff then paid a full
build_runner rebuild (~17 minutes cold) at push time and had to reach for
PRE_PUSH_SKIP_FLUTTER_GENERATED=1. Routing metadata cannot make a
committed generated file stale, so those two lanes stay owned by their
real generator inputs; every other component lane the selector can
influence is still woken.
Verification:
python3 .github/scripts/test_pre_push_ci_prediction.py -> Ran 16 tests OK
python3 scripts/pre_push_ci_prediction.py --changed-files <(manifest only)
-> no flutter-codegen / flutter-l10n
Mutation check: re-adding flutter-codegen/flutter-l10n to the selector
fan-out fails test_routing_only_diff_does_not_wake_flutter_regeneration
Failure-Class: none
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The comment above the FluidAudio dependency claimed upstream had removed
the v0.14.8+ tags, so the manifest carried a bare revision pin. That
premise is false: git ls-remote --tags shows v0.14.8 and every v0.15.x
tag present, and revision 19600a4 IS tag v0.15.5. A raw revision pin
forces SPM to search an unlabelled commit on a cold cache; exact: 0.15.5
resolves the same commit through a normal tag lookup.
Verification (cold cache: fresh --cache-path/--scratch-path/--config-path
/--security-path under /tmp, removed before the run):
swift package resolve -> succeeded, 8m12s
Package.resolved fluidaudio pin unchanged at revision
19600a485baa4998812e4654b70d2bab8f2c9949, now also labelled 0.15.5
swift package show-dependencies ->
fluidaudio<https://github.com/FluidInference/[email protected]>
Failure-Class: none
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Remove the unrelated exact-tag manifest change and its inaccurate rationale while preserving the audited resolved revision. Verification: xcrun swift package dump-package; desktop manifest and Swift CI contract tests.
The routing exclusion treated every ROUTING_INPUTS path as metadata, but .github/actions/detect-changes/action.yml defines and forwards has_app_codegen/has_app_l10n/has_flutter_generated. A change there emitted has_flutter_generated=false and skipped the generated-files job that would exercise the rewiring. Narrow the exclusion to genuine routing metadata via FLUTTER_GENERATION_DEFINITION_INPUTS/_PREFIXES.
0d61d20 to
e74020f
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_65b250c1-345e-4674-b154-5f6863b3b792) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_c4d0f8e0-0f31-47e0-8d47-310fc6bcb67a) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa7196580c
ℹ️ 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".
aryanorastar
left a comment
There was a problem hiding this comment.
Community review:
Keeping routing-only / selector / checks-manifest edits from waking Flutter codegen/l10n (~17m) while still waking regeneration when .github/workflows/mobile-app-checks.yml or detect-changes changes is exactly the right CI boundary. The new predictor tests (routing_only_diff…, mobile_workflow_change…, real_generator_inputs…) read as the invariant lock.
Two asks:
- Explain/fix the Desktop Swift Build/Static/Release failures on this tip — a routing-predictor PR shouldn’t need a red Swift lane unless Package.swift churn is intentional (the FluidAudio comment trim is tiny; confirm it’s unrelated to the reds).
- Keep the fail-safe: unknown/unclassified paths must not suppress a required component lane (existing unknown-path coverage — please confirm it still holds after excluding flutter regen from selector_changed).
Small, high community-unblock value once Swift reds are accounted for.
aryanorastar
left a comment
There was a problem hiding this comment.
Requesting changes (upgrade from earlier COMMENT — required desktop lanes red on a CI PR that touches desktop workflows):
Bounding routing-only pushes so they do not wake Flutter codegen/l10n is still the right community unblock, and the predictor tests look like the invariant lock.
Blockers on this tip:
- Desktop Swift Release Compile / Static & Test Contracts / Build are failing (Release Compile failed after ~3h on a recent run). A routing-predictor PR that edits desktop-related workflow wiring should not land on red required desktop lanes — green them or prove unrelated flake with a clean re-run.
- Keep fail-safe: unknown/unclassified paths must not suppress a required component lane.
Happy to switch to COMMENT/APPROVE once Desktop Swift required checks are green on tip.
Keep the hatch disclosure documentation aligned with the selector boundary: routing metadata stays cheap while generator inputs and workflow definitions retain generated-output checks. Failure-Class: none
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d99708b1-cf05-4be2-a79d-fc6959b4bb65) |
…est lane ## Why Four independent hygiene fixes to local/CI gates. 1. **The pre-commit hook could reformat files into a shape CI rejects.** When a web directory had no `node_modules`, `scripts/pre-commit` fell back to a floating `npx prettier` — prettier 3 against the `^2.8.8` `web/frontend` pins and CI installs with `npm ci`. That rewrote `getPlatformLink` in `web/frontend/src/app/apps/[id]/page.tsx` into a CI-failing shape (#11304) and polluted four PRs in one day, plus unrelated `app/` Dart files reformatted by a locally-installed Dart SDK that differs from the repo's pinned Flutter. 2. **`web/frontend`'s test suite ran in no lane.** `package.json` has `"test": "node --test src/__tests__/*.test.mjs"` with real guards (`app-detail-not-found`, `case-status`, `shared-conversation-chat-contract`), but `.github/checks-manifest.yaml` never selected them — which is why a deleted frontend test's guards had to be re-homed into a backend pytest to keep running. 3. **`web/admin/AGENTS.md` was 137 bytes from red.** `agents-md-lean` going over budget takes `main` red and blocks every PR touching any `AGENTS.md` (#11409, fixed by #11410). 4. **The pre-push backend test cap had an unbounded escape hatch.** The root `AGENTS.md` push-gate budget says pre-push must "cap broad backend selection at 40 files", and `scripts/pre-push` does cap it — but when the selector overflows, the cap branch swaps in the diff's *own* changed backend test files and never re-applies the cap to that replacement. A diff changing more than 40 backend test files ran unbounded, while the message still printed `cap is 40`. #11018's 92-file diff stalled its push on this gate repeatedly; it had 15 changed backend test files so it stayed under the cap, but slow enough that several agents resorted to documented skip hatches — one size larger and there would have been no bound at all. ## What changed 1. `scripts/pre-commit` resolves the pinned toolchain and **refuses to format** rather than formatting with the wrong one: each web dir's `package.json` prettier major must match `node_modules/.bin/prettier`, and Dart requires the `flutter-version` pinned in `.github/workflows/repo-checks.yml`. Both fallbacks (`npx`, global `prettier`) are gone. Hatches: `OMI_SKIP_WEB_FORMAT=1`, `OMI_SKIP_DART_FORMAT=1`, both documented in the root `AGENTS.md` Formatting section. Web directories are now derived from the staged paths, so `web/admin` (previously skipped entirely) is covered. New regression test `scripts/test-pre-commit-pinned-toolchains.sh`, registered as manifest check `pre-commit-pinned-toolchains`. 2. New manifest check `web-frontend-tests` (`local` + `ci`, triggers `web/frontend/**`) running `node --test 'web/frontend/src/__tests__/**/*.test.mjs'` — the glob picks up test files added later. 3. `web/admin/AGENTS.md` networking and revenue-metrics detail moved verbatim into `web/admin/docs/data-contracts.md`, with the two top-level rules and a pointer left behind. **Budgets untouched.** 4. The `scripts/pre-push` fallback now **truncates deterministically to the cap**. The changed-test list is already `sort -u`ed, so `head -n cap` picks the same files on every push of the same diff rather than sampling a different subset. Truncation beats skipping here because the diff's own changed test files are the highest-signal local coverage available; the message now names the full changed-test count, what actually ran, and points at `cd backend && bash test.sh` for the remainder — it never prints a cap the run then exceeds. `PRE_PUSH_MAX_BACKEND_UNIT_TEST_FILES` stays the single knob. New regression test `scripts/test-pre-push-backend-test-cap.sh`, registered as manifest check `pre-push-backend-test-cap` (`local` + `ci`). Distinct lane from #11361, which narrows `flutter-codegen` selection in `scripts/pre_push_ci_prediction.py` — same class of problem, no overlapping files. ## Verification **Mutation test of the new guard** — with `scripts/pre-commit` reverted to `origin/main`, `scripts/test-pre-commit-pinned-toolchains.sh` fails and the output shows the exact hazard: ``` FAIL: missing pinned prettier — hook exited 0 instead of refusing Formatting staged web files with Prettier... npm warn exec The following package was not found and will be installed: [email protected] web/frontend/src/a.ts 34ms ``` With the fix applied: `pre-commit pinned-toolchain refusal tests passed` (refusal cases for missing prettier, prettier major mismatch, no flutter, flutter version mismatch; positive cases for the pinned versions; and both hatches). **Manifest selection** (`run_checks.py --list`): | Diff | `web-frontend-tests` | |---|---| | `web/frontend/src/app/apps/x.tsx` | SELECTED | | `web/frontend/src/__tests__/new-thing.test.mjs` | SELECTED | | `backend/main.py` | not selected | `run_checks.py --lane ci --check-id web-frontend-tests` → **47 tests pass, 0 fail**. **AGENTS.md headroom** after this PR (`python3 .github/scripts/check_agents_md_lean.py` → `ok: 7 AGENTS.md files within budget`): | File | Bytes | Headroom | |---|---|---| | `web/admin/AGENTS.md` | 457 / 1500 | **1043** | | `AGENTS.md` | 17082 / 18000 | 918 | | `.github/AGENTS.md` | 3825 / 4500 | 675 | | `app/AGENTS.md` | 10606 / 11500 | 894 | | `backend/AGENTS.md` | 38936 / 39000 | 64 | | `desktop/macos/AGENTS.md` | 45531 / 47000 | 1469 | | `omi/firmware/AGENTS.md` | 853 / 1500 | 647 | `backend/AGENTS.md` remains 64 bytes from the same failure and still needs its own PR. **Mutation test of the pre-push cap bound** — the regression test extracts the real `check_backend_unit_tests_if_needed` from the hook and runs it against a stubbed selector and backend, so it exercises production control flow rather than scraping source. With the bound reverted: ``` FAIL: fallback ran 25 backend test file(s), over the cap of 10 Selector requested broad selector fallout (500 files; running 25 changed backend test file(s) instead; cap is 10). Selected 25 backend unit test file(s): broad selector fallout ``` With the bound restored: `pre-push backend unit test cap tests passed` (over-cap truncation, stable + sorted truncation across repeated runs, the unchanged under-cap fallback message, and the unchanged empty-fallback skip). `make preflight` passes. ## Product invariants affected none ## Failure class (fixes) Failure-Class: none The pre-push cap fix is likewise `none`: no registered class covers "a bound's own fallback path must re-apply that bound", and one instance does not justify opening one. The nearest existing class, `FC-dev-fallback-masks-install-defect` (a development-only fallback must never be the reason a check passes), is scoped to packaged-app resource resolution on desktop; this is the same shape in a different subsystem but the registry transition belongs in its own PR. 🤖 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/11413?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="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are limited to git hooks, check manifest entries, and devDependency/docs wiring; no production runtime or auth paths are modified. > > **Overview** > Tightens local git hooks and CI manifest guards so formatting and pre-push selection cannot silently diverge from what CI enforces. > > **`scripts/pre-commit`** now **refuses** to auto-format when toolchains do not match repo pins: web Prettier (and `prettier-plugin-tailwindcss`) must match `package-lock.json` via local `node_modules`; Dart uses the Flutter version from `.github/workflows/repo-checks.yml` and that SDK’s `dart` binary. Floating `npx`/global Prettier fallbacks are removed. Web dirs are inferred from staged paths (so `web/admin` is included), `*.generated.ts` is skipped, and format-and-add is blocked when a file has unstaged edits. Escape hatches `OMI_SKIP_WEB_FORMAT=1` / `OMI_SKIP_DART_FORMAT=1` are documented in root **`AGENTS.md`**. > > **`scripts/pre-push`** re-applies **`PRE_PUSH_MAX_BACKEND_UNIT_TEST_FILES`** when the broad-selector fallback runs changed backend test files from the diff—deterministic sorted truncation and clearer logging instead of an unbounded run that still claimed a cap. > > **`.github/checks-manifest.yaml`** adds **`pre-commit-pinned-toolchains`**, **`pre-push-backend-test-cap`**, and **`web-frontend-tests`** (`scripts/run-web-frontend-tests.sh` → `node --test` on `web/frontend`). > > **`web/admin/AGENTS.md`** is trimmed for the lean budget; networking/revenue detail moves to **`web/admin/docs/data-contracts.md`**. **`web/admin`** and **`web/app`** pin Prettier ^2.8.8 (+ tailwind plugin) so the hook can format them safely. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 44dcc98. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This PR keeps routing-only changes from waking Flutter regeneration while preserving the other component lanes selected by the pre-push predictor. Flutter code generation remains owned by real generator inputs.
The selector change also exercises the existing Desktop Swift test lane. The knowledge-graph extraction result now crosses the async boundary through typed Sendable values, while the executor preserves the existing dictionary shape. The unrelated FluidAudio manifest edit was removed; its existing raw revision pin and Package.resolved remain unchanged.
Verification:
Product invariants affected
Failure-Class: none
Note
Medium Risk
Pre-push and GitHub output selection logic changes developer push behavior and must stay aligned with real generator inputs; regression risk is mitigated by expanded prediction tests, not by production runtime paths.
Overview
Routing-only diffs (for example
.github/checks-manifest.yamlorscripts/pre_push_ci_prediction.py) no longer selectflutter-codegen/flutter-l10nat pre-push, so contributors without a Flutter toolchain are not forced through ~17-minutebuild_runnerfor CI metadata edits.pre_push_ci_prediction.pyadds_defines_flutter_generationso mobile workflow and detect-changes action changes still wake both regeneration lanes, while real generator inputs (app/build.yaml, annotated Dart,.arbfiles) behave as before. Selector-only changes still conservatively wake other component lanes (includingapp-compile-smokeanddesktop-swift-tests) but explicitly exclude Flutter regeneration.Tests in
test_pre_push_ci_prediction.pylock this matrix; hatch-disclosure copy andscripts/pre-pushcomments are updated to match.desktop/macos/Desktop/Package.swiftonly drops a stale FluidAudio comment—the revision pin is unchanged.Reviewed by Cursor Bugbot for commit 9770118. Configure here.