Commit Graph
9 Commits
Author SHA1 Message Date
dckc d7190abaf8 diigo-cache: the public page only reads
/public/<username> reads through the cache's viewer() facet
(PageViewer: stored pages, knownTotal, fill progress — the reader
alone), so it can't fetch from diigo or write storage.

Behavior change, agreed beforehand: an unfetched page no longer fills
itself on a miss; it says "not fetched yet" (JSON: stored: false), and
the owner fills via the webkey page. The HIT/MISS line becomes "stored
<when>". Strangers can no longer make the cache spend the owner's diigo
session; the README's deployment concern shrinks to /api.

Tests: viewing an unfetched page makes no webapp call; the page appears
once stored; fill progress shows after one fill step.

Generated-by: Claude Opus 5.5
2026-10-07 09:26:09 -05:00
dckc 81f91a6747 fixup! diigo-cache: invalidate the last N days of cached pages
README: the invalidate control.

Generated-by: Claude Opus 5.5
2026-10-07 08:27:19 -05:00
dckc f4b68f1b59 fixup! diigo-cache: bookmark cache in Durable Objects (goal 1c)
README: PAGE_SIZE is 100, diigo's cap.

Generated-by: Claude Opus 5.5
2026-10-07 04:59:39 -05:00
dckc 3baffcab4c fixup! diigo-cache: bookmark cache in Durable Objects (goal 1c)
README: page size is PAGE_SIZE (128), not 24.

Generated-by: Claude Opus 5.5
2026-10-07 04:57:01 -05:00
dckc 8c221abe6f diigo-cache: fill from a webkey page over Cap'n Web
Starting a fill no longer POSTs the cache id to /_fill. Instead:

- the created page links the cache's webkey, /cache/#<cache id>: a
  skeleton page, the same for every key, that reads the key from the
  fragment (never sent to the server or in a Referer)
- its script trades the key in-band for a capability over Cap'n Web at
  /api: CacheApi.cache(key) returns a CacheCap facet (fill, status,
  fingerprint, the public companion's fill) and never the DO's wiring
  methods; malformed and unknown keys get one refusal that never echoes
  the key, and each refusal is logged without it
- then calls startFill(): trade and call pipeline into one round trip
- the worker serves capnweb's browser build itself at /_capnweb.js (a
  wrangler Text rule), so no third-party script sits beside the key

The /_fill route and its forms are gone. Tests run the real capnweb
client against the worker (fetch routed to worker.fetch).

Generated-by: Claude Opus 5.5
2026-10-07 04:32:44 -05:00
dckc 31ded9735b diigo-cache: fill job — a button that grabs every page (goal 1e)
POST /_fill (cache id in the body; target private|public; action
start|stop) starts or stops a background walk of every diigo page into
the cache. DO alarms advance it pagesPerStep pages per step (default
20), a second apart; progress (FillStatus) is stored in the DO after
each page, so it survives eviction. Cached pages are skipped; starting
while running rejoins the job; a stop mid-step wins; a failure is
recorded with its reason and logged once. The created page gets fill
buttons; the public page shows "filling: n of m pages".

Fill state is new, additive DO storage (fill, fillStep): no existing
state changes meaning.

The 13 fill specs are unskipped and green, plus one: a fill makes one
diigo call per page fetched.

Generated-by: Claude Opus 5.5
2026-10-07 04:25:38 -05:00
dckc 0cfa9d204e diigo-cache: own test toolchain; pnpm lint, pnpm test
vitest, @cloudflare/vitest-plugin, and typescript are devDependencies
here instead of being borrowed from diigo-bookmarks through hand-made
node_modules symlinks and a deep-path import.

- lint: wrangler types, then tsc over src/ and tests/ (Cloudflare's
  documented typecheck shape: regenerate types, then tsc)
- test: vitest run
- tests/tsconfig.json per the vitest-plugin docs; the dangling
  typecheck script (tsconfig.check.json never existed) is gone

Generated-by: Claude Opus 5.5
2026-10-07 04:19:54 -05:00
dckc 6f409fc83a diigo-cache: bookmark cache in Durable Objects (goal 1c)
The dump worker becomes a page cache: a hit is served from DO SQLite
storage with no diigo call; a miss asks the webapp instance in the
cache's wiring and etches the page.

- two independent caches, one behavior (PagedCache): DiigoCache keeps
  every item; PublicCache keeps shared items only, dropping private
  rows before they are stored; served at /public/<username> (HTML page
  form, or JSON)
- create flow on one port: /_connect relays webapp's mint form, /_mint
  proxies the mint, /_wire wires a private or public cache; /_publish
  adds a public cache later
- ids are webkeys: kept out of URLs (POST bodies), shown and logged
  only as a hash fingerprint; saved to the password manager under the
  holder's petname (never sent to the server)
- items keyed on diigo's link_id; username from u_name; unkeyable
  items and every failure path are logged; each page read logs hit/miss
- tests run the real worker + DOs in the vitest pool against a fake
  webapp (tests/fake-webapp.js)

Generated-by: opencode (GLM)
Generated-by: Claude Opus 5.5
2026-10-07 04:19:54 -05:00
dckc 58be2ccaf8 refactor: rename diigo-dump to diigo-cache
Pure rename ahead of the dump worker's evolution into a bookmark cache
(goal 1c), so history follows the files. The diigo-login helper script
is dropped: the cookie now enters through webapp's mint form, never a
local script.
2026-10-07 03:25:56 -05:00