Skip to content

fix(preflight): normalize Firestore query paths - #9683

Closed
tianmind-studio wants to merge 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-firestore-query-fingerprints
Closed

tianmind-studio wants to merge 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-firestore-query-fingerprints

Conversation

@tianmind-studio

@tianmind-studio tianmind-studio commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • canonicalize Firestore query inventory source paths before they enter fingerprints
  • use the same canonical path for AST diagnostics, runtime query shapes, and registry shapes
  • add a platform-independent Windows/Posix fingerprint regression test

Root cause

inventory() passed str(relative) into QueryShape.source, and source is part of the fingerprint. Linux generated backend/database/... while Windows generated backend\database\..., so all 45 existing raw or unsupported fingerprints looked new on Windows. Waiver IDs were platform-dependent for the same reason.

The old code reproduced both failures on Windows:

  • firestore_query_coverage.py --check-ratchet reported 42 new raw shapes and 3 new unsupported shapes
  • test_query_coverage_baseline_tracks_current_raw_and_unsupported_debt failed against the committed baseline

Durable guard

All inventory paths now pass through PurePath.as_posix() before constructing a QueryShape. The regression test feeds equivalent PureWindowsPath and PurePosixPath values through the analyzer and requires identical source strings and fingerprints. The full baseline test also passes on Windows.

Validation

  • python backend/scripts/firestore_query_coverage.py --check-ratchet - passed
  • python -m pytest backend/tests/unit/test_firestore_query_contract.py::test_query_coverage_baseline_tracks_current_raw_and_unsupported_debt -q -m slow - 1 passed
  • official backend/test.sh selected-file runner - 6 passed, 2 deselected
  • black --check --line-length 120 --skip-string-normalization ... - passed
  • backend/scripts/typecheck.sh - 0 errors
  • $env:PYTHONUTF8='1'; make preflight - 14 checks passed

Fixes #9682.
Contributes to #9440.

Review in cubic

@Git-on-my-level Git-on-my-level added workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-maintainer-review Needs a human maintainer to sign off before merge labels Jul 14, 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 tracking this down. I reviewed the diff and this looks like the right shape of fix: canonicalizing the inventory source with PurePath.as_posix() before it enters both the AST filename and QueryShape.source should remove the Windows-vs-POSIX separator from fingerprints, including registry-sourced shapes. The added regression test covers equivalent PureWindowsPath / PurePosixPath inputs producing the same source string and fingerprint.

I also ran the ratchet locally against the PR checkout with secrets stripped:

  • python backend/scripts/firestore_query_coverage.py --check-ratchet — passed

I could not run the targeted pytest in this stripped environment because google.cloud.firestore_v1 is not installed here, but GitHub's Backend unit suite is passing on the PR.

No blocking code issue from me. I am leaving this as a positive signal rather than a formal approval because the PR changes a preflight/static-contract script; a maintainer should still sanity-check the workflow/guardrail behavior before merge.

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

Preflight path normalization with a contract test; holding the merge on the maintainer-review label.

@tianmind-studio

Copy link
Copy Markdown
Contributor Author

Fresh integration evidence from latest main: rebasing the #9440 pusher circuit-breaker fake-clock change and running make preflight failed only at firestore-query-coverage with the same 42 raw plus 3 unsupported Windows fingerprints. Applying this PR commit in a clean temporary worktree made all 14 selected checks pass, so #9683 also unblocks the next deterministic-test contribution.

Copy link
Copy Markdown
Contributor Author

Current main now contains the same platform-independent source-path guard through 3f24998a0: canonical_source_path() uses PurePath.as_posix(), all inventory/registry sources pass through it, and a PureWindowsPath/PurePosixPath regression test is present. I rechecked that implementation on native Windows: the focused contract test passed and firestore_query_coverage.py --check-ratchet passed. Closing this PR because the original gap is resolved on main.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @tianmind-studio 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-maintainer-review Needs a human maintainer to sign off before merge 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.

preflight: canonicalize Firestore query fingerprints on Windows

3 participants