Follow-up to #169 / #399. The first full mutation run left 4351 survivors across 583 functions, now in backend/tests/mutation-baseline.txt. Survivors cluster in a few areas where tests pass without pinning the behaviour. Work through them by group: add the missing assertion, rerun the group with its glob, and lower its baseline lines.
Groups, by risk
- Auth flows. OAuth login and associate callbacks (60 and 52 survivors),
complete_mfa_challenge (41); app.api.auth.services survives 29% overall.
just mutation 'app.api.auth.services.oauth*' 'app.api.auth.services.mfa*'
- Upload safety.
ClamAVScanner.scan (34) and recompute_user_upload_quota (32).
just mutation 'app.api.file_storage.upload_*'
- RPi camera plugin, 38% survival, the highest of any large package:
cross_worker_relay._execute_and_respond (91), YouTube livestream and recording setup (73, 62), capture_and_store_image (46).
just mutation 'app.api.plugins.rpi_cam*'
- Error details and keys. About 1150 survivors change a string the code relies on:
detail= and reason= arguments, dict keys, return values, exception messages. Tests check the status but not the message (see "Assertions" in backend/tests/README.md).
Router factories (build_categorized_admin_router, the OAuth build_*_router) survive mostly through OpenAPI summary and description strings; leave those in the baseline.
Also
- mutmut skips decorated functions, so route handler bodies are never mutated. The handlers with real logic are a handful of rpi_cam ones (
receive_camera_upload, receive_preview_thumbnail_upload, claim_pairing_code, poll_pairing_status, proxy_hls). Either check their guards with the if False: method or move the logic into plain functions.
- Rebaseline per function by editing its line;
just mutation-baseline replaces the whole file and needs a full run.
Follow-up to #169 / #399. The first full mutation run left 4351 survivors across 583 functions, now in
backend/tests/mutation-baseline.txt. Survivors cluster in a few areas where tests pass without pinning the behaviour. Work through them by group: add the missing assertion, rerun the group with its glob, and lower its baseline lines.Groups, by risk
complete_mfa_challenge(41);app.api.auth.servicessurvives 29% overall.just mutation 'app.api.auth.services.oauth*' 'app.api.auth.services.mfa*'ClamAVScanner.scan(34) andrecompute_user_upload_quota(32).just mutation 'app.api.file_storage.upload_*'cross_worker_relay._execute_and_respond(91), YouTube livestream and recording setup (73, 62),capture_and_store_image(46).just mutation 'app.api.plugins.rpi_cam*'detail=andreason=arguments, dict keys, return values, exception messages. Tests check the status but not the message (see "Assertions" inbackend/tests/README.md).Router factories (
build_categorized_admin_router, the OAuthbuild_*_router) survive mostly through OpenAPIsummaryanddescriptionstrings; leave those in the baseline.Also
receive_camera_upload,receive_preview_thumbnail_upload,claim_pairing_code,poll_pairing_status,proxy_hls). Either check their guards with theif False:method or move the logic into plain functions.just mutation-baselinereplaces the whole file and needs a full run.