For agents, on top of README.md, which they read first.
Notes for agents
- No merge rule here.
src/documents.rscallsMemoryDoc::merge,Household::mergeandChatState::mergeofwhiskers-core. A rule that needs to change changes there. - Do not put an
awaitbetween a document's read and its write (documents::merge_in,object.rs). That is what makes a merge atomic on both hosts: celld lets an event that awaits overlap another. - Config is the shared subset:
wrangler.jsonc, noroutes, binding names distinct fromvarsnames (both hosts refuse a clash),main: ./build/index.jswithno_bundle(build/worker/shim.mjsre-exports../index.js, which a prebuilt Worker cannot import on either host). A Cloudflare route belongs to the deployment overlay, not this file. - Never log content. Nothing here writes a document, a fact or a body to the log: counts, statuses, kinds. A
parse error's own text quotes the input; log
classify()instead. - The
/_hub/...routes exist only in the test mode (Households::is_testing); keep it that way, so a deployment cannot serve them. - There are no stand-ins.
ObjectBackendimplements a capability (HasMemory...) only for a port the Worker really has, andlib.rsgives the service only the routes for those. Never add a port that answers "not here" to satisfy a bound: if a route's bound is not met the route is not served, and the compiler is what says so. Moving a capability onto the Worker means a real implementation, itsHas…impl, the.serve(...)of its routes, and its fixture in the conformance harness (documents.rstests). - The
loglevel isWHISKERS_LOG, as everywhere in Whiskers.