{ "name": "event.task.state \u2014 the daemon auto-pauses on a 401", "description": "The CORE-auto-pause case ADR 0013 (docs/adr/) needs a wire signal for: the daemon paused this task on its own initiative -- not because the user clicked pause, a schedule window closed, or admission control reconciled a lowered cap -- and error explains why. Compare download.pause.json, where the same target state (paused) carries error: null because that pause was requested.", "notification": { "jsonrpc": "2.0", "method": "event.task.state", "params": { "taskId": "8c1d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f", "state": "paused", "previousState": "connecting", "summary": { "taskId": "8c1d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f", "filename": "film.mkv", "saveDir": "/home/sami/Downloads/Video", "url": "https://example.org/film.mkv", "effectiveUrl": "https://example.org/film.mkv", "sizeBytes": 1503238553, "downloadedBytes": 0, "state": "paused", "speedBps": 0, "etaSeconds": null, "resumable": true, "segments": 4, "categoryId": "video", "queueId": null, "queuePosition": null, "description": null, "createdAt": "$isoDate", "lastTryAt": "$isoDate", "completedAt": null, "error": { "code": "auth_required", "message": "the server asked for credentials (401)", "httpStatus": 401, "retryable": false, "cause": null, "attempt": 1, "nextRetryAt": null } }, "error": { "code": "auth_required", "message": "the server asked for credentials (401)", "httpStatus": 401, "retryable": false, "cause": null, "attempt": 1, "nextRetryAt": null } } }, "assertions": [ "error is set here specifically because the daemon paused this task itself, not the user -- the trigger is event.auth.required on the same task shortly before", "the scheduler must not resume this task on a schedule window or queue restart: only download.provideAuth (or the user explicitly resuming) may clear it -- resuming blindly re-fails immediately and looks like a flapping bug", "a client distinguishes an auto-pause from a deliberate one by this field being non-null, not by inspecting previousState or any other heuristic" ] }