refactor: delete the legacy session model

Two session models shared one process. `/v1/*` and `/v1/stream` are the live
one; `/api/sessions*` and `/api/compare_live_vs_still` were the earlier model,
still constructed on every `create_app()` through `build_legacy_scans` even
though nothing called them. The web client and `stream_client.py` speak only
`/v1`.

Deleted: `observe.py` (ScanService/PerceptionService/PerceptionAdapter),
`yolo_adapter.py` (imported only by the legacy builder), `pipeline.py` and
`test_suite.py` (the old single-image CLI, reachable only from each other),
`test_observe.py` (its Session* tests), the eight legacy route handlers,
`build_legacy_scans` with its two facades, `create_fastapi_app`, and the
`scans` parameter on `create_app`.

`IdentityRankingTests` moved to `test_identity.py` before `test_observe.py` was
deleted: those five ranking rules are the live path's contract, not the legacy
model's. `test_api.py` keeps every `/v1` and WebSocket test.

Verified: 246 tests OK (2 skipped), and a route dump of a freshly built app
shows no `/api/*` path with all nine `/v1` routes and the WebSocket intact.
This commit is contained in:
kiyo9w 2026-09-28 17:47:50 +09:00
parent 004212a8cf
commit eca03e0c91
10 changed files with 54 additions and 1348 deletions

View file

@ -174,7 +174,7 @@ code/
detector.py # YOLO detector
feature_matcher.py # SURF/SIFT, ORB, BRISK, Hybrid
identity.py # accepted / ambiguous / unknown / rejected
empty_shelf_detector.py, inventory.py, pipeline.py, observe.py
empty_shelf_detector.py, inventory.py, gallery.py, tags.py, tag_cards.py
stream_client.py # client mẫu (camera / video / pan ảnh tĩnh)
bench_engine.py # đo tốc độ
test_*.py # unittest modules (discover -s code -p 'test_*.py')