mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-22 12:21:14 +00:00
[AZ-839] Fix C3 fixture path mismatch (batch 108b)
The batch 108 fixture built tile_store + descriptor_index from the static operator config (root_dir baked into YAML) but built the AC-3/AC-6 verifier from cache_root/descriptor.index (fresh tmp path). On Tier-2 the descriptor_batcher would write under the YAML root and the verifier would open the tmp path, raising IndexUnavailableError before the fixture could yield a PopulatedC6Cache. Unit tests missed it because every test stubbed descriptor_index_factory. Mutate the c6_tile_cache config block in-memory at fixture entry so root_dir = cache_root and faiss_index_path falls back to <cache_root>/descriptor.index. Production C6 components and the verifier now share one path source. Align tile_store_path with PostgresFilesystemStore's <root_dir>/tiles layout so the integration test's tile_store_path.is_dir() assertion holds. Driver and unit tests are path-agnostic and unaffected. Batch 108b report documents the defect, the fix, and the self-review miss. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from collections.abc import Iterator
|
||||
import dataclasses
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
@@ -430,8 +431,26 @@ def _build_operator_pre_flight_cache(
|
||||
config = load_config(os.environ, paths=[config_path])
|
||||
|
||||
cache_root = tmp_path_factory.mktemp("operator_pre_flight_cache")
|
||||
tile_store_path = cache_root / "tile_store"
|
||||
tile_store_path.mkdir(parents=True, exist_ok=True)
|
||||
# PostgresFilesystemStore writes JPEGs under `<root_dir>/tiles/`;
|
||||
# FaissDescriptorIndex falls back to `<root_dir>/descriptor.index`
|
||||
# when `faiss_index_path` is empty. Override the c6_tile_cache
|
||||
# block in-memory so the production components built below
|
||||
# (build_tile_store / build_descriptor_index / batcher) write to
|
||||
# the same `cache_root` PopulatedC6Cache advertises. Without this
|
||||
# the static YAML at GPS_DENIED_OPERATOR_CONFIG_PATH would route
|
||||
# writes to its baked-in `root_dir` while the verifier read from
|
||||
# the fixture's tmp path, breaking AC-3 / AC-6 on Tier-2.
|
||||
c6_block = config.components["c6_tile_cache"]
|
||||
c6_block_overridden = dataclasses.replace(
|
||||
c6_block,
|
||||
root_dir=str(cache_root),
|
||||
faiss_index_path="",
|
||||
)
|
||||
config = dataclasses.replace(
|
||||
config,
|
||||
components={**config.components, "c6_tile_cache": c6_block_overridden},
|
||||
)
|
||||
tile_store_path = cache_root / "tiles"
|
||||
faiss_index_path = cache_root / "descriptor.index"
|
||||
|
||||
route_spec = extract_route_from_tlog(
|
||||
|
||||
Reference in New Issue
Block a user