Skip to content

[Bug]: Store and extension storage docs: stale derived-index and sorted-list text after #951, audit's 'atomic file replace', unconditional shared auth rate limit, lease facts copied 8x #993

Closed

Description

@jimhoyd

Runtime revision and environment

Docs on origin/main fe5d03f0 (after #986). Found in a coherence audit of the docs edited by the ~40 PRs merged on 2026-09-29. Docs only; no runtime behaviour is in question.

Minimal reproduction

Each finding cites origin/main file:line, the statement, and what the code does.

  1. STORE.md says the interval index is the only derived object; there are three kinds now.

  2. CAPACITY.md still describes sorted and filtered lists the way they worked before [Request]: Store: order sorted and filtered lists in SQL near the 10,000-record maximum #951.

    • docs/CAPACITY.md:126 (extension storage bounds table): "Store sorted or filtered lists | read the id and the named fields of every record in scope (at most maxRecords), then the page".
    • Since feat(store): order and filter store lists in SQL (#951) #986 a sorted or filtered page is one keyset query through an index (packages/store/src/listing.ts; docs/STORE.md:1488-1496, and CAPACITY.md:236-261 on the same page). The in-memory path now runs only while the collection holds a row the index key cannot order (STORE.md:1504-1510). The table row should say that, or link to STORE.md.
  3. Audit's normative delivery guarantee describes the store's retired JSON file.

    • packages/audit/SECURITY.md:17-19: "A producer change commits if and only if its audit events are committed in the same storage transaction (store: the same atomic file replace)."
    • The store is SQLite. Each write is one BEGIN IMMEDIATE transaction that inserts the event into store_audit_outbox (docs/STORE.md:1854-1858 and :1884-1887; packages/store/src/collection.ts). JSON data files "are not read or imported" (STORE.md:1876-1877). This is the normative section of a SECURITY file, so a stale mechanism there matters.
  4. Auth's security model states the shared rate limit unconditionally, but the operator can switch it to per-process storage.

    • packages/auth/SECURITY.md:12-16: the limiter "keeps its counters in the auth database's rateLimit table, so every process serving that database on one host shares one limit".
    • packages/auth/README.md:149-155 says betterAuth.rateLimit.storage can choose Better Auth's per-process memory instead. Code: packages/auth/src/auth.ts:148 spreads ...extra.rateLimit after storage: 'database', and only enabled: true is forced. So the operator can override storage, and also window, max and customRules. SECURITY.md should say that the shared limit is the default and name which settings can be overridden. docs/STORE.md:2031-2033 and docs/CAPACITY.md:385-386 repeat the unconditional claim too.
  5. Lease and topology facts are copied into five places instead of linked.

    • The lease timing (renewed every 5 s, live 20 s), the lease tables and the "refuses a network filesystem / live peer on another host" rule are restated in docs/STORE.md:1981-2025, docs/EXTENSIONS.md:689, docs/RUNTIME-IMPLEMENTATION.md:98, packages/auth/README.md:156-170, packages/audit/README.md:169-176, docs/OPERATIONS.md:467-469, docs/CAPACITY.md:381-383 and docs/FRAMEWORK.md:260-263. The code has one source: packages/core/src/host-lease.ts:63 (SERVER_LEASE = {heartbeatMs: 5_000, ttlMs: 20_000}).
    • I found no copy that disagrees today. But the auth and audit READMEs and EXTENSIONS.md:689 restate the numbers rather than linking STORE.md#several-serving-processes-on-one-host, which is the kind of duplication CONTRIBUTING's "maintain existing pages first" asks us to avoid.

Relevant output

What I verified: items 1-4 against the cited source lines. Item 5 is a maintenance finding, not a contradiction.

Not verified: I did not run the auth rate-limit override in item 4. The conclusion comes from reading auth.ts:148.

Activity

  1. added
    documentation
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions