feat(queries): inventory firestore query surfaces as typed records #5

Merged
trevon merged 1 commit from trevon/firestore-query-inventory into fix/cli-rough-edges 2026-09-24 02:36:07 +00:00 AGit
Owner

Adds pipe queries: an inventory of every Firestore query in a Dart or Flutter project, as typed JSON or markdown. Inventory only: no rules, findings or baseline changes.

  • lib/src/firestore_facts.dart finds cloud_firestore query chains by static type (library URI plus class name, never by name alone).
  • It records collection, collectionGroup and doc paths, every where op, Filter.or/and, FieldPath.documentId, orderBy, limits, cursors, and whether the query is realtime or an aggregate.
  • It resolves string constants, follows queries built up in a variable (clauses under an if are marked conditional), inlines getters and helpers one level deep, and marks queries passed in as parameters as unknown.
  • lib/src/gateway_facts.dart maps declarative query APIs (for example a FirestoreGateway) into the same record through --adapter-config.
  • Names are validated, so no source text reaches the output.

Calibration on the NuWayze app: 372 of 372 query terminals found (336 exact), and 136 of 136 backend gateway calls (121 exact). No false positives. NuWayze uses the output to probe production indexes; it found 92 failing query shapes.

Tests: 188 pass (38 new, with a stub cloud_firestore fixture and negative controls). dart analyze is clean.

Stacked on #4.

Adds pipe queries: an inventory of every Firestore query in a Dart or Flutter project, as typed JSON or markdown. Inventory only: no rules, findings or baseline changes. - lib/src/firestore_facts.dart finds cloud_firestore query chains by static type (library URI plus class name, never by name alone). - It records collection, collectionGroup and doc paths, every where op, Filter.or/and, FieldPath.documentId, orderBy, limits, cursors, and whether the query is realtime or an aggregate. - It resolves string constants, follows queries built up in a variable (clauses under an if are marked conditional), inlines getters and helpers one level deep, and marks queries passed in as parameters as unknown. - lib/src/gateway_facts.dart maps declarative query APIs (for example a FirestoreGateway) into the same record through --adapter-config. - Names are validated, so no source text reaches the output. Calibration on the NuWayze app: 372 of 372 query terminals found (336 exact), and 136 of 136 backend gateway calls (121 exact). No false positives. NuWayze uses the output to probe production indexes; it found 92 failing query shapes. Tests: 188 pass (38 new, with a stub cloud_firestore fixture and negative controls). dart analyze is clean. Stacked on #4.
Add `pipe queries`, which lists every Firestore query a project can issue:
scope, collection, path pattern, filters with operators and value types,
composites, orderBy, limit, cursors, realtime, aggregation, in-loop, plus a
confidence and the reasons it is not exact. Receivers are matched by static
type and cloud_firestore library URI, never by name.

Queries are followed through chains, local variables (flow-insensitive with
two cuts), fields, getters and one level of helper methods with arguments
bound. An --adapter-config (YAML or JSON) maps declarative query APIs such as
a server-side gateway onto the same schema.

Inventory only: no rules, findings or baseline changes. Every emitted name is
validated against a safe character set so no source text reaches the output.
trevon merged commit 3e4217c0fe into fix/cli-rough-edges 2026-09-24 02:36:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
trevon/pipe!5
No description provided.