Fixtures, check and preview
On this page (4)
Fixtures prove to you, the tool and a reviewer that your plug-in works without the network. They are outside the digest; check runs them every time.
Cut a real source down to the days you want rather than invent one; a source with no fixture fails with PLG-FIXTURE-SOURCE-MISSING. What fetch.mjs prints is held to records.jsonl byte for byte. Without context.json, check runs now, and may print differently next week; with it, today must be now's date in your zone, which catches the commonest time-zone mistake:
A case with records.jsonl is a later day, run with backfill false. A case with expect.json is a source that must fail, the most useful kind, and the portal asks for at least one: when your source changes shape, your fetcher must stop with a reason, not print nothing or the wrong column. exit is the code it must use (any non-zero if left out); reason, words its last stderr line must contain. Add one for each way your source has broken, or will:
check
The new case passes: its fetcher stops. Had it printed records, or stopped for another reason, it would fail with PLG-RUN-EXPECTED-FAILURE. check reads plugin.json against contract 1, the folder (named after the id, with a fetch.mjs) and its imports; finds a fixture per source; runs fetch.mjs on them; checks every record; compares with records.jsonl; runs each runs/<case>; checks your listing if you have one; and prints the digest. It stops at the first failing step with every problem so far (code, fix, link) and exits 0 or 1: put it in your CI as it is.
On your machine the fetcher runs as you, behind a guard: any way Node reaches the network throws (PLG-RUN-NETWORK), Node's permission model limits reads to the folder and its sources (PLG-RUN-READ-OUTSIDE), and your limits kill it (PLG-RUN-KILLED). That is a seat belt for your own code, not a sandbox for anyone else's: other people's code runs only in the Server's locked room.
preview
preview <id> draws each day with pluginDayRows, the function the app's day uses, so a row reads as it will for a reader (quickstart, How records look). --days A..B shows up to 62 days (three either side of today by default), --language es your Spanish names (dates and figures stay English, as in the app), --run <case> a runs/<case>, and --html <file> writes a page. One run cannot show Moved to … or a revision: those come from what the Server stored before.
probe
probe downloads each source once (https, your hosts only, within maxBytes), runs the fetcher and checks every record. Use it before you refresh a fixture; it is never part of a check. This site serves the almanac's sources, so you can probe it.
When check fails
Copy all of check's output: its code, fix and link are what an assistant needs (every code). The ones everyone meets once: