Skip to content

docs: fix the WASM examples, the PromQL paths, and six dangling links - #366

Closed
EnRaiha wants to merge 2 commits into
mainfrom
docs/wasm-and-links
Closed

EnRaiha wants to merge 2 commits into
mainfrom
docs/wasm-and-links

Conversation

@EnRaiha

@EnRaiha EnRaiha commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Problem

The WASM pages documented an API that does not exist, a route that is not registered, and links that resolve nowhere.

  • Eight phantom JS calls across three pages: NodeDB, NodeDB.open(name), db.exec, db.query, db.loadSnapshot, db.sync, db.sync_config. The binding exports 27 names; the class is NodeDbLiteWasm, the statement entry point is executeSql, open() takes no arguments, and there is no Collection type. ai/on-device.md also documents a "static snapshots" workflow with no implementation anywhere in Lite.
  • wasm.md claimed in-memory only, while openPersistent* through run_opfs_worker implements OPFS persistence.
  • wasm.md claimed all eight engines work, while the array engine's first write fails on wasm32-unknown-unknown (clock; filed separately).
  • PromQL paths: routes/promql/mod.rs placed the API at /obsv/api; the registered paths are /v1/obsv/api/v1/*, so a Grafana data source pointed at the documented URL 404s.
  • Six dangling links: lite.md (×5) and cli.md (×2) did not exist; query-language.md used ../bitemporal.md and ../wasm.md; security/encryption.md linked protocols.md#tls without the ../.
  • databases.md showed SELECT … CONSISTENCY='bounded_staleness' — no such clause exists; the level is a session setting. getting-started.md gave ~/.nodedb/data as the default data dir; it follows platform conventions.

Change

The examples use the real surface (init, NodeDbLiteWasm.openInMemory, executeSql, vectorInsert, vectorSearch); the snapshot paragraph is gone; the limitations list carries the real persistence story. docs/lite.md and docs/cli.md are new — cli.md carries the binary's actual usage text, and lite.md states what Lite shares, what it syncs, and where parity is unverified. The consistency example sets the session knob first; the data dir lists the real per-platform defaults.

Evidence

  • Link scan over docs/: zero dangling targets (was six).
  • The export list was read from the crate (js_name attributes), not from prose: 27 exports, no alias for any phantom name, and no JS/TS wrapper in the repo.
  • The staleness grammar is bounded_staleness:<secs> (read_consistency.rs:28-45); the data dir comes from config/server/paths.rs:18-33.

The WASM pages documented an API that does not exist: `NodeDB` /
`NodeDB.open(name)`, `db.exec`, `db.query`, `db.loadSnapshot`, and a
"static snapshots" workflow with no implementation anywhere in Lite. The
example now uses the real surface — `init`, `NodeDbLiteWasm.openInMemory`,
`executeSql`, `vectorInsert`, `vectorSearch` — and the snapshot paragraph
is gone. The limitations list gains the real persistence story
(`openPersistent*` through `run_opfs_worker`) and the status line stops
claiming all eight engines work on WASM today.

`routes/promql/mod.rs` placed the API at `/obsv/api`; the registered
paths are `/v1/obsv/api/v1/*`, so a Grafana data source pointed at the
documented URL 404s.

`docs/lite.md` and `docs/cli.md` fill six inbound links that pointed at
nothing. `cli.md` carries the binary's real usage text — there is no
`ndb` client — and `lite.md` states what Lite shares, what it syncs, and
where parity is unverified. The three wrong relative paths
(`../bitemporal.md`, `../wasm.md` from query-language, and
`security/encryption.md`'s `protocols.md#tls`) resolve.

Evidence: link scan over `docs/` reports zero dangling targets.
…a dir

Cross-checking this doc set against `nodedb-docs` turned up two claims
that both sets get wrong.

`CONSISTENCY = '...'` is not a SQL clause: `bounded_staleness` appears
only in the session-parameter parser (`set_validation.rs`,
`read_consistency.rs`), and the mirror read path reads the level from the
session. The example now sets it with `SET default_read_consistency`
first.

The default data directory follows platform conventions
(`$XDG_DATA_HOME/nodedb`, `~/Library/Application Support/nodedb`,
`%LOCALAPPDATA%\nodedb\data`), not `~/.nodedb/data`.

Evidence: `grep -rn "nodedb/data\|CONSISTENCY=" docs/*.md` → no hits;
the accepted staleness grammar is `bounded_staleness:<secs>`
(`read_consistency.rs:28-45`).
Copilot AI lite review requested due to automatic review settings September 23, 2026 02:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@EnRaiha EnRaiha added the run-ci Opt this PR into the full test suite; re-add to force a re-run label Sep 24, 2026
@EnRaiha

EnRaiha commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Closing. This carries the target-split clock helper, the wasm CI job and the nightly probe. NodeDB is a server: it does not build for wasm32 or wasip1 and will not support wasm, so the CI job and the probe have no home here — the revert of #367 settled that scope. The clock helper is worth keeping on its own merits: one time source over the native call sites. It returns as a small PR with no wasm arm. wasm CI belongs to NodeDB Lite, where the target actually exists.

@EnRaiha EnRaiha closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci Opt this PR into the full test suite; re-add to force a re-run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants