Skip to content
Astera Technology

Specify whether a job deadline means finished

Compare the required event with supplied start and completion observations.

Download complete case notes and answer keys ↓

Set the decision and its input

The fictional deadline is minute60, measured from the supplied origin. The run starts59 and finishes64. “Starts by60” passes; “output finished by60” fails. This buying requirement needs the latter, so an early start cannot establish fit.

Filled local test worksheet
CaseInput JSON
Base test{"start":59,"finish":64,"deadline":60}
Download editable CSV ↓

Run the supplied comparison

The local programme evaluates both observed events and keeps their meanings separate. These are supplied synthetic timings, not a measured vendor response guarantee.

Faulty and required outputs
PathOutput JSON
Faulty path{"startFits":true,"finishFits":false,"requirementSatisfied":true}
Required path{"startFits":true,"finishFits":false,"requirementSatisfied":false}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';

const run=function run(i,corrected=true){
    if(i.start===null||i.finish===null||i.deadline===null)return {held:true};
    const startFits=i.start<=i.deadline,finishFits=i.finish<=i.deadline;
    return {startFits,finishFits,requirementSatisfied:corrected?finishFits:startFits};
  };
const cases=[{"input":{"start":59,"finish":64,"deadline":60},"corrected":false,"expected":{"startFits":true,"finishFits":false,"requirementSatisfied":true}},{"input":{"start":59,"finish":64,"deadline":60},"corrected":true,"expected":{"startFits":true,"finishFits":false,"requirementSatisfied":false}},{"input":{"start":59,"finish":60,"deadline":60},"corrected":true,"expected":{"startFits":true,"finishFits":true,"requirementSatisfied":true}},{"input":{"start":59,"finish":null,"deadline":60},"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

Finishing exactly60 passes the inclusive requirement. Missing completion observation is held rather than inferred from start.

  1. Name the deadline event
  2. Compare its observed time
  3. Retain other timing separately

A missing finish time remains unknown.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
completion at the deadline{"start":59,"finish":60,"deadline":60}{"startFits":true,"finishFits":true,"requirementSatisfied":true}
finish observation absent{"start":59,"finish":null,"deadline":60}{"held":true}
Download editable CSV ↓

Can the base run meet the required completion deadline?

Show the worked answer

No. Start59 fits but finish64 exceeds60. Record the required completion event, not just the easier start claim.

Related resources