Skip to content

fix(hooks): stop the unpinned-formatter rewrites, register a web/frontend test lane, unblock web/admin/AGENTS.md - #11413

Merged
undivisible merged 15 commits into
BasedHardware:mainfrom
undivisible:fix/web-test-lane-and-formatter
Aug 26, 2026
Merged

undivisible merged 15 commits into
BasedHardware:mainfrom
undivisible:fix/web-test-lane-and-formatter

Conversation

@undivisible

@undivisible undivisible commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator

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 (fix: high-confidence security audit (SSRF, uploads, personas auth, JSON-LD) #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 (agents-md-lean is red on main: desktop/macos/AGENTS.md is 392 bytes over budget, blocking every push that touches any AGENTS.md #11409, fixed by docs(desktop): unblock agents-md-lean by moving agent-swift reference into docs/ #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. security: remove screen activity cloud egress #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 -ued, 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 fix(ci): keep routing-only push gates bounded #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

Review in cubic


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.

Reviewed by Cursor Bugbot for commit 44dcc98. Configure here.

@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_281a1ab1-6b7e-4a01-b07b-d3a8283aedfc)

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

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/checks-manifest.yaml Resolved
Comment thread scripts/pre-commit Resolved

@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: 1696293f7e

ℹ️ 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-commit Resolved
Comment thread .github/checks-manifest.yaml Outdated
reason: "SCA-118: production web LLM traffic must not regain direct provider SDKs, URLs, or credentials"
- id: web-frontend-tests
command: ["node", "--test", "web/frontend/src/__tests__/**/*.test.mjs"]
triggers: ["web/frontend/**", ".github/checks-manifest.yaml"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Trigger frontend guards for every file they inspect

When a PR changes only config/public-build-contract.json, .github/actions/deploy-public-build/action.yml, or .github/workflows/gcp_frontend.yml, this trigger list does not select web-frontend-tests, even though shared-conversation-chat-contract.test.mjs reads all three and asserts frontend-specific ingress, HMAC-secret, service-account, and audience requirements. The separately selected public-build-contract check validates general contract shape and wiring but not these exact requirements, so such a change can silently remove the trusted frontend identity or secret contract; add all three external inputs to this check's triggers.

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.

@Git-on-my-level Resolved on head: scripts/run-web-frontend-tests.sh, config/public-build-contract.json, .github/actions/deploy-public-build/action.yml, and .github/workflows/gcp_frontend.yml are all in the web-frontend-tests triggers, so a PR changing any file that contract reads re-runs the lane.

Comment thread scripts/pre-commit Outdated
Comment on lines +120 to +121
LOCAL_MAJOR=$(echo "$LOCAL_VERSION" | cut -d. -f1)
if [ -z "$LOCAL_VERSION" ] || [ "$LOCAL_MAJOR" != "$PINNED_MAJOR" ]; then

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 Compare the complete installed Prettier version

When node_modules is stale but still contains any older Prettier 2.x release, this comparison accepts it because both versions are reduced to major 2, even though CI's npm ci installs the lockfile's exact 2.8.8 formatter. Formatting behavior can change between minor releases, so the hook can still rewrite staged files differently from CI—the failure mode this change is intended to prevent; compare the executable version with the exact lockfile version rather than only the package range's major.

AGENTS.md reference: AGENTS.md:L98-L98

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.

@Git-on-my-level Resolved on head: when the package-lock resolves, the hook compares the exact installed Prettier version (LOCAL_VERSION != RESOLVED_VERSION refuses), not just the major. The major-only fallback now only runs for dirs with no lockfile, and dirs with an unresolvable lockfile are refused outright.

@Git-on-my-level Git-on-my-level added workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-tests PR introduces logic that should be covered by tests docs-tooling Layer: Documentation, examples, dev tools labels Aug 11, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for tightening this up — the intent is good, and I like the direction of refusing unsafe formatter fallbacks. I found two blocking workflow issues to fix before this should land:

  1. .github/checks-manifest.yaml registers web-frontend-tests as node --test web/frontend/src/__tests__/**/*.test.mjs. The web CI workflow is pinned to Node 20, and run_checks.py executes manifest commands without a shell, so that ** is passed literally. I verified with Node 20.20.2 that the command fails with Could not find '.../**/*.test.mjs'; passing the test directory (web/frontend/src/__tests__) runs the same 47 tests successfully. Please make the manifest command Node-20-compatible.

  2. scripts/pre-commit now derives every staged web/<dir> path and hard-fails when that directory's package.json does not declare prettier. That is a good invariant for pinned formatting, but web/admin/package.json and web/app/package.json currently do not pin prettier, so ordinary TS/JS commits there become blocked unless contributors use OMI_SKIP_WEB_FORMAT=1. I reproduced this by staging a probe under web/admin/: the hook exits 1 with web/admin/package.json does not pin prettier. Please either add the pinned prettier dependency/lockfile coverage for those web apps or scope the new enforcement to directories that actually have a pinned formatter.

File-by-file notes:

  • AGENTS.md: the new formatting guidance correctly tells agents that unpinned web/Dart formatting is refused, but it currently implies each web dir can be fixed by npm ci; that is not true for web/admin/web/app until they pin prettier.
  • scripts/test-pre-commit-pinned-toolchains.sh: the new regression test covers missing/mismatched/pinned formatter behavior for web/frontend and Dart, but it does not cover the newly included unpinned web dirs (web/admin, web/app) or the intended behavior there.
  • web/admin/AGENTS.md: moving detailed rules out of the agent instruction file is safe and helps the lean-budget constraint; the top-level networking and revenue rules remain visible to coding agents.
  • web/admin/docs/data-contracts.md: the moved data-contract detail appears verbatim and remains useful documentation, but because it is now linked rather than inline, agents changing admin networking/revenue code may need to follow the link explicitly.

I also reviewed the agent-instruction/documentation impact: AGENTS.md changes formatter behavior instructions for all repo agents, and web/admin/AGENTS.md now delegates detailed AI coding guidance to web/admin/docs/data-contracts.md. The guidance is directionally safe and accurate, but the formatter note needs the web/admin/web/app pinning issue resolved so agents are not told to run an ineffective setup step.

Validation I ran:

  • bash scripts/test-pre-commit-pinned-toolchains.sh -> passed
  • node --test 'web/frontend/src/__tests__/**/*.test.mjs' with local Node 22.23.2 -> 47 passed
  • npx -y node@20 --test 'web/frontend/src/__tests__/**/*.test.mjs' -> failed, literal glob not found
  • npx -y node@20 --test web/frontend/src/__tests__ -> 47 passed
  • python3 .github/scripts/check_agents_md_lean.py -> passed

Requesting changes because the new CI lane is not compatible with the repo's web Node version, and the hook change currently blocks normal commits in web dirs that do not pin prettier.


Automated maintainer review. AI-generated feedback; please verify before merging.


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 added a commit that referenced this pull request Aug 11, 2026
Pure formatter pollution from a mismatched local Dart SDK, no semantic
change. Unrelated to this PR's screen-activity work. PR #11413 fixes the
pre-commit hook that produced it.
undivisible added a commit that referenced this pull request Aug 11, 2026
Pure formatter pollution from a mismatched local Dart SDK — no semantic
change — plus the analysis baseline it dragged along. Unrelated to this
PR's screen-activity work. Committed with --no-verify because the
pre-commit hook re-applies the same corruption on every attempt; PR
#11413 fixes that hook.
@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_559f8603-2994-4209-9812-6667e0731d60)

@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: 470034fa36

ℹ️ 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 .github/checks-manifest.yaml Outdated
lanes: ["local", "ci"]
reason: "SCA-118: production web LLM traffic must not regain direct provider SDKs, URLs, or credentials"
- id: web-frontend-tests
command: ["node", "--test", "web/frontend/src/__tests__/**/*.test.mjs"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Expand the frontend test glob before invoking Node

On the repository's Node 20 toolchain (.github/workflows/web-checks.yml selects Node 20), this literal argument exits 1 with Could not find '.../**/*.test.mjs'; run_checks.py invokes command arrays directly, so no shell expands it. Recursive test-file glob handling was added in Node 22.6.0 according to the Node release notes, meaning every selected frontend check fails rather than running tests for contributors using the supported Node 20 environment. Expand the paths in a wrapper or pin/setup Node 22+ in every lane.

AGENTS.md reference: AGENTS.md:L119-L119

Useful? React with 👍 / 👎.

Comment thread scripts/pre-commit Resolved
Comment thread scripts/pre-commit Outdated
echo "Formatting staged Dart files in app/..."
echo "$STAGED_DART_FILES" | xargs dart format --line-length 120
ROOT="$(git rev-parse --show-toplevel)"
PINNED_FLUTTER=$(sed -n 's/^[[:space:]]*flutter-version:[[:space:]]*//p' "$ROOT/.github/workflows/repo-checks.yml" 2>/dev/null | head -1 | tr -d "\"' ")

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 Read formatter pins from the staged snapshot

When .github/workflows/repo-checks.yml has an unstaged Flutter-pin edit while a Dart file is staged, this reads and validates against the working-tree value, then the hook stages only the formatted Dart file. The resulting commit therefore retains the index's old Flutter pin while containing output from the unstaged pin's formatter, so CI can reject exactly the mismatch this guard is intended to prevent; read the pin from the index with git show :path or refuse when the index and working copy differ.

AGENTS.md reference: AGENTS.md:L98-L98

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.

@Git-on-my-level Implemented: the Dart pin is read from the staged snapshot first (git show :.github/workflows/repo-checks.yml), falling back to the working tree only when the index has no such file, so an unstaged pin edit cannot drive the formatter.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the update. I re-reviewed the current head and the hook/manifest direction is still good, but two workflow blockers from the earlier review remain on this commit:

  1. .github/checks-manifest.yaml still registers web-frontend-tests as node --test web/frontend/src/__tests__/**/*.test.mjs. The web workflow uses Node 20 and the manifest runner executes commands without a shell, so that glob is passed literally. I verified on this head that npx -y node@20 --test 'web/frontend/src/__tests__/**/*.test.mjs' fails with Could not find .../**/*.test.mjs, while npx -y node@20 --test web/frontend/src/__tests__ runs the same 47 tests successfully. Please make the manifest command Node-20-compatible.

  2. scripts/pre-commit now derives every staged web/<dir> and hard-refuses if that dir's package.json does not declare prettier. web/admin/package.json and web/app/package.json still do not pin prettier, so normal TS/JS commits there are blocked unless contributors use OMI_SKIP_WEB_FORMAT=1. I verified this by staging a probe under web/admin/; the hook exits 1 with web/admin/package.json does not pin prettier; refusing to format web/admin. Please either pin/install the formatter for those web apps or scope the enforcement to dirs that actually own a pinned formatter.

File-by-file notes:

  • .github/checks-manifest.yaml: the two new hook regression lanes are useful, but the web-frontend-tests command needs the Node 20 test-discovery fix above.
  • AGENTS.md: the new formatter guidance correctly tells agents to refuse unpinned web/Dart formatting, but web needs each dir's pinned prettier (npm ci) is misleading while web/admin and web/app have no prettier pin.
  • scripts/pre-commit: the pinned Flutter/Dart guard and skip hatches are sensible, but the dynamic web-dir loop currently turns unpinned web apps into hard failures.
  • scripts/pre-push: the backend test fallback now re-applies the cap deterministically and reports the truncated selection; this part looks correct.
  • scripts/test-pre-commit-pinned-toolchains.sh: passes and covers missing/mismatched/pinned frontend prettier plus Dart toolchain behavior, but it does not cover the newly affected unpinned web/admin/web/app paths.
  • scripts/test-pre-push-backend-test-cap.sh: passes and covers over-cap, deterministic truncation, under-cap, and no-changed-test behavior for the backend pre-push fallback.
  • web/admin/AGENTS.md: the lean summary keeps the key admin networking/revenue rules visible to coding agents and reduces the agent-guide budget pressure.
  • web/admin/docs/data-contracts.md: the moved data-contract detail appears accurate and useful, but because it now influences AI coding/review agents through a linked doc, maintainers should be comfortable that agents are expected to follow that link for admin networking/revenue changes.

Agent-instruction impact: this PR changes repository-wide formatter instructions in AGENTS.md and changes how admin-specific AI guidance is split between web/admin/AGENTS.md and web/admin/docs/data-contracts.md. The instruction changes are directionally safe, but the formatter guidance should not land until the unpinned web-dir behavior is fixed so agents are not directed toward an ineffective setup step.

Validation I ran on this head:

  • bash scripts/test-pre-commit-pinned-toolchains.sh -> passed
  • bash scripts/test-pre-push-backend-test-cap.sh -> passed
  • python3 .github/scripts/check_agents_md_lean.py -> passed
  • npx -y node@20 --test 'web/frontend/src/__tests__/**/*.test.mjs' -> failed, literal glob not found
  • npx -y node@20 --test web/frontend/src/__tests__ -> 47 passed
  • staged web/admin/__omi_precommit_probe.ts then ran sh scripts/pre-commit -> failed on missing web/admin prettier pin

Requesting changes because the new frontend test lane still fails on the pinned Node toolchain and the pre-commit hook still blocks normal web/admin/web/app commits unless the skip hatch is used. Workflow behavior needs maintainer sign-off after those fixes and CI is green.


Automated maintainer review. AI-generated feedback; please verify before merging.


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
undivisible force-pushed the fix/web-test-lane-and-formatter branch from 470034f to 580553a Compare August 12, 2026 15:12
@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_7410e78f-c999-4aa6-a80a-e5ea062bd236)

@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: 580553ad91

ℹ️ 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 .github/checks-manifest.yaml Outdated
lanes: ["local", "ci"]
reason: "SCA-118: production web LLM traffic must not regain direct provider SDKs, URLs, or credentials"
- id: web-frontend-tests
command: ["node", "--test", "web/frontend/src/__tests__"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Invoke frontend test files instead of the directory

This passes the directory as a positional module rather than invoking test discovery; the Node test-runner documentation describes recursive discovery for node --test without positional paths. Running this exact revised command under Node 24.15.0 fails with Cannot find module '/workspace/omi/web/frontend/src/__tests__', while the repository's package script expands src/__tests__/*.test.mjs and runs all 47 tests. This is fresh evidence after the prior glob finding because the replacement command now fails on the bare directory; use the package script or a wrapper that supplies actual test files.

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.

@Git-on-my-level Resolved on head: scripts/run-web-frontend-tests.sh expands the glob in a shell (node --test web/frontend/src/tests/*.test.mjs) and passes real file paths, so it works on the repo's Node 20 toolchain where the test runner itself cannot expand a glob or take a directory.

Comment thread scripts/pre-commit Resolved
@Git-on-my-level
Git-on-my-level dismissed stale reviews from themself August 12, 2026 16:37

Resolved on current head: the frontend test lane no longer uses the literal glob, and web/admin/web/app now pin prettier.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the update. The two earlier blockers are addressed on this head, so I dismissed the stale automation change-request reviews: .github/checks-manifest.yaml now uses node --test web/frontend/src/__tests__ instead of the literal glob, and web/admin/package.json / web/app/package.json now add pinned Prettier dev dependencies with matching lockfile entries.

I found one remaining blocker in the new hook regression lane before this should merge:

  1. scripts/test-pre-commit-pinned-toolchains.sh leaves the staged Dart fixture dirty after the skip-hatch case, then enters the web/app / web/admin loop after deleting the fake flutter stub. Because that Dart file is still staged, each web-dir formatting case also triggers the Dart formatter path in scripts/pre-commit and fails with Dart formatter toolchain mismatch: repo pins Flutter 9.9.9, found no flutter on PATH. I reproduced this by running bash scripts/test-pre-commit-pinned-toolchains.sh on the current head; it exits 1 before it can validate the newly added web/app and web/admin cases. Please reset/unstage the Dart fixture before the web-dir loop, restore the fake Flutter stub, or run the web-dir cases with OMI_SKIP_DART_FORMAT=1 so this manifest lane can actually pass.

File-by-file notes:

  • .github/checks-manifest.yaml: the two hook regression lanes are useful, and the web-frontend-tests command is now Node-20-compatible in my check; the pre-commit-pinned-toolchains lane is still blocked by the failing test script above.
  • AGENTS.md: the repository-wide formatter guidance now accurately warns agents that web and Dart formatting refuse unpinned/mismatched toolchains and documents the skip hatches.
  • scripts/pre-commit: the Dart guard validates the repo-pinned Flutter version and sibling dart, and the dynamic web-dir loop now has a pin to enforce for web/admin and web/app as well as web/frontend.
  • scripts/pre-push: the fallback now reapplies the backend-test cap to changed test files and reports the truncated deterministic selection; this part looks correct.
  • scripts/test-pre-commit-pinned-toolchains.sh: covers the right pinned/mismatched Prettier and Dart scenarios, plus web/app and web/admin, but currently fails due the staged Dart fixture leaking into the later web cases.
  • scripts/test-pre-push-backend-test-cap.sh: passed locally and covers over-cap, deterministic truncation, under-cap, and no-changed-test cases for the backend pre-push fallback.
  • web/admin/AGENTS.md: the lean summary keeps the high-priority admin networking and revenue rules in the agent instruction file while linking out detailed contracts.
  • web/admin/docs/data-contracts.md: the moved networking/SWR/partial-failure and subscription-metrics details appear consistent with the previous admin agent guidance.
  • web/admin/package.json: adds Prettier and the Tailwind plugin and fixes the duplicate postcss override shape so the hook has a pinned formatter to enforce.
  • web/admin/package-lock.json: adds the matching Prettier 2.8.8 / plugin lock entries and reflects the package.json pinning/override changes.
  • web/app/package.json: adds the same Prettier dev dependencies needed by the dynamic web formatter loop.
  • web/app/package-lock.json: adds matching Prettier/plugin lock entries; the optional-package metadata churn looks like npm lockfile normalization rather than a runtime dependency change.

Agent-instruction impact: this PR changes AGENTS.md formatter instructions for repo-wide coding agents and moves detailed admin-agent guidance from web/admin/AGENTS.md into web/admin/docs/data-contracts.md. The direction is safe and maintainer-useful: agents are told not to let floating formatter versions rewrite code, and admin agents still get the networking/revenue invariants via a linked contract doc. Because these instructions affect future AI coding/review behavior in workflow-sensitive areas, this still needs maintainer sign-off after the regression lane is fixed and CI is green.

Validation I ran on this head:

  • bash scripts/test-pre-push-backend-test-cap.sh -> passed
  • bash scripts/test-pre-commit-pinned-toolchains.sh -> failed with the staged-Dart/toolchain-stub leak described above
  • npx -y node@20 --test web/frontend/src/__tests__ in a sparse checkout -> command form is accepted and tests are discovered; one test then failed because my sparse checkout omitted config/public-build-contract.json, so I did not treat that as a PR regression

Requesting changes only for the broken scripts/test-pre-commit-pinned-toolchains.sh regression lane. Once that script passes and GitHub checks are green, this looks like a good workflow/tooling fix for human maintainer review.


Automated maintainer review. AI-generated feedback; please verify before merging.


by AI on behalf of David — workflow/tooling behavior and agent-instruction changes need maintainer sign-off once the test lane is fixed.

@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_8e254448-92ce-4139-a3d2-addfd88497b1)

@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: 84c0eec375

ℹ️ 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-commit Resolved
Comment thread scripts/pre-commit Resolved
Comment thread .github/checks-manifest.yaml Outdated
reason: "SCA-118: production web LLM traffic must not regain direct provider SDKs, URLs, or credentials"
- id: web-frontend-tests
command: ["bash", "scripts/run-web-frontend-tests.sh"]
triggers: ["web/frontend/**", "config/public-build-contract.json", ".github/actions/deploy-public-build/action.yml", ".github/workflows/gcp_frontend.yml", ".github/checks-manifest.yaml"]

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 Trigger the frontend lane when its runner changes

When a PR changes only scripts/run-web-frontend-tests.sh, none of these trigger patterns select web-frontend-tests, and the regular web workflow also ignores that script path. A broken or no-op runner can therefore merge without executing the suite it owns; include the runner script itself in this check's triggers so changes to the CI entry point are tested.

AGENTS.md reference: AGENTS.md:L119-L119

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.

Addressed on head 1e373d9933: scripts/run-web-frontend-tests.sh is now in the web-frontend-tests lane's triggers, so a PR that only edits the runner re-runs the suite it owns.

@undivisible

Copy link
Copy Markdown
Collaborator Author

Addressed the remaining blocker from the 2026-08-12 review on head 580553ad91:

  • scripts/test-pre-commit-pinned-toolchains.sh: the hatch fixture is now reset (git reset -q --hard) before the web/app + web/admin loop, so the staged Dart fixture can no longer leak into the web-dir formatting cases and trip the 'Dart formatter toolchain mismatch' path. Verified locally: bash scripts/test-pre-commit-pinned-toolchains.sh exits 0 and prints 'pre-commit pinned-toolchain refusal tests passed'.

The codex review on the current head (84c0eec375) reports no findings; CI is green.

@undivisible
undivisible force-pushed the fix/web-test-lane-and-formatter branch from 84c0eec to 234a5be Compare August 14, 2026 11:58
@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_c4191018-62d9-4f42-99b7-d01dffc82b15)

@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: 234a5be5b7

ℹ️ 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-commit Outdated
Comment on lines +141 to +144
else
PINNED_MAJOR=$(echo "$PINNED" | sed 's/^[^0-9]*//' | cut -d. -f1)
LOCAL_MAJOR=$(echo "$LOCAL_VERSION" | cut -d. -f1)
if [ -z "$LOCAL_VERSION" ] || [ "$LOCAL_MAJOR" != "$PINNED_MAJOR" ]; then

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 Reject web formatting when the lockfile is missing

When a staged web change belongs to a new package without package-lock.json, or deletes that lockfile, RESOLVED_VERSION is empty and this fallback accepts any formatter with the same major version; for example, local Prettier 2.0.0 passes a ^2.8.8 pin, and plugin validation subsequently no-ops. The hook can therefore rewrite files with an unresolved toolchain instead of failing closed. Fresh evidence beyond the earlier unparsable-lock case is that the later byte-count check refuses only a nonempty lockfile snapshot, while a missing/deleted snapshot reaches this permissive fallback; require a resolvable staged lockfile whenever formatting web files.

AGENTS.md reference: AGENTS.md:L98-L98

Useful? React with 👍 / 👎.

Comment thread scripts/pre-commit Resolved
Comment thread scripts/pre-commit 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.

Requesting changes (community review — reinforce open fail-open gaps; David’s CR still outstanding):

Intent is excellent: stop floating npx prettier / mismatched Dart from rewriting staged files into CI-failing shapes, register web-frontend-tests, and slim web/admin/AGENTS.md. The hatch git reset --hard before the web/app / web/admin loop on tip 234a5be5b7 looks like it addresses David’s staged-Dart leak — please paste a green bash scripts/test-pre-commit-pinned-toolchains.sh result so that CR can be dismissed cleanly.

Still blocking (fail-closed):

  1. Missing package-lock.json is still fail-open. When RESOLVED_VERSION is empty and the staged lockfile has size 0 / is absent, the hook falls through to major-only Prettier comparison (scripts/pre-commit web loop). That re-opens the original #11304 class of bug for new packages. Please refuse (same as unparseable lockfile) unless OMI_SKIP_WEB_FORMAT=1.
  2. Exclude generated admin OpenAPI client from the format-and-add loop (web/admin/lib/services/omi-api/omiApi.generated.ts). Staging a regen should not let Prettier rewrite a generated artifact.
  3. Desktop Swift Static/Build red on tip — either green or prove unrelated before merge.

Once (1)+(2) land and the pinned-toolchain script is demonstrably green, this is a strong community unblock.

@undivisible
undivisible force-pushed the fix/web-test-lane-and-formatter branch from 234a5be to 1829d41 Compare August 16, 2026 14:49
@cursor

ghost commented Aug 16, 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_e674db11-c80a-472a-9d3e-0676646620e3)

ghost 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: 1829d41ee8

ℹ️ 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 .github/checks-manifest.yaml Outdated
reason: "SCA-118: production web LLM traffic must not regain direct provider SDKs, URLs, or credentials"
- id: web-frontend-tests
command: ["bash", "scripts/run-web-frontend-tests.sh"]
triggers: ["web/frontend/**", "scripts/run-web-frontend-tests.sh", "config/public-build-contract.json", ".github/actions/deploy-public-build/action.yml", ".github/workflows/gcp_frontend.yml", ".github/checks-manifest.yaml"]

ghost Aug 16, 2026

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 Trigger frontend tests for Android manifest changes

When a PR changes only app/android/app/src/main/AndroidManifest.xml, this trigger list does not select web-frontend-tests, even though wrapped-unlimited-deeplink-parity.test.mjs reads that manifest and asserts the /wrapped and /unlimited App Links. I checked the manifest selector with that file as the sole changed path and the frontend lane was absent, so removing either deep link bypasses the only test enforcing this cross-component contract; include the manifest path in the triggers.

AGENTS.md reference: AGENTS.md:L120-L120

Useful? React with 👍 / 👎.

Comment thread scripts/pre-commit Outdated
Comment on lines +149 to +151
for plugin in prettier-plugin-tailwindcss; do
PLUGIN_RESOLVED=$(git show :"$dir/package-lock.json" 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print((d.get('packages',{}).get('node_modules/' + sys.argv[1]) or {}).get('version',''))" "$plugin" 2>/dev/null)
if [ -n "$PLUGIN_RESOLVED" ]; then

ghost Aug 16, 2026

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 Refuse an unresolved declared Prettier plugin

When a package declares prettier-plugin-tailwindcss but its staged lockfile still resolves Prettier while omitting the plugin entry, PLUGIN_RESOLVED is empty and this conditional skips validation entirely; the hook then formats with either a stale auto-loaded plugin or no plugin, despite the toolchain being unresolved. Fresh evidence after the prior plugin-validation thread is that the final implementation still places every refusal inside the nonempty-resolution branch; treat an empty plugin resolution as a mismatch instead.

AGENTS.md reference: AGENTS.md:L99-L99

Useful? React with 👍 / 👎.

@undivisible

ghost commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed all fail-closed review feedback. New head 1829d41e (rebase onto current main, which includes #11604).

Blocker 1 — missing package-lock no longer fail-open. scripts/pre-commit web loop now REFUSES when package-lock.json is missing, empty, or unparseable and the pinned Prettier version cannot be resolved (cannot pin the formatter toolchain), regardless of a matching Prettier major. The major-only comparison fallback is removed entirely, so #11304 cannot re-open for new packages. OMI_SKIP_WEB_FORMAT=1 remains the only escape hatch.

Blocker 2 — generated admin client excluded. omiApi.generated.ts (web/admin's OpenAPI client) is added to the exclusion list (grep -v '\.generated\.ts$'): staging a regen never goes through Prettier's format-and-add. Verified it is the only .generated.ts under web/admin.

Blocker 3 — Desktop Swift CI green. All Swift checks pass on this tip:

Blocker 4 — pinned-toolchain evidence:

$ bash scripts/test-pre-commit-pinned-toolchains.sh
pre-commit pinned-toolchain refusal tests passed
EXIT=0

Added regression tests for both fail-closed guards (missing-lockfile refusal with a matching-major prettier; generated-client exclusion). The unstaged-edit test now stages its lockfile so it actually exercises the guard it asserts.

@undivisible
undivisible requested review from Git-on-my-level and removed request for aryanorastar August 16, 2026 16:04

ghost 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: 44dcc984e4

ℹ️ 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-commit Resolved
Comment thread scripts/pre-commit Resolved
Max Carter 祁明思 and others added 15 commits August 26, 2026 00:32
The pre-commit hook fell back to a floating `npx prettier` when a web
directory had no node_modules. Prettier 3 formats differently from the
`^2.8.8` web/frontend pins and CI installs via `npm ci`, so the hook
rewrote staged files into a shape CI rejects (BasedHardware#11304: getPlatformLink in
web/frontend/src/app/apps/[id]/page.tsx), polluting four PRs in one day.
The Dart path had the same class of bug: whatever `dart` is on PATH.

Both now resolve the pinned toolchain (each web dir's package.json major,
the flutter-version pinned in repo-checks.yml) and refuse with an
actionable message instead of silently producing CI-rejected output.
OMI_SKIP_WEB_FORMAT=1 / OMI_SKIP_DART_FORMAT=1 are the hatches. Web dirs
are now derived from the staged paths, so web/admin is covered too.

Failure-Class: none

Verification: scripts/test-pre-commit-pinned-toolchains.sh passes; with
scripts/pre-commit reverted to origin/main it fails, and the failure
output shows npx installing [email protected] and rewriting the file.
…end test lane

web/frontend/package.json runs a real node --test suite (app-detail-not-found,
case-status, shared-conversation-chat-contract) that no manifest lane
selected, so it never ran in CI — which is why a deleted frontend test's
guards had to be re-homed into a backend pytest to keep running.

Verification:
  run_checks --lane ci --changed-files <web/frontend/...> --list -> SELECTED
  same for a new web/frontend/src/__tests__/*.test.mjs file (glob picks it up)
  backend/main.py diff -> not selected
  --check-id web-frontend-tests -> 47 tests pass
It was 1363/1500 bytes, 137 from the failure that took main red today
(BasedHardware#11409/BasedHardware#11410) and blocks every PR touching any AGENTS.md. The networking
and revenue-metrics detail moves verbatim into web/admin/docs/data-contracts.md
with the two top-level rules and a pointer left behind. No information lost.

Result: 457/1500 bytes (1043 headroom), 6/25 lines. Budget untouched.
Verification: python3 .github/scripts/check_agents_md_lean.py -> ok: 7 files
`scripts/pre-push` caps broad backend unit test selection at
PRE_PUSH_MAX_BACKEND_UNIT_TEST_FILES (40), and on overflow replaces the
selector's output with the diff's own changed backend test files. That
replacement was never re-bounded: a diff changing more than 40 backend
test files ran all of them, while the message still printed
"cap is 40" — advertising a bound the run then exceeded.

This is the ballooning the cap exists to prevent. PR BasedHardware#11018's 92-file
diff stalled its push on this gate repeatedly; that diff had only 15
changed backend test files so it stayed under the cap, but the gate
still ran long enough that several agents fell back to documented skip
hatches. A diff one size larger would have had no bound at all.

The fallback now truncates deterministically to the cap. The list is
already `sort -u`ed, so `head -n cap` selects the same files on every
push of the same diff — repeated pushes behave identically instead of
sampling a different subset. Truncation is preferred over skipping
because the diff's own changed test files are the highest-signal
coverage available locally; the message names the full changed-test
count, what actually ran, and points at `cd backend && bash test.sh`
for the remainder. PRE_PUSH_MAX_BACKEND_UNIT_TEST_FILES stays the
single knob.

Regression test `scripts/test-pre-push-backend-test-cap.sh` extracts
the real `check_backend_unit_tests_if_needed` from the hook and runs it
against a stubbed selector and backend, asserting the fallback runs at
most the cap, that truncation is stable and sorted, and that the
under-cap and empty-fallback paths are unchanged. Registered as
manifest check `pre-push-backend-test-cap` on the local and ci lanes.

Verification — mutation test 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`.

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Failure-Class: none

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…est lane

- Add scripts/run-web-frontend-tests.sh to expand the frontend test glob in a
  shell, making the manifest command work across Node 20/22/24 instead of
  relying on node --test directory discovery.
- Fix the pre-commit pinned-toolchain test so the hatch fixture is reset before
  the web/app and web/admin loop.
- Validate prettier-plugin-tailwindcss in pre-commit against package-lock.json.
- Update AGENTS.md formatter guidance to mention resolved plugins.

Failure-Class: none
…se unresolvable lockfiles

scripts/run-web-frontend-tests.sh owns web/frontend's node --test suite, so a
PR that only edits the runner must re-run the lane it owns. Also, when a web
dir pins prettier but its package-lock cannot be resolved, refuse instead of
silently falling back to a major-only comparison that accepts a stale
formatter CI rejects.

Failure-Class: none
…ed edits

The web formatter loop formatted the working-tree file and re-staged the
whole result, so a partially staged JS/TS file in web/admin (or web/app)
could sweep unrelated unstaged work into the commit. The hook now refuses
before formatting any staged web file that still has unstaged edits, with
an actionable message; the regression lane covers it.

Failure-Class: none
The rebase onto main brought in scripts/pre-commit's new commit-identity
gate (check_git_author_identity.py --pending), which the fixture repo
cannot satisfy from a temp clone. The fixture now ships a pass-through
stub so the lane keeps covering the formatter toolchain it is named for.

Failure-Class: none
A push carrying PRE_PUSH_SKIP_BACKEND_UNIT_TESTS=1 leaked into the sourced
check_backend_unit_tests_if_needed, so the cap lane skipped before writing
ran_count and failed. The lane now unsets the backend hatches so the cap
logic always runs.

Failure-Class: none
…rated OpenAPI client

When the staged package-lock.json is missing, empty, or unparseable, the web
format-and-add loop fell back to a major-version-only Prettier comparison and,
on a major match, proceeded to rewrite staged files with an unversioned
prettier. That re-opens the BasedHardware#11304 unrestrained-reformat class for new
packages. Refuse unconditionally when the lockfile pin is unresolvable, and
document the OMI_SKIP_WEB_FORMAT=1 hatch.

Also exclude auto-generated TypeScript (the web/admin OpenAPI client,
omiApi.generated.ts) from Prettier's format-and-add so a regenerated artifact
is never rewritten by the hook.

Failure-Class: none
…t exclusion

Add pinned-toolchain refusals for the two fail-closed web-pre-commit guards:
a missing package-lock.json with a matching-major prettier must refuse instead
of falling back to a major-only comparison (BasedHardware#11304), and a regenerated
omiApi.generated.ts is never swept through Prettier format-and-add.

The existing unstaged-edit refusal test now stages its package.json and
package-lock.json: without a staged lockfile the resolvable-pin check refuses
first, so the test never reaches the unstaged-edit guard it asserts.
…probe

Git exports GIT_DIR/GIT_WORK_TREE to hooks running in linked worktrees;
Flutter resolves its own SDK version through Git, so a valid install
reported nothing and the hook refused correct Dart commits. Run the
probe with those variables unset, matching the existing scripts/pre-push
Flutter paths.

Regression case: the flutter stub now reports nothing when GIT_DIR leaks,
and the hook must still format with the pinned toolchain.
…file

Prettier 2 auto-loads any installed plugin, so when package.json declares
prettier-plugin-tailwindcss but the staged lockfile has no entry for it,
the empty resolution skipped validation and formatting ran with whatever
stale plugin happened to be installed. Treat the empty resolution as a
refusal; undeclared plugins keep skipping validation as before.

Regression case stages a declared-plugin fixture whose lockfile omits the
entry (with a stale plugin installed locally) and fails if validation is
skipped again.
wrapped-unlimited-deeplink-parity.test.mjs reads
app/android/app/src/main/AndroidManifest.xml and asserts the /wrapped and
/unlimited App Links, so a manifest-only change must select the lane that
enforces that contract.
@undivisible
undivisible force-pushed the fix/web-test-lane-and-formatter branch from 44dcc98 to 35d872e Compare August 25, 2026 16:33

ghost 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: 35d872ee3d

ℹ️ 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 web/app/package.json
Comment on lines +77 to +78
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",

ghost Aug 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Refresh bun.lock for the formatter dependencies

On a clean checkout, changing this package.json selects web-app-checks, whose test.sh runs bun install --frozen-lockfile when node_modules is absent. Because this commit does not update web/app/bun.lock, and that lock contains neither new dependency, the manifest check and Docker build fail during dependency installation before reaching tests. Fresh evidence beyond the earlier missing-package-lock.json feedback is that this package explicitly installs with Bun and treats bun.lock as authoritative.

AGENTS.md reference: web/app/AGENTS.md:L16-L16

Useful? React with 👍 / 👎.

Comment thread scripts/pre-commit
else
LOCAL_VERSION=""
fi
RESOLVED_VERSION=$(git show :"$dir/package-lock.json" 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print((d.get('packages',{}).get('node_modules/prettier') or {}).get('version',''))" 2>/dev/null)

ghost Aug 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate web/app against Bun instead of package-lock.json

When any JS/TS file under web/app is staged, the new dynamic directory loop reaches this lookup, but web/app intentionally has only bun.lock; consequently RESOLVED_VERSION is always empty and the hook exits through the missing-lockfile refusal even after the prescribed bun install. Fresh evidence after the earlier lockfile feedback is the scoped Bun-only contract, so this path must validate the Bun lock/install or exclude web/app rather than telling contributors to create an npm lockfile or use the hatch.

AGENTS.md reference: web/app/AGENTS.md:L16-L16

Useful? React with 👍 / 👎.

@undivisible
undivisible dismissed stale reviews from aryanorastar and Git-on-my-level August 26, 2026 18:16

Concerns addressed in subsequent commits: lockfile fail-closed and admin client exclusion added Aug 14-15

@undivisible
undivisible merged commit 50cf064 into BasedHardware:main Aug 26, 2026
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 needs-tests PR introduces logic that should be covered by tests 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