Skip to content

fix(ci): keep routing-only push gates bounded - #11361

Merged
undivisible merged 8 commits into
BasedHardware:mainfrom
undivisible:fix/push-gate-traps
Aug 20, 2026
Merged

undivisible merged 8 commits into
BasedHardware:mainfrom
undivisible:fix/push-gate-traps

Conversation

@undivisible

@undivisible undivisible commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • python3 .github/scripts/test_pre_push_ci_prediction.py
  • python3 .github/scripts/test_desktop_manifest_routes.py
  • python3 .github/scripts/test_desktop_swift_ci_contract.py
  • python3 .github/scripts/test_swiftlint_config.py

Product invariants affected

  • INV-CHAT-1

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.yaml or scripts/pre_push_ci_prediction.py) no longer select flutter-codegen / flutter-l10n at pre-push, so contributors without a Flutter toolchain are not forced through ~17-minute build_runner for CI metadata edits.

pre_push_ci_prediction.py adds _defines_flutter_generation so mobile workflow and detect-changes action changes still wake both regeneration lanes, while real generator inputs (app/build.yaml, annotated Dart, .arb files) behave as before. Selector-only changes still conservatively wake other component lanes (including app-compile-smoke and desktop-swift-tests) but explicitly exclude Flutter regeneration.

Tests in test_pre_push_ci_prediction.py lock this matrix; hatch-disclosure copy and scripts/pre-push comments are updated to match. desktop/macos/Desktop/Package.swift only drops a stale FluidAudio comment—the revision pin is unchanged.

Reviewed by Cursor Bugbot for commit 9770118. Configure here.

@undivisible undivisible added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Aug 10, 2026
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/pre_push_ci_prediction.py Resolved
@undivisible undivisible changed the title fix: unblock two local push-gate traps (routing-only Flutter codegen, FluidAudio pin) fix(ci): keep routing-only push gates bounded Aug 10, 2026
@undivisible undivisible added human Human-authored pull request workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior desktop macOS dependency-review Touches dependencies or lockfiles; needs dependency review needs-maintainer-review Needs a human maintainer to sign off before merge labels Aug 10, 2026
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@Git-on-my-level Git-on-my-level removed desktop dependency-review Touches dependencies or lockfiles; needs dependency review labels Aug 10, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

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:

  • .github/scripts/test_pre_push_ci_prediction.py: the new regression coverage is useful: routing-only inputs now assert flutter-codegen, flutter-l10n, and has_flutter_generated stay false, while app/build.yaml, annotated Dart, and .arb inputs still wake the generator/l10n paths. The existing broad selector test also now expects app-compile-smoke, which matches the resolver change.
  • scripts/pre_push_ci_prediction.py: removing flutter-codegen/flutter-l10n from the selector_changed update is the right narrow boundary for routing metadata; real generator inputs still flow through _is_codegen_input / _is_app_l10n_input and keep the GitHub output contract intact.
  • desktop/macos/Desktop/Package.swift: this only removes the stale FluidAudio comment while preserving the same audited revision pin, so I don’t see an actual dependency-resolution behavior change here.
  • desktop/macos/Desktop/Sources/Services/KnowledgeGraphToolSupport.swift: moving the detached-task result into typed Sendable ClientGraph.Node / ClientGraph.Edge values avoids sending [[String: Any]] across the concurrency boundary, and the payload conversion keeps the existing tool dictionary keys (node_type, source_id, target_id) unchanged.
  • desktop/macos/Desktop/Sources/Providers/ChatToolExecutor.swift: executeSaveKnowledgeGraph now consumes nodesAsPayload / edgesAsPayload, so the save path still receives the same shape as before after a successful backend extraction; the explicit-nodes fallback remains intact.
  • desktop/macos/Desktop/Tests/KnowledgeGraphToolSupportTests.swift: the detached-task test covers the specific concurrency/data-preservation case and also checks the payload adapter, which is the right regression surface for the Swift change.

Validation I ran locally on the PR head:

  • python3 .github/scripts/test_pre_push_ci_prediction.py — 16 passed
  • python3 .github/scripts/test_desktop_manifest_routes.py — 4 passed
  • python3 .github/scripts/test_desktop_swift_ci_contract.py — 25 passed

One caveat: GitHub’s Dart Analyze & Tests is currently red on the analyzer ratchet (override_on_non_overriding_member: 5 found, baseline 0). I don’t see those Dart analyzer findings coming from the files touched here, but the check is still a required green-state concern before merge.

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 need human response.

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@Git-on-my-level

Copy link
Copy Markdown
Member

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:

  • .github/scripts/test_pre_push_ci_prediction.py: coverage now checks both sides of the routing boundary: routing-only inputs keep flutter-codegen, flutter-l10n, and has_flutter_generated off, real generator inputs still wake them, and .github/workflows/mobile-app-checks.yml explicitly wakes both generator/l10n lanes.
  • scripts/pre_push_ci_prediction.py: the resolver now removes Flutter generated-output lanes from broad selector edits while adding a targeted .github/workflows/mobile-app-checks.yml exception, so routing metadata changes stay bounded without losing regeneration for the mobile workflow itself.
  • desktop/macos/Desktop/Package.swift: the final diff only removes the stale FluidAudio comment; the raw audited revision pin remains unchanged, so I don’t see dependency resolution changing in this head.
  • desktop/macos/Desktop/Sources/Services/KnowledgeGraphToolSupport.swift: ClientGraph, Node, Edge, and ResolveOutcome are now Sendable, and the dictionary conversion is delayed to nodesAsPayload / edgesAsPayload; that avoids carrying [[String: Any]] across the async boundary while preserving the existing tool payload keys.
  • desktop/macos/Desktop/Sources/Providers/ChatToolExecutor.swift: the save path uses the new payload adapters after successful discovery extraction, while the explicit-nodes fallback path remains in place.
  • desktop/macos/Desktop/Tests/KnowledgeGraphToolSupportTests.swift: the new detached-task test covers the Sendable/data-preservation regression surface and verifies the payload adapter shape.

Validation I ran locally on the PR head:

  • python3 .github/scripts/test_pre_push_ci_prediction.py — 17 passed
  • python3 .github/scripts/test_desktop_manifest_routes.py — 4 passed
  • python3 .github/scripts/test_desktop_swift_ci_contract.py — 25 passed

Current CI caveat: Dart Analyze & Tests is still failing on the analyzer ratchet (override_on_non_overriding_member: 5 found, baseline 0), and Desktop Swift Build & Tests is failing because its required static/test verification result is cancelled. I don’t see those as production-code regressions in the touched files, so I’m not requesting changes, but merge readiness still needs green checks and maintainer sign-off for the workflow routing semantics.

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.

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/pre_push_ci_prediction.py Outdated
Comment on lines +308 to +309
if ".github/workflows/mobile-app-checks.yml" in normalized_paths:
selected.update({"flutter-codegen", "flutter-l10n"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@Git-on-my-level

Git-on-my-level commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

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:

  • .github/scripts/test_pre_push_ci_prediction.py: the expanded coverage now checks routing-only inputs (.github/checks-manifest.yaml, scripts/pre_push_ci_prediction.py) keep flutter-codegen, flutter-l10n, and has_flutter_generated off, while real generator inputs and .github/workflows/mobile-app-checks.yml still wake regeneration.
  • scripts/pre_push_ci_prediction.py: the selector fan-out deliberately keeps app/desktop component lanes (app-analysis-tests, app-compile-smoke, desktop-flow-lint, desktop-swift-tests) but stops treating routing metadata as generated-file staleness. The explicit mobile workflow exception preserves Flutter regeneration for the workflow that owns it.
  • desktop/macos/Desktop/Sources/Services/KnowledgeGraphToolSupport.swift: replacing [[String: Any]] transport state with typed Sendable ClientGraph.Node/Edge values is the right shape for crossing the async boundary; payload conversion remains centralized through nodesAsPayload / edgesAsPayload.
  • desktop/macos/Desktop/Sources/Providers/ChatToolExecutor.swift: the executor still receives the existing dictionary payload shape before save/dedup logic, so the compatibility path for explicit nodes after extraction failure is preserved.
  • desktop/macos/Desktop/Tests/KnowledgeGraphToolSupportTests.swift: the new detached-task test exercises the Sendable transfer and verifies the output dictionary keys (node_type, target_id) stay compatible.
  • desktop/macos/Desktop/Package.swift: the final diff only removes the stale FluidAudio comment; it keeps the pinned revision unchanged, so I don’t see a dependency-resolution behavior change in the final tree.
  • app/analysis_baseline.json: the analyzer baseline ratchet is small and consistent with the passing Dart Analyze & Tests check; it records the new override_on_non_overriding_member bucket and reduces prefer_final_fields by one.

Validation I ran locally on the checked-out head:

  • python3 .github/scripts/test_pre_push_ci_prediction.py — 17 tests passed
  • python3 .github/scripts/test_desktop_manifest_routes.py — 4 tests passed
  • python3 .github/scripts/test_desktop_swift_ci_contract.py — 25 tests passed
  • python3 .github/scripts/test_swiftlint_config.py — 14 tests passed

CI note: Desktop Swift Static & Test Contracts failed because EffectiveOwnerDatabaseBoundaryTests timed out after 300s in the desktop Swift suite, and Desktop Swift Build & Tests then failed from the propagated VERIFY_RESULT=failure. That looks like a desktop Swift suite/runner failure rather than a demonstrated regression in these specific production changes, so I’m not requesting changes from this review; it still needs a green rerun or maintainer sign-off before merge.

Keeping workflow-review / needs-maintainer-review for the CI-routing behavior change and failing required checks.


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.

@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution docs-tooling Layer: Documentation, examples, dev tools and removed macOS labels Aug 11, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

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:

  • .github/scripts/test_pre_push_ci_prediction.py: the new tests cover both sides of the boundary: routing-only files such as .github/checks-manifest.yaml and scripts/pre_push_ci_prediction.py keep flutter-codegen, flutter-l10n, and has_flutter_generated off, while mobile-app-checks.yml, .github/actions/detect-changes/action.yml, app/build.yaml, annotated Dart, and l10n ARB inputs still wake the generation lanes. The selector fixture also now includes app-compile-smoke, matching the resolver’s broader non-generation fan-out.
  • scripts/pre_push_ci_prediction.py: _defines_flutter_generation() cleanly separates files that define/forward Flutter generation from generic routing metadata. The selector path still wakes app analysis, app compile smoke, desktop flow lint, desktop Swift tests, and release compile, but no longer treats every routing edit as generated-artifact staleness.
  • app/analysis_baseline.json: the analyzer ratchet update is narrow: it records the current override_on_non_overriding_member count and lowers prefer_final_fields by one. This matches the now-green Dart analyze/test check.
  • desktop/macos/Desktop/Package.swift: the final diff only removes the stale FluidAudio explanatory comment; the pinned revision itself remains unchanged, so I do not see dependency-resolution behavior changing here.

Validation I ran on the checked-out head:

  • python3 .github/scripts/test_pre_push_ci_prediction.py — 19 tests passed
  • python3 .github/scripts/test_desktop_manifest_routes.py — 4 tests passed
  • python3 .github/scripts/test_desktop_swift_ci_contract.py — 25 tests passed
  • python3 .github/scripts/test_swiftlint_config.py — 14 tests passed
  • Spot-checked resolve_impact() outputs: routing-only files keep Flutter generation outputs false, while mobile workflow/action and real generator inputs still enable them.

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 need human response.

undivisible and others added 4 commits August 12, 2026 23:07
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.
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/pre_push_ci_prediction.py Resolved

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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).
  2. 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 aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.
  2. 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
@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@undivisible
undivisible merged commit db64c47 into BasedHardware:main Aug 20, 2026
35 of 37 checks passed
undivisible added a commit that referenced this pull request Aug 26, 2026
…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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-tooling Layer: Documentation, examples, dev tools human Human-authored pull request needs-maintainer-review Needs a human maintainer to sign off before merge no-changelog-needed Skip desktop changelog enforcement for internal-only changes positive-signal Automation verified a genuine fix/quality contribution workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants