CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

tessleng/schedule-management

Create and migrate repo-defined Tessl schedules in a project's tessl.json. Turns a plain-language task and cadence into a validated schedules entry, optionally authors its repo-local skill, and moves an existing schedule made in Tessl into version control, keeping its Loop id and history. Needs a Tessl CLI whose tessl loop commands read the Loop API.

1.03x
Quality

98%

Does it follow best practices?

Impact

99%

1.03x

2 of 3 eval scenarios. Add 1 more for a full score.

SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

check-synced-schedule.mdskills/schedule-setup/references/

Checking a synced schedule

Find the Loop

  1. Read tessl api /v1/projects/<project id> and note data.attributes.workspaceId. The project is the one tessl.json names, and its id is the backend UUID, as TESSL_PROJECT_ID or the project's page gives it. This workspace id is the one capacity is read for, whether or not the Loop is found.
  2. Run tessl loop list --project-id <project id> --all --json. A non-zero exit means there is no listing: report the error.
  3. The schedule's Loop has attributes.source.kind repo, a null archivedAt, project.id the project, and a trigger whose name is the schedule's name. Check where it is declared, from source.declaredIn and the Loop's own attributes.key (there is no source.key):
    • an inline schedule (action is an object with no use) has source.declaredIn schedules and key the schedule's name;
    • a schedule whose action names an entry of actions (directly or with use) has source.declaredIn actions and key that action's name.
  4. When no Loop matches, say the schedule has not synced, and still report capacity below.

Check it

Run tessl loop view <loop id> --json and check, under data.attributes:

  • source.commit.sha is the commit the user pushed, or a later one on the default branch that still carries the entry (sync records the last commit that changed tessl.json, which can be older than the branch head);
  • it is still the Loop step 3 found: source.kind repo, archivedAt null, project.id the project, and the same source.declaredIn and attributes.key;
  • a trigger with kind cron and name the schedule's name, whose action is the intended action, with the cron and timezone the file compiles to;
  • the entry of actions whose name is that trigger's action exists;
  • status is active, and so is that action's own status.

When all hold, the schedule is synced and active. That does not show it has fired, or that its next fire is due:

  • nextRunAt is the Loop's next fire across all its crons, so a time there does not say which cron it belongs to. A paused Loop can still show one; it does not fire then;
  • a null nextRunAt only means the readback carries no recorded time, which can follow a failed read of the clock. On an active Loop it does not show that this cron is unarmed or that no fire is due: say no next fire is recorded and leave both open;
  • a successful project sync does not show which triggers are armed.

To say it fired, find a run in tessl loop runs <loop id> --json --limit 100 that has a dispatch with all of:

  • triggerName the schedule's name;
  • source schedule (a cron tick, not manual, api or event);
  • loop.id the Loop's id;

and an attributes.result.launch.id. A run that matches the dispatch but has a null result was waiting, refused or cancelled before it launched: it is not a fire. When no run qualifies on that page and links.next is set, say the search stopped there.

lastRunAt counts a launch from that trigger whatever asked for it, a Run now included, and lastRefusal is its last refusal. Neither shows a cron fire on its own.

Capacity

Read tessl api '/experimental/loops/capacity?workspaceId=<workspace id>' and report data.attributes.activeCount of maxActiveSchedules. It counts active cron triggers in the whole workspace: a Loop with two active crons uses two, a paused Loop or an event-only Loop uses none. The cap differs between workspaces.

The count is the state now. It does not explain why an earlier sync skipped a schedule; the project's Loops tab shows the last sync's result. When the read fails, say the count is unavailable.

When the Loop is missing after a push, the usual causes are: the push was not to the default branch, the named environment does not exist in the workspace, or the workspace had no free cron slot. Point the user at these rather than re-editing the file.

README.md

tile.json