Order-email triage for NanoClaw: fetches order-related Gmail, maintains the orders SQLite table, and flags recent anomalies (cancellations/refunds, large purchases until delivered, overdue deliveries), with a cadence companion that runs it on a schedule. NanoClaw per-chat overlay tile.
72
90%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
nightly-order-sync-cursor.jsonPer coding-policy: stateful-artifacts: every stateful artifact ships a schema document next to its owner skill. This file is that document.
/workspace/group/state/nightly-order-sync-cursor.json (overrideable per-process via the NIGHTLY_ORDER_SYNC_CURSOR env var, used by tests).
tessl__nightly-order-sync (this skill). The cursor is written exclusively by scripts/stamp-cursor.py. No other skill writes it.
scripts/precheck-nightly-order-sync.py (this skill, but reader-not-writer). Per the rule, the reader does NOT migrate; on encountering an unsupported schema_version, it treats the row as "no usable prior state" (fail-open: wake the agent so the next stamp restores a current cursor).
{
"schema_version": 1,
"last_run": "2026-05-01T03:14:07Z"
}| Field | Type | Required | Description |
|---|---|---|---|
schema_version | integer | yes | Currently 1. Bump on shape change; only the owner script migrates. |
last_run | string | yes | UTC ISO-8601 with trailing Z. The wall-clock instant the most recent successful run reached Step 2 (stamp) after check-orders completed without a technical failure. |
wake_agent: true with reason: "no_cursor". The first successful run creates the file.wake_agent: false when now_utc - last_run < 72h, otherwise wake_agent: true.wake_agent: true). The next successful run stamps a fresh cursor that self-heals the corruption.If a future shape change is needed (new field, renamed field, semantic shift on last_run):
SUPPORTED_SCHEMA in stamp-cursor.py and SUPPORTED_SCHEMA_VERSION in the precheck.schema_version != supported, treats the row as "no usable prior state" until the owner stamps the new shape — exactly the rule's prescribed reader behaviour.Do NOT silently repurpose last_run to mean something different at the same schema_version.
messages.db tableThe cursor is a single per-installation singleton with no cross-skill writers and no cross-row queries. A SQLite table would add a state-NNN migration upstream for one row of one column — infrastructure cost without infrastructure benefit — and the filesystem variant is greppable from a host shell (cat, stat) when triaging a run that didn't fire. If a future epic consolidates per-skill cursors into a shared table, this artifact migrates along with the others.