Skip to content

docs(wren-core-wasm): refresh onboarding for inline-mode default#2290

Merged
PaulChen79 merged 3 commits into
mainfrom
docs/wren-core-wasm-onboarding
May 15, 2026
Merged

docs(wren-core-wasm): refresh onboarding for inline-mode default#2290
PaulChen79 merged 3 commits into
mainfrom
docs/wren-core-wasm-onboarding

Conversation

@goldmedal
Copy link
Copy Markdown
Collaborator

@goldmedal goldmedal commented May 15, 2026

Summary

  • Bumps CDN version refs in README + AGENT_GUIDE from @0.1.0@0.3.0 (matches the currently published @wrenai/wren-core-wasm package).
  • Reorders Inline Mode first and labels it as the recommended default for local dev and bundled dashboards. URL mode is now framed as "useful when data is large or already on a CDN" — surfaces the HTTP Range: requirement up front.
  • Adds a Choosing a local dev server section with a range-support comparison table (built-in python -m http.server ❌, npx serve ✅, RangeHTTPServer ✅, etc.) plus a curl -I -H "Range: ..." smoke check.
  • Adds a Node.js usage section showing the wasmUrl: BufferSource pattern — WrenEngine.init() without options fails immediately under Node because file:// fetch isn't supported. Required for any node --test smoke checks against the published package.
  • Expands AGENT_GUIDE Common Pitfalls with three entries: range-support requirement, Node BufferSource, and "register sequentially" (the engine is single-threaded; concurrent registerParquet corrupts state).

Motivation

These changes were gathered from an end-to-end onboarding session where the agent and user hit four predictable, time-costing failure modes documented in this PR:

  1. Following the docs literally pulls a 4-versions-stale package (@0.1.0).
  2. URL mode is presented as "recommended" but the most common dev server (python -m http.server) silently breaks it — fetches stall after the Parquet footer with no error.
  3. Smoke testing with Node fails on init() before any user code runs.
  4. Parallel registerParquet calls corrupt the engine state.

Each item above maps to a concrete friction point that previously cost time during real onboarding.

Test plan

  • grep shows no remaining @0.1.0 references in the touched files.
  • Manual: copy-paste the README inline-mode Quick Start into a new HTML file, serve with npx serve, and confirm the query returns rows.
  • Manual: copy-paste the Node.js usage snippet into node --test and confirm WrenEngine.init() resolves with the BufferSource.
  • Manual: run curl -I -H "Range: bytes=0-1023" against a Parquet served by python -m http.server to confirm the docs match observed behavior (no 206).

Out of scope

A companion plan (IMPROVEMENT_PLAN_skill_and_docs.md in the contributor's workspace) also called for:

  • Adding a cubeQuery/listCubes API reference. Skipped here — those APIs are not yet on main. They should land with the feature, not ahead of it.
  • Mentioning registerCsv. Same reason.
  • Skill-side changes (in ~/.claude/skills/wren-dlt-connector/). Those live outside this repo.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated CDN examples to @wrenai/wren-core-wasm@0.3.0.
    • Made Inline Mode the recommended local/bundled workflow; clarified URL Mode for large datasets.
    • Specified HTTP Range and CORS requirements for URL Mode, added a range-support table and a curl check for 206 Partial Content.
    • Added Node.js guidance to pass WASM as a BufferSource to init().
    • Documented sequential registration pattern, load order, handling of empty source, and expanded common pitfalls.

Review Change Stack

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Pull requests that update rust code core wasm labels May 15, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 61eaccce-6083-4c84-8438-541dfdde9db7

📥 Commits

Reviewing files that changed from the base of the PR and between c206cc2 and 846702a.

📒 Files selected for processing (2)
  • core/wren-core-wasm/AGENT_GUIDE.md
  • core/wren-core-wasm/README.md
✅ Files skipped from review due to trivial changes (1)
  • core/wren-core-wasm/README.md

Walkthrough

Docs updated in core/wren-core-wasm: Inline Mode is now primary for local/bundled use, URL Mode documents HTTP Range/CORS and server checks, Node.js WASM init requires a BufferSource wasmUrl, Parquet registration should be sequential, and README CDN example version was bumped.

Changes

Wren Core WASM Documentation Update

Layer / File(s) Summary
CDN import version update
core/wren-core-wasm/README.md
Updated unpkg CDN import example version to @wrenai/wren-core-wasm@0.3.0 in the Quick Start.
AGENT_GUIDE — Inline/URL modes and Node.js guidance
core/wren-core-wasm/AGENT_GUIDE.md
Reworked "Two Data Loading Modes": Inline Mode is the default for local/bundled dashboards; URL Mode documents HTTP Range: and CORS requirements, common dashboard pattern (parallel Parquet fetch, then sequential registerParquet), Node.js wasmUrl: BufferSource guidance, and dev-server range-check instructions.
AGENT_GUIDE — Common pitfalls expanded
core/wren-core-wasm/AGENT_GUIDE.md
Expanded Common Pitfalls checklist: call ordering, source: '' meaning, protocol/CORS and range constraints for URL mode, Node wasmUrl note, and sequential registration requirement.
README — Quick Start and URL Mode details
core/wren-core-wasm/README.md
Quick Start now presents Inline Mode first with examples (registerJson, registerParquet from ArrayBuffer, optional registerCsv, loadMDL(mdl, { source: '' })); URL Mode rewritten to require HTTP Range/CORS and show loadMDL(mdl, { source: 'https://...' }) usage.
README — Node.js WASM init & local dev server guidance
core/wren-core-wasm/README.md
Added Node.js initialization example using wasmUrl as a BufferSource (readFileSync + buffer.slice), expanded dev-server range-support table, curl -I 206 Partial Content quick check, and updated Notes bullets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Canner/WrenAI#2283: Overlapping documentation changes about data registration ordering and CSV/inline workflows.
  • Canner/WrenAI#2284: Related docs-only updates covering similar WrenEngine init and data-loading patterns.

Suggested reviewers

  • PaulChen79
  • wwwy3y3
  • chilijung

Poem

🐰 I hopped through docs and nudged a version tight,
Inline first for local dev, keep your fetches light.
Parquets grabbed in parallel, then registered in line,
Node needs a BufferSource so WASM will align.
Hooray — clearer guides, now usage reads just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(wren-core-wasm): refresh onboarding for inline-mode default' directly and accurately summarizes the primary change—reorganizing documentation to establish inline mode as the default approach for onboarding, which is the main focus of both file updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/wren-core-wasm-onboarding

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@goldmedal goldmedal force-pushed the docs/wren-core-wasm-onboarding branch from 50886e0 to c206cc2 Compare May 15, 2026 06:30
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
core/wren-core-wasm/README.md (1)

115-115: 💤 Low value

Minor markdown inconsistency.

For consistency with AGENT_GUIDE.md line 88, consider using backticks: (not \200`)instead of(not 200)`.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/wren-core-wasm/README.md` at line 115, The markdown text in the README
Quick check line shows "(not 200)" which is inconsistent with AGENT_GUIDE.md;
update that fragment to use inline code formatting so it reads "(not `200`)".
Locate the Quick check sentence in core/wren-core-wasm/README.md (the line
containing curl -I -H "Range: bytes=0-1023" ...) and replace the plain 200 with
backticked `200` to match the style used in AGENT_GUIDE.md.
core/wren-core-wasm/AGENT_GUIDE.md (1)

215-215: 💤 Low value

Consider clarifying the file:// protocol limitation.

The statement "file:// protocol won't work for fetching remote Parquet" is technically correct but potentially confusing since file:// URLs are inherently local. Consider rephrasing to: "URL mode requires HTTP(S); file:// won't work as a data source."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/wren-core-wasm/AGENT_GUIDE.md` at line 215, Edit the AGENT_GUIDE.md
entry that currently reads "5. **CORS required** for URL mode — `file://`
protocol won't work for fetching remote Parquet." and rephrase it to clarify the
limitation: say that URL mode requires HTTP(S) and that file:// is a local
protocol and cannot be used as a data source (for example: "5. **CORS required**
for URL mode — URL mode requires HTTP(S); file:// cannot be used as a data
source."). Ensure the updated sentence replaces the original wording for
clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/wren-core-wasm/AGENT_GUIDE.md`:
- Around line 79-86: Update the server support table row notes to call out known
range-request caveats: for "npx serve" and "Vite / webpack-dev-server" add text
that they can mis-handle range validation (leading to 416 on misaligned ranges)
and that "webpack-dev-server" only supports single-range requests (multipart
ranges fall back to returning the whole resource); optionally add a short
pointer to the validation workaround or link to it. Target the table entries for
the server names "npx serve", "Vite / webpack-dev-server", and
"webpack-dev-server" in AGENT_GUIDE.md and expand their Notes column
accordingly.

---

Nitpick comments:
In `@core/wren-core-wasm/AGENT_GUIDE.md`:
- Line 215: Edit the AGENT_GUIDE.md entry that currently reads "5. **CORS
required** for URL mode — `file://` protocol won't work for fetching remote
Parquet." and rephrase it to clarify the limitation: say that URL mode requires
HTTP(S) and that file:// is a local protocol and cannot be used as a data source
(for example: "5. **CORS required** for URL mode — URL mode requires HTTP(S);
file:// cannot be used as a data source."). Ensure the updated sentence replaces
the original wording for clarity.

In `@core/wren-core-wasm/README.md`:
- Line 115: The markdown text in the README Quick check line shows "(not 200)"
which is inconsistent with AGENT_GUIDE.md; update that fragment to use inline
code formatting so it reads "(not `200`)". Locate the Quick check sentence in
core/wren-core-wasm/README.md (the line containing curl -I -H "Range:
bytes=0-1023" ...) and replace the plain 200 with backticked `200` to match the
style used in AGENT_GUIDE.md.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d03672e9-7848-4d59-b312-56082a2a6ba2

📥 Commits

Reviewing files that changed from the base of the PR and between 6ebed77 and 50886e0.

📒 Files selected for processing (2)
  • core/wren-core-wasm/AGENT_GUIDE.md
  • core/wren-core-wasm/README.md

Comment thread core/wren-core-wasm/AGENT_GUIDE.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/wren-core-wasm/README.md`:
- Line 17: The README import line references an unpublished CDN tag; change the
import URL that pulls WrenEngine from
'https://unpkg.com/@wrenai/wren-core-wasm@0.4.0/dist/index.js' to use the
published tag '@0.3.0' instead (update the URL to '...@0.3.0/...'), and scan for
any other occurrences of '@wrenai/wren-core-wasm@0.4.0' in the README to update
them as well so examples import WrenEngine from the published version.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eee03dc9-2bf0-4b7d-85e6-371a76f31afc

📥 Commits

Reviewing files that changed from the base of the PR and between 50886e0 and c206cc2.

📒 Files selected for processing (2)
  • core/wren-core-wasm/AGENT_GUIDE.md
  • core/wren-core-wasm/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/wren-core-wasm/AGENT_GUIDE.md

Comment thread core/wren-core-wasm/README.md Outdated
Improvements based on a real end-to-end onboarding session:

- Bump CDN version references from @0.1.0 to @0.3.0 to match the
  currently published @wrenai/wren-core-wasm tarball.
- Reorder Inline Mode before URL Mode in both README and AGENT_GUIDE;
  inline is the path of least resistance for local dev and bundled
  dashboards (< ~50 MB), and avoids the entire HTTP Range / CORS class
  of bugs.
- Add a "Choosing a local dev server" section explaining that
  `python -m http.server` lacks `Range:` support (silently breaks URL
  mode), with a comparison table and a `curl -I` smoke check.
- Add a "Node.js usage" section showing the `wasmUrl: BufferSource`
  pattern — `WrenEngine.init()` defaults to fetching via `import.meta
  .url` which resolves to `file://` in Node and fails. Useful for
  `node --test` smoke checks.
- Expand AGENT_GUIDE "Common Pitfalls" with range-support, Node
  `BufferSource`, and sequential-registration guidance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@goldmedal goldmedal force-pushed the docs/wren-core-wasm-onboarding branch from c206cc2 to 846702a Compare May 15, 2026 07:18
@goldmedal
Copy link
Copy Markdown
Collaborator Author

Addressed @coderabbitai's review in 846702a:

  1. 🔴 Revert CDN refs to @0.3.0@0.4.0 is on main (release-please bump in chore(main): release wren-core-wasm 0.4.0 #2287) but isn't published to npm yet. Reverted all three CDN refs in README + AGENT_GUIDE to @0.3.0. Will bump again once 0.4.0 is actually live on unpkg.
  2. 🟡 Dev-server table caveats — expanded the Notes column in both README and AGENT_GUIDE:
    • npx serve and Vite → ⚠️ Single-range; both use sirv and can return 416 when the requested range extends past EOF.
    • webpack-dev-server⚠️ Single-range; multipart range requests fall back to returning the whole resource.
  3. 💤 README 200 formatting — backticked \200`` to match AGENT_GUIDE.
  4. 💤 file:// wording — rephrased the URL-mode CORS pitfall to "URL mode needs HTTP(S) + CORS — opening the dashboard from a file:// URL won't work as the data source…", which is clearer than the original "won't work for fetching remote Parquet".

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check CDN version refs in README and AGENT_GUIDE
echo "=== CDN version refs ==="
rg '@wrenai/wren-core-wasm@' core/wren-core-wasm/README.md core/wren-core-wasm/AGENT_GUIDE.md

echo ""
echo "=== Dev-server table in README ==="
rg -n -A2 "npx serve|webpack-dev-server|sirv|416|Single-range|single-range" core/wren-core-wasm/README.md

echo ""
echo "=== Dev-server table in AGENT_GUIDE ==="
rg -n -A2 "npx serve|webpack-dev-server|sirv|416|Single-range|single-range" core/wren-core-wasm/AGENT_GUIDE.md

echo ""
echo "=== 200 formatting in README ==="
rg -n '`200`|200 ' core/wren-core-wasm/README.md

echo ""
echo "=== file:// wording in README and AGENT_GUIDE ==="
rg -n 'file://' core/wren-core-wasm/README.md core/wren-core-wasm/AGENT_GUIDE.md

Length of output: 3506


@goldmedal All four items are confirmed in the files:

  1. CDN refs — All three occurrences (README ×1, AGENT_GUIDE ×2) are correctly pinned to @0.3.0. 👍
  2. Dev-server table caveats — Both files now show ⚠️ Single-range for npx serve, Vite (with the sirv/416 note), and webpack-dev-server (multipart-range fallback note). The distinction is clear and accurate.
  3. 200 formatting — Backticked in the quick-check line in README to match AGENT_GUIDE.
  4. file:// wording — The rephrased pitfall ("URL mode needs HTTP(S) + CORS — opening the dashboard from a file:// URL won't work as the data source…") reads more clearly than before.

Everything looks good. Thanks for the thorough follow-through! 🐇 ✨


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@goldmedal goldmedal requested a review from PaulChen79 May 15, 2026 08:12
@PaulChen79 PaulChen79 merged commit 8bfe5c5 into main May 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation rust Pull requests that update rust code wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants