advisories folded in during QA: hook test for ['admin','jobs'] invalidation (DJ-4 AC), zone length check, nextRunAt = null for a corrupt row instead of a 500
—
Land: full gates
mvn verify: 1425 tests, 0 fail, LINE 96.82% (≥ 90%) · npm run test 481/481 · npm run lint 0 errors (3 old warnings in untouched files)
—
Gate 2 (owner)
push
—
CI + smoke
green: Funny App Build and Deploy, Deploy Frontend, Publish Docs · mock-test.sh 22/22 (does not cover /admin/jobs yet)
New table scheduled_job with 6 seed rows (api/src/main/resources/db/changelog/sql/202610190002-create-scheduled-job.sql). log-stats moves to 0 */5 * * * *. cleanup-old-videos is seeded disabled, as before (30 Feb never fired).
AppScheduler no longer has @Scheduled. JobRegistry maps names to its methods, and DynamicJobScheduler schedules them with TaskScheduler + CronTrigger, a per-job AtomicBoolean overlap guard, and try/catch per run. The wrong "10:10" log and "20 minutes" comment are gone.
Admin API /v1/funny-app/admin/jobs (web/AdminJobController.java):
GET is for ADMIN.
PATCH {name} and POST {name}/runs need SUPER_ADMIN + the ADMIN permission, with @AuditLog and @RateLimited.
Validation: cron must have 6 fields, the seconds field must be a single number (at most once per minute), max 64 characters; zone must be valid and at most 64 characters; an unknown name returns 404 and a running job returns 409.
Webapp: a new Admin tab "Scheduled jobs" (components/admin/AdminJobsTab.jsx), in en and vi. It is read-only for ADMIN. SUPER_ADMIN can toggle a job, edit its cron and use "Run now". It polls every 5 s while a job is running.
[A] DynamicJobScheduler.java:91: runNow returns 202 before the guard flag is set. The refetch right after can still show running=false, so polling may not start and "last run" stays stale until the next refresh. This is cosmetic.
[A] A "run now" on a disabled job is allowed by design (manual run), and a run that loses the race is still answered 202 and then skipped. Both are documented in the plan (DJ-3).
[A] The once-per-minute minimum still allows 0 * * * * * on sync-drive-videos. This is accepted: SUPER_ADMIN only, plus the overlap guard (plan Risks).