Refine the network track's class from the optical look (#136)
build / mod (push) Failing after 1m25s

- ClassEst::step_optical: the shared estimate's rule for one passive look —
  an unsure look (over OPTICAL_CLASS_MAX_UNCERTAINTY) names nothing, a sure
  one names a class, firms an agreeing probable, replaces a contrary guess
- Track::refine_class_optical: the minimal common method — class only; the
  plot, age, source, quality and own fire rights stay untouched
- Sim::apply_optical_classes: the explicit adapter, fed by each observation
  made this tick through OpticalObservation::estimate; a relay of the
  refined track carries the class as it was and gains nothing from it
- the post still holds no track, emits nothing and authorizes no shot;
  the refined class reaches the existing #133 track UI through the picture
- tests: network refinement, unsure look, relay/stale look add no
  confidence, equal observables refine equal classes, the step rules

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
2026-11-20 23:55:28 +03:00
parent 8550de16f8
commit 12a706fb67
4 changed files with 216 additions and 12 deletions
+22
View File
@@ -612,6 +612,10 @@ impl Class {
}
}
/// An optical observation this unsure (0 best, 1 worst) names no class for the network (#136):
/// the post still shows its own look, but the shared estimate keeps what the radars made of it.
pub const OPTICAL_CLASS_MAX_UNCERTAINTY: f64 = 0.5;
/// What the radars make of a track's class, from the measurements alone (#133): separate from
/// the track's confirmation (`Track::ident`, how firmly it is held), its own state with its own
/// rules. It travels with the measurement it grew from: a relay passes it as it was, ageing with
@@ -650,6 +654,24 @@ impl ClassEst {
}
}
/// The estimate stepped by one passive optical observation (#136): an independent look at the
/// same contact, never a radar measurement and never a relay. A look too unsure to name a
/// class (uncertainty over [`OPTICAL_CLASS_MAX_UNCERTAINTY`]) changes nothing. A sure look
/// names a class where none was, firms a probable one that agrees, and replaces a contrary
/// hypothesis with the new guess — the same arithmetic as [`Self::step`], fed by the optics
/// instead of the beam. It touches the class alone: no plot, no freshness and no fire right
/// travels with it, and a relay of the refined track carries the class as it was.
pub fn step_optical(self, class: Class, uncertainty: f64) -> ClassEst {
if uncertainty > OPTICAL_CLASS_MAX_UNCERTAINTY {
return self;
}
match self {
ClassEst::Unknown => ClassEst::Probable(class),
ClassEst::Probable(had) | ClassEst::Firm(had) if had == class => ClassEst::Firm(had),
_ => ClassEst::Probable(class),
}
}
/// Whether a system's roles cover the track's class. The explicit policy for the unknown
/// (#133): an unidentified track is not blocked by the class filter — it stays a candidate
/// under the general rules, and `why` says so. A system with no roles at all is holding its