Yolk SDK
Connectors

Todoist conformance

Experimental Todoist conformance cases for tests and hand-run practice-account checks.

Todoist actions are documented in the connectors package guide and the integrations reference. This page lists the experimental conformance cases only.

Conformance cases

Experimental. For tests and hand-run checks against a practice Todoist account.

@yolk-sdk/connectors/todoist/conformance exports conformance cases for @yolk-sdk/conformance/runner. Every case runs the real connector actions over the connector ports against the Todoist API v1 (https://api.todoist.com/api/v1), and checks one wire claim the connector relies on. The claims are as currently understood; none is observed live yet.

Case idSafetySeedsClaim (as currently understood)
todoist.tasks.list-cursor-pagingreadpagingProjectIdlimit=2 answers at most two tasks and a string next_cursor; the cursor with the same project_id returns the rest, ending with next_cursor: null
todoist.errors.not-found-envelopereadnoneAn unknown task id answers HTTP 404 (todoist_not_found) with a JSON error string that ends the connector message (both unverified)
todoist.labels.task-labels-are-namesreadlabeledTaskIdA task's labels are label names, each the name of a personal label todoist.list_labels returns
todoist.projects.list-cursor-pagingreadpagingProjectIdThe leftover lookup's limit=200 listing answers every project once, the paging project among them; limit=1 pages chain to the same projects
todoist.tasks.lifecycle-closewrite-reversibleworkProjectId, runIdCreate, get, and update answer the task; close_task answers 2xx; list_tasks then omits the closed task (active tasks only)
todoist.tasks.due-dateswrite-reversibleworkProjectId, runIddue_date and due_datetime, as the connector sends them, answer a task whose due.date starts with 2030-01-15 (timed form unverified)
todoist.projects.parent-idwrite-reversibleworkProjectId, runIdcreate_project with a parent answers parent_id, and get_project reads it back
todoist.projects.delete-then-not-foundwrite-reversibleworkProjectId, runIdAfter delete_project, get_project answers 404 and a task that was in it answers not found (both unverified)

Claims no live run has settled yet, marked "(unverified: ...)" in each case's wire:

  • An unknown, well-formed task id answers HTTP 404, not 400.
  • The API v1 error body is { error, error_code, error_extra, error_tag, http_code }; the connector uses the first non-empty string of error, message, error_description, error_tag.
  • A timed due (due_datetime 2030-01-15T12:00:00Z) keeps its day at the start of due.date in the account's time zone (noon UTC stays on that day from UTC-12 to UTC+11). Use a practice account whose time zone is in that range: in UTC+12 to UTC+14 the timed due can land on the 16th and the case fails without any connector fault.
  • A deleted project answers 404 rather than a body marked is_deleted.
  • Deleting a project deletes its tasks.
  • The project listing includes sub-projects (the leftover lookup needs it for the case projects under the work project).

The due-dates case checks that the due was applied, and nothing more: after each call the answer's due must be an object whose date starts with 2030-01-15, so a due field Todoist ignored (for example an answer with due: null) fails it. TodoistTask.due reaches hosts untyped and the connector reads nothing inside it, so the case does not claim how Todoist represents a due (is_recurring, or where a timed due keeps its time).

The last two claims matter to the write cases' own cleanup, in different ways:

  • Project absence is verified by every cleanup. Each write case deletes its project by id and then requires todoist.get_project to answer not found. If a deleted project answered anything else, every write case would report TodoistConformanceRestoreFailed (check by hand) rather than pass silently.
  • Task removal is not. The cleanup never looks for the tasks a case created: it relies, unverified, on Todoist deleting a project's tasks with it. Only the delete case checks that, by looking up its task after deleting the project; if the task survived, that case fails its claim (a mismatch, not a restore failure), and the other write cases' cleanups would still pass while leaving their tasks behind. The delete case's failure names the surviving task's id; look for yolk-conformance task tasks by hand if it ever fails that way.

TodoistConformanceConfig holds the seed ids and the runId. Cases never hard-code account data, and a missing seed fails the case with a precondition: mismatch before any request. Credentials bind through todoistConformanceIntegration (todoist.api_token, credential ref todoist.conformance). The personal labels on the labeledTaskId task must be listed by todoist.list_labels (shared-only labels are not).

Every write case creates its own project yolk-conformance-<runId>-<case> under workProjectId and works only inside it. The runId seed makes that namespace unique per invocation: the fixtures replay with run-synthetic, and the live runner generates a fresh random id every time (it is never a flag). The cleanup is attempted and verified under these conditions:

  • The project create request, its decoding, and the registration of the created project's id run together without interruption, and so does every later write (task create, update, close, project delete): an aborted request could otherwise land after the cleanup. Neither the runner nor the bridges set a request timeout, so a hanging request delays an interruption until it answers.
  • A definitive create rejection (HTTP 4xx other than 408, for example the account's project limit) proves the case created nothing: it fails and deletes nothing.
  • An ambiguous create (a transport or decoding failure, no status, HTTP 408, or HTTP 5xx) may still have created the project, and the case never learned its id: it fails with TodoistConformanceActionFailed (createOutcome: 'unknown') naming the exact project to check by hand. Project names are not unique, so the case never deletes by name. An ambiguous task create names the task the same way; it would sit inside the case project, which the cleanup deletes.
  • After a successful create, the cleanup deletes the project by id (a not-found answer proves it gone) and checks that todoist.get_project then answers not found. It also runs after a failed assertion or a fiber interruption. A failed cleanup fails with TodoistConformanceRestoreFailed naming the project and its id.
  • A create that answers a project without the requested run-scoped name or with the id of a seeded project, or a task outside the case project, is never deleted: the case fails with TodoistConformanceCleanupRefused naming it. The project's parent_id is not an ownership rule: a fresh project answered under another parent fails the parent-id claim and is still deleted by id.

Todoist's free plan limits the number of active projects; each write case holds one extra project while it runs.

In the live runner, the first SIGINT or SIGTERM (Ctrl-C) interrupts the run fiber, and the running case's cleanup is attempted before the process exits; no further case starts. The cleanup is not confirmed:

  • A cleanup that fails, or a create whose outcome is unknown, while the case is being interrupted prints its full message, with the exact project, as a WARN line (through the case's ConformanceCleanupReporter). The run still ends as a plain interruption (exit code 130): the WARN line is the record of the problem.
  • After the interruption, the runner repeats the leftover lookup below and print a WARN line for every yolk-conformance-run-* project still present.

One Ctrl-C reaches every process of the foreground group, and the wrappers relay it, so further signals within a second count as the same keypress. A signal a second or more later exits at once and may skip the cleanup, as does killing the process. Run live runs as pnpm conformance:todoist … or ./node_modules/.bin/tsx scripts/run-todoist-conformance.ts …. Avoid pnpm exec tsx …: on Ctrl-C it returns to the prompt at once, so later lines print after the prompt; stop the runner with kill -TERM <pid>, using the pid the first-signal message prints.

Before any write case, the runner lists projects read-only (findTodoistConformanceLeftovers) and prints a WARN line for each active project whose name starts with yolk-conformance-run- (todoistConformanceRunProjectPrefix) that an earlier run left behind, wherever it sits; a failed lookup prints its failure code. The lookup is bounded, not exhaustive: it reads at most 20 listing pages of 200 projects each. It never deletes them. Check each one, and delete it by hand when no run is using it. Every valid runId starts with run-, so the lookup covers every run.

The shipped fixtures are synthetic (evidence: 'unverified'). In this repository, pnpm conformance:todoist dry-runs by default; --live --owner-approved --account <label> (refused whenever CI is non-empty) needs TODOIST_API_TOKEN and the seeds, --allow-writes reversible adds the write cases, and --record stages verified recordings only in the gitignored .conformance-recordings/todoist/ for manual scrubbing and promotion. There are no write-irreversible Todoist cases. See Conformance APIs for the bridges.

For offline tests, the experimental Todoist emulator (@yolk-sdk/emulators/todoist) is a stateful, fixture-only stand-in that passes these cases through the real connector actions over the connector ports. The project paging case records the leftover lookup's project listing, so against the emulator the lookup runs: it finds nothing on the default seed and reports a yolk-conformance-run-* project the emulator holds.

On this page