# Tasks Work in this order. Finish a task's check before starting the next. 1. **Set up.** One npm package with `src/client`, `src/worker`, `src/shared`; `wrangler.jsonc`, scripts and the two tsconfigs from `design.md`; run `npm run types`. Read `spekkr.inputs.json` into `src/shared/settings.ts`. `GET /api/now` with the clock rules. Check: `npm run dev` serves a page titled `app_name`; `/api/now` answers; `npx wrangler deploy --dry-run --outdir /tmp/dry` bundles (R1). Do not log in to Cloudflare or deploy. 2. **Database.** `migrations/0001_init.sql` and `migrations/0002_access.sql` from `design.md`. Check: migrations apply to an empty `--persist-to` folder; FTS5 with `tokenize='trigram'` works in local D1. 3. **Shared rules.** `parse.ts`, `paths.ts`, `rewrite.ts`, `search.ts`, `merge.ts`, `dates.ts`, `templates.ts`, `fuzzy.ts`, `vaultSettings.ts`. Check: `npm test` passes every case in "Unit tests". 4. **Accounts and vaults (R2, R23, R24).** Auth, sessions (Secure except on localhost/127.0.0.1), Origin check, body limits, JSON errors, vault CRUD, the starter note, the demo seed (role `demo`); the sign-up policy (`access`, `ALLOW_SIGNUP`, test cookies), owner/member roles, invites and removing access, `GET /api/config`. Check: with curl, the first sign-up gets role `owner` and, with `access` = `only_me`, a second sign-up gets 403 "Sign-up is closed on this site"; seeded demo user exists with role `demo`. 5. **Files and index (R3, R7, R10, R9).** The `Vault` class: create, save with the version guard and rev-guarded index writes, move with link rewriting and bookmark moves, trash/restore/purge; tree and changes. Check: renaming "Launch plan" in the demo vault updates the notes that link to it; a stale `baseVersion` gets 409 with the current text. 6. **Attachments (R19).** Upload to R2, raw download with headers. Check: upload a PNG, download it, a `.exe` gets 415. 7. **Index queries (R8, R11, R14).** Search, backlinks with unlinked mentions, tags, graph, headings, properties, bookmarks. Check: `search?q=tag:%23idea` returns Ideas and 2026-11-14. 8. **Client shell (R17, R21, R22, R24).** Login/sign-up pages (closed, invite and first-account states), Settings > People and About, workspace model (groups, splits, tabs, history, persistence), ribbon, sidebars, status bar, mobile bars and drawers, themes, settings dialog. 9. **Editor and reading (R4, R5, R6, R9).** CodeMirror live preview, source mode, reading view renderer, embeds, link and tag autocomplete, properties panel (the YAML block hidden from the moment a note opens, cursor kept in the body), autosave and the store's sync/merge. 10. **Panes and tools (R3, R8, R10–R16, R18).** Explorer with drag and keyboard, search, bookmarks, tags, backlinks, outgoing, outline, all properties, quick switcher, command palette and hotkeys, graph (global and local), daily notes, templates. 11. **End to end and README.** `playwright.config.ts` as in `spec.md` "Tests" (port 3210, fresh `.e2e`, `NOW` 2026-11-15T12:00:00Z, `TEST_CLOCK=1`, `ALLOW_SIGNUP=1`, `America/New_York`), tests titled with their own requirement id, the R24 tests in `e2e/0-access.spec.ts`. The README: run, test, who can sign up, deploy, and the Cloudflare Access steps (R24). Check: `npm test` and `npm run e2e` pass; `wrangler deploy --dry-run` still bundles.