# Schedule execution, recovery and real Studio controls

24 September 2026. Local acceptance in an isolated training organization using real MongoDB, Bull/Redis, repository APIs, a schedule worker and Chromium. No external messages or payments. The worker uses a separate queue prefix (`learner-review-schedules-20260924`) so unrelated application jobs are not consumed. This is runtime isolation, not mocked queue behavior.

## Confirmed workflow

- Created an internal note and future one-off action through normal authenticated repository APIs. The delayed job had three attempts and `removeOnComplete: true`.
- After due time: schedule `done`, target `ready`, one successful activity and statistics HTTP200.
- A second note's malformed target omitted datatype. The job failed three attempts with the datatype error; target stayed `waiting`.
- Repaired that same schedule, preserving its record fields and giving it a new future date. After due time: same schedule `done`, target `reviewed`, one successful activity. The recovery target was not reused in later experiments.
- Chromium Pause saved `stop`, removed the delayed job, and left the separate target `waiting` after due time.
- Chromium Delete initially removed the record but left its queue job. The worker skipped it at due time; this exposed the missing direct-deletion notification.
- After repair, a new Chromium Delete returned a missing record and zero queued jobs before due time. The target remained `waiting` after due time.

## Application changes

`modern-schedule-app.tsx` now reads the actual `{runs}` API response and normalizes activity `success/error` for the existing completed/failed display. It handles the queue stats array, counts canonical done/stop/error statuses, considers one-off jobs during sync checks, and shows a future start date when no nextRun exists. Run details display the actual saved activity. Pause/resume perform authenticated writes, delete uses a confirmation and the real repository delete request. Orphan handling no longer claims removal without a request.

The former details/settings route had no schedule schema. The screen now reuses `ScheduleEditor` from `schedule-manager.tsx`, retaining the full raw record for edits and explicitly marking new records. Save failures keep the editor open. The settings drawer saved a fresh time on the paused record; Play requeued it and the worker executed it at07:56UTC. Its marker changed only after this intentional resume. The original pause-after-due proof remains separately captured. The final editor also exposes target type/ID and refuses missing targets.

`repository.crud.service.ts` now sends the schedule deletion command after deleting a schedule record. The existing command handler cancels its keyed start/end/cron jobs. The first live cleanup check caught reversed command arguments; this was corrected and retested with a fresh job. Evidence11 is the failed intermediate test, not acceptance. Evidence12 is the final passing result.

## Evidence

[First result](assets/jobs-local/02-first-result.json) · [Malformed target and repair](assets/jobs-local/05-failure-repair.json) · [Immediate repaired target readback](assets/jobs-local/06-repair-result.json) · [Pause/delete before due](assets/jobs-local/08-controls-before.json) · [After due](assets/jobs-local/08-controls-after.json) · [Fixed delete before due](assets/jobs-local/12-delete-final-before.json) · [Fixed delete after due](assets/jobs-local/12-delete-final-after.json).

[Actual overview](assets/jobs-local/07-overview-fixed.png) · [Actual run history](assets/jobs-local/09-runs-fixed.png) · [Actual run details](assets/jobs-local/10-run-details.png).

The existing schedule guard fixture passes 98 checks after its dependency stubs were updated for newly imported services. Three direct-deletion tests execute the extracted current delete method with the actual schedule-command constructor: cancel after deletion, leave unrelated datatypes alone, and do not claim cancellation when database deletion fails. [Deletion tests](assets/jobs-local/delete-tests.txt). Backend full compilation passed. No production deployment is required for this review.

Pause/delete checks cover future work. They cannot undo an external action already in progress. Recurring cron delivery and provider actions were not executed in this one-off course.

[Resume before execution](assets/jobs-local/08-controls-resumed.json) · [Resume execution](assets/jobs-local/08-controls-resumed-after.json) · [Five UI regression cases](assets/jobs-local/ui-tests.txt).

Final Chromium acceptance: New Schedule refused an incomplete target without saving; supplied note/type, title, Update Status/ready, future date and stop saved. Reload and reopen retained all fields. Title-only schedules now remain visible/searchable. [Editor screenshot](assets/jobs-local/15-target-editor-reopened.png) · [Field readback](assets/jobs-local/15-editor-readback.json). No page exceptions in the verified run.
