Repository navigation
docs: add the browser runtime to the agent guide - #67
Conversation
The agent guide covered only Node.js, so an agent that read it could not tell when the browser runtime fits, which entry point to import, or what fails on a real page. Step 12 adds the fit, the install with the SQLite WASM peer dependency, the entry points, a module worker example, authorization in the browser, the platform limits, transmit to a Node.js or Rails server, and the checks. The example lives in examples/browser/ and the Chromium suite runs it: state survives a reload, two tabs share one draft, and the second tab continues after the holder tab closes. The failover test first failed with "actor invocation timed out after 5000ms ... waitingOn=activationHeld" under the default lease settings, so the example keeps the short lease settings that the API reference recommends, and the guide says why. check-documentation now requires the guide to embed both example files, and its link check skips fenced code, where ref[operation](value) is code and not a link.
|
Docs7 for cardmagic/solid-objects-js
Commit |
|
- The page example rejects waiting and later calls when the worker fails to load. A browser test routes the worker to a 404; before the fix the call timed out after 10 seconds with no answer. - registerTransmit never reads the HTTP response, so a server 422 stops retries only when deliver throws NonRetryableError. The agent guide now shows that deliver callback, docs/api.md says so, and a new test proves one attempt and a dead letter. The same test with a plain Error fails with "expected 8 to be 1". - The two-tab test now sends overlapping edits from both tabs. - The test helper uses concrete call and result types. - The example route in the test server has no nested condition.
|
@greptileai Please review the latest commit, e7b3c46. It addresses each finding:
Validation: |
The overlapping edits started both workers together, so either tab could win the database lock. When the second tab won, closing the first tab did not test failover. A first call from the first tab now makes it the holder before the second tab starts its worker.
|
@greptileai Please review the latest commit, a755fc7. Failover can go untested: fixed as you suggested. A snapshot call from the first tab runs before the overlapping edits. The second tab's worker starts only on its first call, so the first tab holds the database when it closes. |
Why
The agent guide (
docs/agents.md) covered only Node.js. An agent that read it could not tell when the browser runtime fits, which entry point to import, or what fails on a real page. The consumer skill points agents to this guide, so the browser facts must be here.What changed
@sqlite.org/sqlite-wasm, the entry points, a module worker example, authorization in the browser, the rules for browser actors, the platform limits, transmit to a Node.js or Rails server, and the checks.examples/browser/draft-worker.jsandexamples/browser/page.js: the guide example.test/browser/agent-guide-example.browser.tsruns them in Chromium. It checks three things:scripts/check-documentation.mjs: requires the guide to embed both example files verbatim. The link check now skips fenced code, whereref[operation](value)is code and not a link. An audit of every current doc found no relative link inside a fence, so the change hides no existing link.docs/releasing.mdnames the new check.Correctness notes
actor invocation timed out after 5000ms ... waitingOn=activationHeld. A closed tab does not shut down its runtime, so with the default lease settings the remaining tab waits for the old lease. The example keeps the short lease settings that the API reference recommends, and the guide says why.docs/api.md,docs/support.md, the README, or the Rails ingest source. The one exception isnavigator.storage.persist(), a standard Storage API call.Validation
pnpm run format:check,pnpm run check,pnpm run test:coverage(588 passed, 32 database skips),pnpm run build,pnpm run pack:check(the tarball contains both example files),pnpm run test:package,pnpm run test:recovery,pnpm run test:browser(11 passed),pnpm audit --audit-level=high(no known vulnerabilities).pnpm exec playwright test test/browser/agent-guide-example.browser.ts --repeat-each 5: 10 passed.