Skip to content

issue-tracker: todoist fixture recorder, replay scenario and adapter check - #65

Merged
michielbdejong merged 1 commit into
mainfrom
claude/issue-46-todoist-fixture
Sep 23, 2026
Merged

michielbdejong merged 1 commit into
mainfrom
claude/issue-46-todoist-fixture

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

Draft. Depends on #48, and is based on its branch (claude/atomic-plugins-issue-43-1b43ea). Rebase onto main once #48 merges.

This covers everything for the todoist mock-proxy fixture except the step that needs a live Todoist account. Following #48's layout, all files live in the issue-tracker plugin folder:

  • integrations/issue-tracker/fixtures/todoist/record.mjs is the recorder.
    • It records document.yaml from the real proxy (https://localthought.io/catalog/todoist.yaml, which is public and needs no token).
    • With TODOIST_TOKEN set, it also records /api/v1/projects and /api/v1/tasks page by page into api/GET__api__v1__<collection>__page-<n>.json, plus api/meta.json.
    • It sends only GET requests, and the token is never written to disk.
    • It applies the redaction list, which it exports as REDACTIONS and documents in its file header. IDs become consistent fakes (task-1, project-2), and user-written text and labels are replaced.
    • It fails closed: any string field it doesn't recognise is redacted and listed in meta.json.
    • It formats its output with the repo's oxfmt.
  • document.yaml was recorded on 2026-09-23. The only change from the served file is oxfmt re-indenting YAML lists.
  • scenario.mjs implements the fixtures/index.mjs interface. It replays pages by cursor, serves single rows by id from the recorded pages, and returns 403 on writes, like the real read-only (data:read) catalog.
  • integrations/issue-tracker/todoist-fixture.test.ts runs in the issue-tracker lane's unit tier.
    • Two checks always run: the document is present and read-only, and the redactor leaks nothing.
    • Once api/ exists, five more check that every field localthought/todoist.ts reads is present and correctly typed, run the rows through todoistProjection, replay pagination, and check that todoist is registered.

todoist is not registered in integrations/localthought/fixtures/index.mjs yet. An unrecorded fixture must not be served, so mock-proxy.test.mjs still uses todoist as its example of a missing fixture.

Verified

Against a local copy of atomic-server at the pinned .atomic-server-ref:

  • issue-tracker vitest: 7 passed, 5 skipped. Typecheck passed. mock-proxy.test.mjs: 3 of 3 passed. oxlint and oxfmt are clean on integrations/issue-tracker.
  • With a stubbed Todoist API and todoist registered locally, all 12 tests passed, and the mock proxy served todoist under MOCK_PROXY_PLATFORMS=github-issues,todoist. Removing checked from a recorded task made the adapter checks fail, as intended.

Not verified

Refs #46

🤖 Generated with Claude Code

…check

Everything for the todoist mock-proxy fixture up to the part that needs a
live Todoist account. It builds on PR #48's fixture registry and lives in
the issue-tracker plugin folder, whose lane names todoist (strict plugin
folder containment).

- issue-tracker/fixtures/todoist/record.mjs fetches the catalog document
  from the real proxy (public, no token needed). With TODOIST_TOKEN set, it
  also records /api/v1/projects and /api/v1/tasks as paged, redacted
  api/GET__api__v1__<collection>__page-<n>.json files. The redaction list is
  exported as REDACTIONS and documented in the file header. It fails
  closed: any string field it does not know is replaced and listed in
  api/meta.json. Output is formatted with the repo's oxfmt.
- document.yaml was recorded here from
  https://localthought.io/catalog/todoist.yaml on 2026-09-23 (oxfmt only
  re-indented YAML lists).
- scenario.mjs implements the fixtures/index.mjs interface. It replays api/
  by cursor, reads by id from the recorded rows, and returns 403 on
  writes, like the real data:read catalog.
- issue-tracker/todoist-fixture.test.ts runs in the issue-tracker unit
  tier. It checks the recorder's redaction on every run. Once api/ exists,
  it also checks that every field localthought/todoist.ts reads is present
  and typed, runs the rows through todoistProjection, replays pagination,
  and asserts the fixture is registered.

Not done: api/ is not recorded, because there were no Todoist credentials.
todoist is also not registered in localthought/fixtures/index.mjs (PR #48's
file), since an unrecorded fixture must not be served. The command and the
follow-up edits (index.mjs import from ../../issue-tracker/..., and
mock-proxy.test.mjs) are in record.mjs's header.

Refs #46.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong
michielbdejong marked this pull request as ready for review September 23, 2026 09:18
@michielbdejong
michielbdejong force-pushed the claude/issue-46-todoist-fixture branch from aafb66c to 25d46e5 Compare September 23, 2026 09:18
@michielbdejong
michielbdejong merged commit a7afcd6 into main Sep 23, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant