mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-22 14:51:13 +00:00
[AZ-307] c6 FreshnessGate: active-conflict reject + stable-rear downgrade
Replaces the AZ-305 pass-through _evaluate_freshness hook with the production FreshnessGate. Loads tile_freshness_rules + sector classifications once at construction, builds an rtree index, and on every evaluate() either returns metadata unchanged (FRESH), stamps freshness_label=DOWNGRADED (stable_rear + stale), or raises FreshnessRejectionError carrying tile_id / age_seconds / classification / rule diagnostics (active_conflict + stale). Constructed inside PostgresFilesystemStore.from_config; the public storage_factory signature is preserved so AZ-305 unit tests still build the store with freshness_gate=None for the pass-through path. FDR schema bumped to v1.2.0: adds c6.freshness.rejected and c6.freshness.downgraded kinds (non-breaking; v1.1 readers route them opaquely). Operator CLI `python -m c6_tile_cache.freshness_gate explain` dry-runs the decision for a (lat, lon, capture_ts). Adjacent hygiene: c6_tile_cache.tools._dump_tile now passes os.environ to load_config (AZ-305 regression — load_config requires the env mapping). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,6 +50,12 @@ dependencies = [
|
||||
# `requests` because httpx ships `MockTransport` natively, so the
|
||||
# FlightsApi unit tests need no extra HTTP-mocking dep.
|
||||
"httpx>=0.28,<1.0",
|
||||
# AZ-307 / E-C6: FreshnessGate uses an in-memory R-tree to look up
|
||||
# the sector classification for a (lat, lon) at every write_tile
|
||||
# call. `rtree` is the libspatialindex Python wrapper — small,
|
||||
# stable, sub-microsecond point-in-rect queries at the few-hundred-
|
||||
# sector scale operators ship per flight (NFR p99 ≤ 100 µs).
|
||||
"rtree>=1.0,<2.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user