Skip to content

Python tool for aircraft Doppler audio geolocation using historical ADS-B flight data (Source-available)

Require explicit classified core assessment mappings (#10)

Cinna Davis3b61a9fcfad4
diff --git a/docs/PRODUCT.md b/docs/PRODUCT.md
index 1767b4c..e7ae0ad 100644
--- a/docs/PRODUCT.md
+++ b/docs/PRODUCT.md
@@ -178,8 +178,11 @@ The product relays `finite_search_evidence` unchanged, preserves seed IDs throug
refinement, and supplies `candidate_mode_ids` parallel to the wire candidates.
For the explicitly declared evaluated-finite-grid scope, `assessed_mode_ids`
-requires an actually completed finite core score with full measured-trajectory
-support at the original seed/model and a valid trusted clock. It does not require
+requires the producer's explicit `core_assessed_mode_ids` mapping plus an actually
+completed finite core score with full measured-trajectory support at the original
+seed/model and a valid trusted clock. A returned fit alone does not establish
+classification of every bounded clock/optimizer trial; missing/malformed mappings
+or producer-omitted IDs remain unassessed. It does not require
jointly optimizing every retained point. Failed, missing or unsupported core
records are unassessed. Raw and refined representations retain their original
mode ID and original-or-improved score; no association-only deduplication is used.
diff --git a/evidence/product-20261103/producer-assessment-verification.json b/evidence/product-20261103/producer-assessment-verification.json
new file mode 100644
index 0000000..6bf6d23
--- /dev/null
+++ b/evidence/product-20261103/producer-assessment-verification.json
@@ -0,0 +1,20 @@
+{
+ "base_commit": "f04f346",
+ "before_fix": {
+ "passed": 6,
+ "failed": 3,
+ "scope": "Missing/malformed producer mapping or producer-omitted full-support core row incorrectly accepted in controlled finite evidence."
+ },
+ "after_fix": {
+ "passed": 61,
+ "failed": 0,
+ "skipped": 0,
+ "elapsed_s": 14.32
+ },
+ "command": "PYTHONPATH=src /home/cinna/aircraft-audio-geolocation/.venv/bin/python -m pytest -q tests/test_automatic_finite.py tests/test_automatic_profile.py tests/test_decision_invariants.py tests/test_confidence.py --junitxml=results/w5-producer-assessment-20261103.xml",
+ "files_sha256": {
+ "src/aircraft_geoloc/automatic.py": "d905f1e8f63b3d57fac247dcb35636e1e8a6d3d58ae1486424e5cd0088cb1ac5",
+ "tests/test_automatic_finite.py": "1e505db62d8f82b640c381743829d46db65b6c440b8f05059520ecd00181777b"
+ },
+ "scope": "Explicit producer assessment gating and finite/profile compatibility controls; no actual scientific replay or accuracy claim."
+}
diff --git a/src/aircraft_geoloc/automatic.py b/src/aircraft_geoloc/automatic.py
index 476e346..28787c8 100644
--- a/src/aircraft_geoloc/automatic.py
+++ b/src/aircraft_geoloc/automatic.py
@@ -203,12 +203,16 @@ def _decide(search, events, prepared_events, measurements, indexes, terrain, sta
start_window = tuple(utc_timestamp(window[key]).timestamp() for key in ("start_utc", "end_utc"))
finite = search.get("finite_search_evidence")
assessed_ids = set()
- if isinstance(finite, dict):
+ producer_ids = search.get("core_assessed_mode_ids")
+ valid_core_mapping = (isinstance(producer_ids, list)
+ and all(isinstance(identity, str) and identity for identity in producer_ids))
+ if isinstance(finite, dict) and valid_core_mapping:
+ producer_ids = set(producer_ids)
for row in raw:
identity = row.get("mode_id")
groups = row.get("event_indices", range(len(prepared_events)))
core = row.get("event_diagnostics", [])
- if (isinstance(identity, str) and identity and row.get("score_kind") == finite.get("score_kind")
+ if (isinstance(identity, str) and identity in producer_ids and row.get("score_kind") == finite.get("score_kind")
and math.isfinite(row["score"]) and start_window[0] <= row["recording_start_time_s"] <= start_window[1]
and len(groups) == len(row["flight_ids"]) == len(core) and len(core) > 0
and all(isinstance(fit, dict) and fit.get("support_fraction") == 1.
@@ -315,6 +319,7 @@ def _decide(search, events, prepared_events, measurements, indexes, terrain, sta
diagnostics[event_id] = evidence
if finite is not None:
diagnostics["finite_search_evidence"] = deepcopy(finite)
+ diagnostics["core_assessment_mapping_status"] = "present" if valid_core_mapping else "missing_or_invalid"
diagnostics["assessed_mode_ids"] = sorted(assessed_ids)
diagnostics["candidate_mode_ids"] = [row.get("mode_id") for row in rows]
write_json(output / "refined-candidates.json", {"ranked": rows, "matching_diagnostics": diagnostics})
diff --git a/tests/test_automatic_finite.py b/tests/test_automatic_finite.py
index 3a75fa9..bd0606d 100644
--- a/tests/test_automatic_finite.py
+++ b/tests/test_automatic_finite.py
@@ -8,7 +8,8 @@ from aircraft_geoloc import automatic, matching
from aircraft_geoloc.jobs import read_json
[email protected]("bad_core", [None, "partial_support", "missing_core", "missing_id", "near_cluster"])
[email protected]("bad_core", [None, "partial_support", "missing_core", "missing_id", "near_cluster",
+ "producer_unassessed_core", "missing_assessment_map", "malformed_assessment_map"])
def test_finite_scope_assesses_supported_frozen_seeds_and_preserves_ids(tmp_path, monkeypatch, bad_core):
events = [{"event_id": f"event-{i}", "start_s": i*100., "end_s": i*100.+20., "band_hz": [90., 200.],
"ridge": [{"time_s": i*100.+t, "frequency_hz": 140.-t} for t in (0., 10., 20.)]} for i in range(2)]
@@ -35,7 +36,14 @@ def test_finite_scope_assesses_supported_frozen_seeds_and_preserves_ids(tmp_path
"discarded_count": 0, "best_discarded_score": None, "pruning_accounted_for": True,
"limitations": ["Evaluated points only; unperformed refinements and continuous space are not covered."]}
search = {"ranked": rows, "status": "complete", "scoring_time_is_locked": True,
- "alternative_modes_exhaustively_assessed": False, "finite_search_evidence": evidence}
+ "alternative_modes_exhaustively_assessed": False, "finite_search_evidence": evidence,
+ "core_assessed_mode_ids": ["mode-a", "mode-b"]}
+ if bad_core == "producer_unassessed_core":
+ search["core_assessed_mode_ids"] = ["mode-a"]
+ elif bad_core == "missing_assessment_map":
+ search.pop("core_assessed_mode_ids")
+ elif bad_core == "malformed_assessment_map":
+ search["core_assessed_mode_ids"] = "mode-a"
before = deepcopy(search)
state = {"recording": {"time_window": {"start_utc": "2026-09-21T14:13:20Z", "end_utc": "2026-09-21T14:13:20Z", "source": "user"}},
"coverage": {"search_complete": True, "data_status": "available", "limitations": []}}
@@ -77,7 +85,8 @@ def test_finite_scope_assesses_supported_frozen_seeds_and_preserves_ids(tmp_path
assert final["candidates"][0]["score"] == -.1
else:
assert final["status"] == "inconclusive", final
- assert diagnostics["assessed_mode_ids"] == ["mode-a"]
+ expected = [] if bad_core in ("missing_assessment_map", "malformed_assessment_map") else ["mode-a"]
+ assert diagnostics["assessed_mode_ids"] == expected
def test_finite_scope_limitations_are_visible_in_coverage():