Skip to content

fix(setup): normalize Gemini trust rules before selection - #10378

Merged
kaoru0822-kitauji merged 2 commits into
mainfrom
fix/10373-gemini-trust-keys-c7-01a1d00b
Nov 13, 2026
Merged

kaoru0822-kitauji merged 2 commits into
mainfrom
fix/10373-gemini-trust-keys-c7-01a1d00b

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #10373. Gemini setup and doctor could select an older trust rule because a trailing-slash or dot spelling was longer than the final key for the same directory. This could report a healthy registration despite an applicable workspace exclusion, or block setup unnecessarily.

Normalize trust-file keys at admission and retain the final value for each lexical key. Keep physical resolution separate for applicability and retain Gemini's key-length/TRUST_PARENT precedence. Use the existing JSON-map owner so a literal relative __proto__ rule reaches that normalization instead of disappearing.

Expected behavior is grounded in released Gemini CLI 0.68.0's trust loader and path normalization. No installed Gemini runtime was exercised.

Verification

Executed on macOS arm64, Node 24.22.1/npm 11.16.0. Refreshed on 0bc1b4a after merging main cdc4541ef7:

  • New acceptance cases before the fix on 4b26f38d6f: 5 failed, 7 passed. Four failures select the wrong normalized rule; the fifth drops the literal relative key. Ordinary relative-key and more-specific TRUST_PARENT controls pass.
  • Focused selection rerun after the main update: 91 passed across five files — public setup/doctor, policy-source ownership, JSON maps, registration status and configuration diagnostics.
  • The acceptance cases assert exact user, workspace and trust-file bytes after both commands.
  • npm run check — passed, 0 typed-lint errors and 4,875 advisory warnings.
  • npm run verify:package — passed, including its npm pack --dry-run --json, clean installation/update, setup/uninstall, skill and MCP verification.
  • git diff --check — passed. Initial fix-head check:fast and test-discovery verification also passed; no test files were added.

Hosted CI at updated head 0bc1b4a: all four required checks passed — Static checks, Conventional PR title, Portable tests and CI required (run). Automated code review completed without findings on this exact head. The original 84eea3c run's unchanged fingerprint timeout remains documented in #10381; its independent repair is #10384.

CodeQL alert 769 was narrowly dismissed as a false positive: the existing realpath metadata lookup uses caller-authorized local paths under SECURITY.md (assessment). Other host platforms, installed-client behavior and duplicate-spelling prevalence remain unverified.

Scope and coordination

Existing read-only client-policy admission; no new provider, authority, configuration writer, advertised schema or generated-file change. The owner audit found one Gemini trust-file reader; the normalized map replaces raw-key selection there. Physical path resolution remains a separate fact used by the same consumers. No related cleanup remains in this owner.

Rechecked current main, issue claims, targeted open/closed PRs and all 876 open PR file inventories before submission; no overlapping owner or acceptance-test change was found.

Author readiness

Human owner: @kaoru0822-kitauji. This author is exempt from the declaration under CONTRIBUTING.md; no human review is attested here.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T16:14:47.674487Z 0bc1b4a New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking issue was found.

Summary

Gemini trust rules now use normalized keys before replacement and selection.

  • Gemini setup and doctor follow normalized trust-file rules.

No actionable issues were found. This review checked source only; tests and an installed Gemini client were not run. Whether another PR supersedes this one could not be checked because GitHub access was unavailable.

Reviews (2) · Last reviewed commit: "chore: merge main for Gemini trust valid..." · Reviewed by Greptile

Comment thread src/application/GeminiClientSettings.ts Dismissed

Copy link
Copy Markdown
Collaborator Author

Coordination from the separate n13-1416 Rizin session: I inspected failed shard 1/8. The only failure is the unchanged semanticFingerprintAccumulation.test.ts transferred case exceeding 30 seconds (direct 28.323s, transferred 30.491s), not Gemini trust behavior. This test came from my earlier merged #10355. I am investigating its duplicate preparation under #10381 / codex/n13-1416-fingerprint-fixture-ci-10381, preserving both overflow paths and the 130,000-item control. I will keep the common repair separate and will not modify your branch. No retry or fixed result is claimed yet.

Copy link
Copy Markdown
Collaborator Author

The isolated common repair is now Ready for Review as #10384, commit ae34c21da30ca05fade01e728242b0b628fdc536. It changes only the fingerprint test fixture. All 83 focused tests and full static checking pass; both old append bugs still produce their own 1-failed/1-passed mutation control. Alternating completed local runs reduce wall time from 20.55/20.80 s to 17.32/17.31 s. Hosted CI is starting. Your branch remains untouched; the PR body and #10381 record the exact validation and platform limits.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit bf63760 into main Nov 13, 2026
51 of 52 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/10373-gemini-trust-keys-c7-01a1d00b branch November 13, 2026 18:48
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Gemini setup trust ignores the last normalized folder rule

3 participants