Purpose
Index Advisor explains Firestore query-index failures and compares a query shape against known project indexes. Deterministic checks are mandatory; AI explanations are optional overlay content.
Inputs
Index Advisor works from:
- current Firestore query shape
- captured query/index errors
- synced project index definitions
- manually entered query/index data
Outputs
TABLE: query clauses, required fields, and index comparison rowsTREE: structured query shape and index coverage explanationJSON: raw index specs, parsed error data, and diagnosticsLOGS: sync, parse, compare, warning, and error logs
Actions
Users can:
- sync or refresh current project indexes
- inspect why a query requires an index
- compare filters/order clauses to current indexes
- open/create a required index
- copy an index spec
- verify again after index creation
- review proactive warnings for likely composite-index requirements
Index Advisor should make the deterministic evidence visible before any explanation. Show the query path, filters, order clauses, current index set, missing fields, and Firebase error text so users can verify why a recommendation was produced.
Use AI-assisted wording only as an optional overlay. The core result must remain reproducible from synced indexes and the query shape, which is what makes the module safe for production troubleshooting and support handoff.
Safety
- Index sync and diagnosis are read-oriented.
- Index creation/deploy-style workflows are Pro-gated or routed through Workspace Link when they mutate project configuration.
- Explanations should preserve raw deterministic evidence so users can verify the recommendation.
Source Anchors
Sources/FirestructApp/Features/IndexAdvisor/UI/IndexAdvisorView.swiftSources/FirestructApp/Features/IndexAdvisor/Services/AppModel+IndexAdvisorActions.swiftSources/FirestructApp/Features/IndexAdvisor/Model/IndexAdvisorStore.swiftSources/FirestructCore/IndexAdvisorService.swiftSources/FirestructCore/FirestoreIndexCreationLinkSummary.swift