openai / gpt-6.1-sol / high / high effort preferred over openai / gpt-6-luna / low / low effort · clear win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Trace inspection filtering and matching from frontend request through backend predicate construction. Identify a concrete parity or data-integrity risk (including nulls, ranges, or combined filters) where the visible result set can diverge from intended semantics; show the precise path and propose a minimal correction and boundary regression cases.
openai / gpt-6.1-sol / high / high effort answer
## Finding: whitespace-only operators break matching parity
**High confidence; independently assessed from the supplied snapshot.** The Python matcher accepts an existing inspection whose operator is spaces-only, but the SQL matcher rejects it when the incoming operator is named.
In `[REDACTED: private project name]/backend/app/services/inspection_match.py`:
- `normalize_operator()` strips whitespace and converts an empty result to `None` (lines 48–55).
- `InspectionKeys.matches_row()` accepts a match when either normalized operator is missing (lines 129–134).
- `find_existing_inspection()` normalizes the incoming operator, but its SQL considers the stored operator missing only when it is `NULL` or exactly `''` (lines 213, 244–249).
**Reproducible trigger:** use identical municipality, project, asset, UTC timestamp and direction; stored `performed_by = ' '`; incoming operator `'Alice'`.
| Path | Result |
|---|---|
| Python `matches_row()` | `True`: stored operator normalizes to `None`. |
| SQL `find_existing_inspection()` | No match: spaces are neither `NULL` nor `''`, and `LOWER(TRIM(' ')) != 'alice'`. |
The reverse ordering accepts the match: incoming spaces normalize to `None`, satisfying SQL’s `:op IS NULL` branch. Thus record order and sequential-versus-batched matching can change the matching result. A caller that inserts after a miss could produce duplicate canonical inspections, affecting displayed rows and counts; that insertion/display linkage is **not established by this packet**.
## Request-to-predicate trace—and its limit
`[REDACTED: private project name]/frontend/src/hooks/useInspectionData.ts` does **not** issue an inspection-filter request. It fetches:
1. `/inspections/{id}/review-boot`, enabled only for positive IDs (lines 17–29).
2. `/review-pack/{id}/inspection.json`, gated by a fetched boot payload and nonempty trimmed pack path (lines 74–90).
Consequently, this snapshot cannot establish how frontend filter controls become `InspectionFilterSpec`.
Once a spec reaches `apply_inspection_filters()` in `[REDACTED: private project name]/backend/app/services/inspection_filter_pipeline.py`, predicates are composed in this order:
- Tenant scope and archival filtering (line 130).
- Project filtering: explicit `project_id` takes precedence over `in_project` (lines 133–138).
- Asset types and asset IDs; an empty asset-ID list explicitly matches nothing (lines 141–150).
- Saved filters, observation-parent filters, then transient NL conditions (lines 155–175).
- Search (line 178).
- Viewport: non-null coordinates and inclusive longitude/latitude bounds (lines 181–190).
Successive `.where()` calls intersect these dimensions. The internal semantics of the imported compilers and parent-filter helper remain outside the packet.
## Smallest correction and regression cases
For the demonstrated spaces-only defect, replace SQL’s:
```sql
OR performed_by = ''
```
with:
```sql
OR TRIM(performed_by) = ''
```
Keep the existing `performed_by IS NULL` branch.
Add SQL-versus-Python differential tests, holding all other keys equal:
- Stored operator `NULL`, `''`, and `' '` against `'Alice'`: all match.
- Reverse each pair: all match.
- `' Alice '` against `'alice'`: match.
- `'Alice'` against `'[REDACTED: person name]'`: no match.
- Repeat the whitespace case with both directions `NULL`, midnight/non-midnight timestamps, and unequal non-midnight timestamps; operator normalization must not bypass direction or time restrictions.
**Remaining boundary:** Python `.strip()` also removes tabs, newlines and other whitespace; PostgreSQL’s default `TRIM()` removes spaces. Test these explicitly. Full whitespace parity requires the SQL and Python paths to use the same normalization definition; the minimal patch above fixes only the demonstrated space case.
## Uncertainty and next action
No frontend-to-filter transport, schema validation, compiler internals, bulk-probe implementation or insert-on-miss caller is supplied. Therefore, antimeridian ranges, combined-filter transport bugs and nullable bulk-key failures are hypotheses—not established defects.
Next action: reproduce the operator mismatch with a database-backed differential test, then apply the narrow SQL correction and define broader whitespace handling.
MATERIAL_EVIDENCE_CONFLICT: `inspection_match.py:99–107` claims Python/SQL predicate equivalence, but `48–55,129–134` treat stored whitespace-only operators as missing while `244–249` do not.openai / gpt-6-luna / low / low effort answer
**Conclusion:** The snapshot does not establish a frontend-to-backend filtering or matching parity defect. The supplied frontend hook fetches review-pack enrichment, not an inspection-filter request, so it provides no evidence about how filter parameters are sent. The backend pipeline does show a concrete boundary risk: if `viewport_bbox` permits `min_lon > max_lon` (or `min_lat > max_lat`), its inclusive lower-and-upper-bound predicates cannot match any centroid (pipeline lines 180–189). Whether such bounds are rejected earlier is unknown because the filter-spec schema is outside the packet.
**Recommendation:** Validate bbox ordering when constructing the filter spec, or normalize/explicitly support antimeridian-crossing longitude ranges if those are intended. Add boundary tests for equal bounds, reversed longitude and latitude bounds, and points exactly on each inclusive edge. Also test combined bbox and asset-type filters to confirm both narrow the result set.
**Alternative / uncertainty:** Empty `asset_id_in` is explicitly handled as match-none (lines 144–150), and nullable centroids are explicitly excluded when bbox filtering (lines 184–185); neither alone demonstrates unintended behavior. `inspection_match.py` compares UTC date/time and uses NULL-safe direction matching, but it is import deduplication logic, not the inspection-filter request path. The frontend request construction, bbox validation, and relevant dependencies are not present, so end-to-end parity cannot be confirmed.
**Next useful action:** Inspect the schema/route that parses `viewport_bbox` and the frontend code that builds `/inspections/query` requests; verify reversed-range handling and add request-to-SQL regression coverage.
Primary judge's stated reason
B provides a concrete, reproducible parity finding and an actionable correction rather than only a validation-dependent risk. This is a supported material advantage on the central requested outcome, not merely a forced slight preference. Actual duplicate creation or visible-result divergence remains unverified because the relevant callers are outside the supplied evidence.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 1a629e2d-f9fa-4128-8962-e007165c19b0. Pair: brp1_e42b0e000dca52e1585e550013e7b6eef38d5ca33f02d8157c9298747c2e9497. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.