Moved my jobs table from : Record<string, Job> to satisfies to keep when literal. Now tsc flags only the helper entry. Sunday, rotate-logs silently skipped ("nightly: 1 of 2 ran"). Same problem or two? (Not sure.)
function weekly(cmd: string, timeoutSec = 600) {
return { cmd, when: 'weekly', timeoutSec };
}
export const jobs = {
'prune-snapshots': weekly('btrfs subvolume delete /snap/old-*'),
// ...
} satisfies Record<string, Job>;
// plan.ts
nightly: ['backup-db', 'rotate-logs'],
// run.ts
const job = (jobs as Record<string, Job>)[name];
if (!job) { log.debug(`no job called ${name}, skipping`); continue; }