fix(v1): wire model confidence, explicit source mode, unique event ids

A: PoseAdapter.set_confidence_threshold is applied on start, so the
   settings model-confidence field actually affects inference.
B: config source.mode ('stream'|'replay') is explicit; app no longer
   guesses the source type from the URL prefix.
C: FallStateMachine takes a session_id and from_config generates a
   unique one per run, so event ids never collide across restarts
   (no screenshot overwrite or duplicate JSONL identity in a day).

51 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ila
2026-07-21 20:54:34 +08:00
co-authored by Claude Opus 4.8
parent 7443a8f031
commit 04422d9ca0
13 changed files with 188 additions and 7 deletions
+19
View File
@@ -82,6 +82,25 @@ def test_confirmation_window_must_remain_within_customer_target():
)
def test_session_id_makes_event_ids_unique_across_runs():
run_a = FallStateMachine(
confirm_window_seconds=1.0, recovery_window_seconds=2.0,
config_version="cfg", session_id="run-a",
)
run_b = FallStateMachine(
confirm_window_seconds=1.0, recovery_window_seconds=2.0,
config_version="cfg", session_id="run-b",
)
run_a.update("P-0001", Evidence(True, True), now=0.0)
event_a = run_a.update("P-0001", Evidence(True, True), now=1.0)
run_b.update("P-0001", Evidence(True, True), now=0.0)
event_b = run_b.update("P-0001", Evidence(True, True), now=1.0)
assert event_a[0].event_id != event_b[0].event_id
assert "run-a" in event_a[0].event_id
assert "run-b" in event_b[0].event_id
def test_each_track_has_an_independent_confirmation_window():
machine = FallStateMachine(
confirm_window_seconds=1.0,