Reetie Cost Calculator

Home Fyrjournal

Fyrjournal

A standard build task with a baseline test and a follow-up change.

Compare hands-on tests

Test schedule and simulated partner

Put the files in the same folder in an isolated evaluation environment. Run Python 3.11 or later and pass the candidate's local start command after --. Choose base to test scheduling and recovery or change to test review and regressions.

python3 verify.py base -- ./start-candidate
python3 verify.py change -- ./start-candidate

Baseline test

6 checks

Version fyrjournal-grund-03 · Method reetie-capability-1 · Dry run before freezing

Original prompt
Build a recurring delivery exception journal for a synthetic operator. Use only the test partner and its clock. Use any supported technology and a durable store in the isolated test environment. Keep the candidate running so the scheduler progresses without a person triggering each run. It must observe clock changes and resume within six seconds in this accelerated exercise.

The harness supplies FYRJOURNAL_PARTNER_ORIGIN, FYRJOURNAL_LISTEN, FYRJOURNAL_STATE_DIR, FYRJOURNAL_OPERATOR_TOKEN, FYRJOURNAL_FIRST_DAY, and FYRJOURNAL_PHASE. Read GET /clock for a JSON object with an offset-aware now timestamp. Starting at the supplied first day, collect each due calendar date once in chronological order at or after 08:00 Europe/Stockholm. GET /shipments?date=YYYY-MM-DD returns an array of records with id and status. Valid IDs consist of lowercase letters, digits and hyphens, beginning with a letter or digit and with a maximum length of 63. IDs must be unique within the response. Valid statuses are late and on_time. A record may carry a boolean requires_review flag. Validate the entire list before importing that date. An invalid list holds the date for retry and records source_error in last_error.

For each late shipment, post a partner note to POST /notes with exactly date, shipment_id and message. Use Late delivery as the message and fyrjournal-v1/{date}/{shipment_id} as the Idempotency-Key every time. Persist the attempt before sending and mark the note posted only after receiving a receipt. The partner may fail before writing, or may commit and lose the reply. A replay returns the prior receipt for the same key. Neither a restart nor a retry may add a second effective note or advance an uncollected date.

Expose GET /healthz (200 when running), GET /status and PUT /control with JSON {"paused": true} or {"paused": false}. Require the provided Bearer token on the journal and control. GET /status returns paused, next_day, last_error, notes and events. Each note includes day, shipment_id, state, attempts and receipt. States for this phase are pending and posted. Events have kind, day and shipment_id where applicable. Record one collected event for each imported date. The pause survives restart and stops business reads and writes until resumed. Catch up missed days in chronological order. Keep using the test environment during retries and record which transitions, receipts and restarts the operator can verify.

Use English for all user-facing copy and submitted documentation.
Requirements and expected results
IDRequirementCapability levelExpected resultEvidence
A01Scheduled run 2 There is no early read. Only the late shipment produces a journal note with the right context and partner receipt.Observed result, date, and evidence for the tested artifact
A06Invalid source response 3 A clear source error is recorded. No partial import or notes occur. The same date can be processed after repair.Observed result, date, and evidence for the tested artifact
A02Restart after processing a day 4 The day is collected once, and the posted note is not sent again.Observed result, date, and evidence for the tested artifact
A03Recover from a lost reply 4 Two attempts use the same idempotency key. The partner records one effect and the local journal stores the right receipt.Observed result, date, and evidence for the tested artifact
A04Daylight saving and a temporary partner failure 4 There is no work before the local due time. Retrying recovers and creates one effect.Observed result, date, and evidence for the tested artifact
A05Durable pause and chronological catch-up 4 No business reads or writes occur during the pause. The two missed days run in order.Observed result, date, and evidence for the tested artifact

Change and regression tests

9 checks

Version fyrjournal-andring-03 · Method reetie-capability-1 · Dry run before freezing

Original prompt
Continue from your accepted first revision. Retain all schedule, pause, validation and retry behavior. When a late shipment has requires_review=true, add it as awaiting_review and hold its external note until a decision is recorded. Keep automatic processing for other late shipments.

Add POST /review with date, shipment_id and decision (approve or reject). Require the same Bearer operator token. Return 403 for missing or incorrect operator authorization. A recorded or identical repeated decision returns 200. Conflicting decisions return 409. Save one approved or rejected event with the day and shipment ID. Approval uses the existing durable delivery path and same idempotency key. A rejected shipment stays rejected across restarts. Record both decisions and keep the original regression cases executable.

Use English for all user-facing copy and submitted documentation.
Requirements and expected results
IDRequirementCapability levelExpected resultEvidence
R-A01Scheduled run 2 There is no early read. Only the late shipment produces a journal note with the right context and partner receipt.Observed result, date, and evidence for the tested artifact
B01Hold notes for review 3 Both notes await a decision and the partner receives zero write attempts.Observed result, date, and evidence for the tested artifact
B02Authorization and approval 3 The unauthorized attempt is rejected without effect. Repeating approval produces one note and one decision record.Observed result, date, and evidence for the tested artifact
R-A06Invalid source response 3 A clear source error is recorded. No partial import or notes occur. The same date can be processed after repair.Observed result, date, and evidence for the tested artifact
B03Rejection survives restart 4 The rejection and decision record survive. The conflicting decision is rejected, and the partner receives only the first note.Observed result, date, and evidence for the tested artifact
R-A02Restart after processing a day 4 The day is collected once, and the posted note is not sent again.Observed result, date, and evidence for the tested artifact
R-A03Recover from a lost reply 4 Two attempts use the same idempotency key. The partner records one effect and the local journal stores the right receipt.Observed result, date, and evidence for the tested artifact
R-A04Daylight saving and a temporary partner failure 4 There is no work before the local due time. Retrying recovers and creates one effect.Observed result, date, and evidence for the tested artifact
R-A05Durable pause and chronological catch-up 4 No business reads or writes occur during the pause. The two missed days run in order.Observed result, date, and evidence for the tested artifact