CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

jbaruch/nanoclaw-host

Host rules and skills for NanoClaw deployment, image package inventories, private browser access, plugin promotion, staging and upstream updates.

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

run-ledger-contract.mdskills/host-contracts/references/

Run Ledger Contract

Authority-of-record for task_occurrences in /workspace/store/messages.db, the host's scheduled-run ledger (jbaruch/nanoclaw#1024), under coding-policy: stateful-artifacts.

Owner and schema

  • Owner: the jbaruch/nanoclaw scheduler, through src/db-task-occurrences.ts and its state migrations; no container skill writes or migrates the table
  • Schema of record: src/state-migrations/state-022-task-occurrences.ts and state-024-task-occurrences-schema-version.ts in jbaruch/nanoclaw
  • One row per occurrence, keyed (task_id, scheduled_for); scheduled_for is the task's next_run at dispatch
  • A cadence-registry task's task_id is cadence-registry::<group>::tessl__<skill>
  • Every timestamp is UTC ISO with milliseconds and Z (2026-10-19T12:00:00.000Z)
  • Every record carries schema_version 1; a shape change bumps it in a new state migration

Record fields

FieldTypePresence and meaning
group_folderTEXTalways; the task's group when the occurrence started
attemptsINTEGERalways, 1 or more
started_atTEXTalways; the latest attempt's start
progress_atTEXTNULL until the run streams output
ended_atTEXTNULL while running
stateTEXTrunning, then completed, failed, killed or unknown
errorTEXTNULL on running and completed
delivered_message_idsTEXTJSON array of channel message ids; [] by default
unverified_sendsINTEGERsends that returned no message id; 0 by default
  • completed is final; a retry restarts a failed, killed or unknown occurrence as running and counts attempts
  • unknown means the host stopped before the run finished, never success

Readers

  • jbaruch/nanoclaw-admin heartbeat precheck: skips a missed-task recovery the ledger covers
  • jbaruch/nanoclaw-admin system-audit: reports unverified sends
  • jbaruch/nanoclaw-admin Socials: identifies the current scheduled occurrence for X discovery
  • Each reader names the versions it accepts and counts only rows of those versions
  • A row of another version is no usable prior state for that reader, and the reader says so
  • A missing table or column, or a query error, makes the ledger unreadable: heartbeat decides on the follow_me cursors alone and says so on stderr; system-audit records an audit_errors entry
  • Readers are read-only and never migrate

Calendar reminder repair

  • The Admin Calendar precheck opens the native database with SQLite mode=ro. For each version-1 scheduled_reminders row, it checks for an occurrence with that row's exact task_id, even if the scheduled task is gone. It requires only task_id and schema_version from the ledger. A version-1 row in any state means the scheduler claimed an attempt before delivery. Delivery remains unproven. Scheduler dispatch
  • A matching claim, a matching legacy run log (see rules/task-run-log-reader.md), a completed once-task, or a non-NULL scheduled_tasks.last_run or last_result excludes the reminder from task-drift repair. If any matching occurrence has a version other than 1, the precheck writes the event ID and unsupported version to stderr and holds that reminder while checking the others. Independent Calendar changes can still wake the agent. Precheck query and diagnostic
  • Missing required schema or a failed read leaves repair unavailable. The precheck reports the SQLite error on stderr and exits 1 without a wake payload. Reader SQL and error path
  • The precheck selects candidates only. The host rechecks dispatch history for the recorded, current stable and previous stable task IDs inside the per-event write transaction, so a claim made after the precheck can still block rearming. Host history query · Transaction

Socials scheduled X discovery

  • The Admin Socials reader runs only for x-poll --scheduled, after the existing registered Main and owner identity checks. It requires the Host-provided NANOCLAW_GROUP_FOLDER and opens /workspace/store/messages.db with SQLite mode=ro.
  • Read scheduled_for and schema_version from task_occurrences where task_id is exactly cadence-registry::<group>::tessl__social, group_folder is exactly that same group, and state = 'running'. Read up to two matches without filtering by version. Require exactly one match, then require version 1 and a valid UTC ISO timestamp with exactly three fractional digits and a literal Z. Use that exact scheduled_for as the occurrence key.
  • Missing group identity, zero matches, multiple matches (even across versions), unsupported version, malformed timestamp, or an unreadable ledger makes scheduled X discovery unavailable. Report the reason in the poll's unavailable result and skip xAI discovery. Independent X DM polling continues. Manual x-poll does not consult the ledger or run xAI discovery.
  • The occurrence key identifies a scheduler claim. It is not proof of completion, delivery, or approval. Admin owns its discovery claim in Socials state and persists it before calling xAI. An equal or older occurrence does not trigger another call. The reader never writes or migrates the Host ledger.

Admin #1096 implementation

Rollout

  • Owner and readers ship through separate pipelines: the host deploy and the admin plugin publish
  • A version bump follows coding-policy: stateful-artifacts Cross-Pipeline Schema Bumps
  • On a version bump, heartbeat can drop a suppression, system-audit can add a finding, Calendar holds reminders with unsupported occurrences, and Socials reports scheduled X discovery unavailable for an unsupported occurrence.

skills

README.md

tile.json