Ocap discipline: no ambient time in logic. PagedCache reads time and
waits only through a Clock { now, sleep }, a default constructor
argument (the live clock; the runtime constructs DOs with ctx and env
only). The fill job's timestamps and alarms, the etch time, and the
diigo-call pacing all go through it.
Tests interpose through the constructor: tests/test-worker.ts (now the
tests' main module) adds FixedClockCache, bound as CLOCKED_DO, and a
test pins startedAt, updatedAt, and the alarm time to the fixed clock
(an ambient new Date() fails it).
Generated-by: Claude Opus 5.5
26 lines
973 B
JSON
26 lines
973 B
JSON
{
|
|
"$schema": "node_modules/wrangler/config-schema.json",
|
|
// the real worker (via tests/test-worker.ts, which adds a fixed-clock
|
|
// cache), with WEBAPP bound to tests/fake-webapp.js (an aux worker
|
|
// declared in vitest.config.ts)
|
|
"name": "diigo-cache-tests",
|
|
"main": "./tests/test-worker.ts",
|
|
"compatibility_date": "2026-09-29",
|
|
"rules": [{ "type": "Text", "globs": ["**/capnweb/dist/index.js"], "fallthrough": true }],
|
|
"services": [
|
|
{ "binding": "WEBAPP", "service": "fake-webapp", "entrypoint": "WebAppFactory" }
|
|
],
|
|
"durable_objects": {
|
|
"bindings": [
|
|
{ "name": "CACHE_DO", "class_name": "DiigoCache" },
|
|
{ "name": "PUBLIC_DO", "class_name": "PublicCache" },
|
|
{ "name": "CLOCKED_DO", "class_name": "FixedClockCache" }
|
|
]
|
|
},
|
|
"exports": {
|
|
"DiigoCache": { "type": "durable-object", "storage": "sqlite" },
|
|
"PublicCache": { "type": "durable-object", "storage": "sqlite" },
|
|
"FixedClockCache": { "type": "durable-object", "storage": "sqlite" }
|
|
}
|
|
}
|