fieldmesh

modules/board/ — the farm's page (layer 4)#

The thinnest slice of an app (spec v0.1 §11, layer 4). A notification says that something happened; board.py shows what is still the case, on one read-only page per language:

Like the notifier, it reads any module's decisions without importing any module (rules.render), and it never writes the log. Its grant reads decisions, notifications and acknowledgements, the names of what decisions are about, and the series its page shows.

It says when it was made. A page that stopped updating looks exactly like a quiet farm, the failure §4.2 forbids for sensors ("no news is not good news"). So the page:

For a phone in a field:

Everything a farm or a module wrote, labels included, is escaped.

python3 -I modules/board/board.py --socket /run/fieldmesh/modules.sock \
    --config board.json --out /var/lib/fieldmesh-board --serve 127.0.0.1:8080

board.json names the farm, its time zone, the languages to write pages in, the units its alerts are said in ("metric", the default, or "us"), and the names of the people acknowledgements refer to by id (names only; reaching people is the notifier's business):

{"farm": "Harrow Bend", "timezone": "America/Chicago", "languages": ["en", "es"], "units": "us",
 "people": {"0192…": "María", "0192…": "Sam"},
 "series": ["<trough level datastream id>", "<hoop house air datastream id>"]}

The series it shows are the ones its grant names (modhost.py grant --datastream …); a series it was not given shows as having no reading, never as an error. It keeps what it reads of the log to what a page needs: on each question its last two answers, every decision of the last day, and what was sent about those. A board that runs for months holds days of decisions, and the page is the same (tested).

Serving it:

Code AGPL-3.0-or-later (LICENSE); strings in packs/ under the board. prefix, with the Spanish an unreviewed draft.

Next: a certificate story for the farm's own network that does not ask a farmer to run a certificate authority.