Skip to content
Astera Technology

Define which triggers resume after a pause

Keep missed triggers and the declared catch-up rule explicit.

Download complete case notes and answer keys ↓

Set the decision and its input

The toy job pauses at5 and resumes25 with ten-minute cadence. Triggers10 and20 were missed. Under replay, both execute at25 and the next trigger is30. Under future-only, they are explicitly skipped and the next is30. “Resume” alone does not choose one.

Filled local test worksheet
CaseInput JSON
Base test{"mode":"replay","triggers":[10,20],"pause":5,"resume":25,"interval":10}
Download editable CSV ↓

Run the supplied comparison

The executable event list retains scheduled and actual times separately. Only the supplied local triggers are expanded; replaying this list performs no external action.

Faulty and required outputs
PathOutput JSON
Faulty path{"events":[{"scheduled":30,"actual":30}],"skipped":[10,20]}
Required path{"events":[{"scheduled":10,"actual":25},{"scheduled":20,"actual":25},{"scheduled":30,"actual":30}],"skipped":[]}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';

const run=function run(i,corrected=true){
    if(!['replay','future-only'].includes(i.mode))return {held:true};
    const missed=i.triggers.filter(t=>t>i.pause&&t<=i.resume),next=(Math.floor(i.resume/i.interval)+1)*i.interval;
    const replay=corrected&&i.mode==='replay';return {events:[...(replay?missed.map(scheduled=>({scheduled,actual:i.resume})):[]),{scheduled:next,actual:next}],skipped:replay?[]:missed};
  };
const cases=[{"input":{"mode":"replay","triggers":[10,20],"pause":5,"resume":25,"interval":10},"corrected":false,"expected":{"events":[{"scheduled":30,"actual":30}],"skipped":[10,20]}},{"input":{"mode":"replay","triggers":[10,20],"pause":5,"resume":25,"interval":10},"corrected":true,"expected":{"events":[{"scheduled":10,"actual":25},{"scheduled":20,"actual":25},{"scheduled":30,"actual":30}],"skipped":[]}},{"input":{"mode":"future-only","triggers":[10,20],"pause":5,"resume":25,"interval":10},"corrected":true,"expected":{"events":[{"scheduled":30,"actual":30}],"skipped":[10,20]}},{"input":{"mode":"future-only","triggers":[10,20,30],"pause":5,"resume":30,"interval":10},"corrected":true,"expected":{"events":[{"scheduled":40,"actual":40}],"skipped":[10,20,30]}},{"input":{"mode":null,"triggers":[],"pause":5,"resume":25,"interval":10},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Download runnable example ↓

Choose from the boundary evidence

Future-only is strictly after the resume moment: resuming exactly30 makes the next40. Unknown catch-up mode is held.

  1. Identify missed triggers
  2. Apply the declared resume origin
  3. Retain original and execution times

Catch-up requires an explicit policy before external effects are considered.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
declared future-only origin{"mode":"future-only","triggers":[10,20],"pause":5,"resume":25,"interval":10}{"events":[{"scheduled":30,"actual":30}],"skipped":[10,20]}
strictly later tick at exact resume{"mode":"future-only","triggers":[10,20,30],"pause":5,"resume":30,"interval":10}{"events":[{"scheduled":40,"actual":40}],"skipped":[10,20,30]}
resume rule unknown{"mode":null,"triggers":[],"pause":5,"resume":25,"interval":10}{"held":true}
Download editable CSV ↓

How are the two missed base triggers treated under replay?

Show the worked answer

They retain scheduled10/20 but both execute at25. Neither is silently dropped or relabelled as scheduled25.

Related resources