8000 feat: binding support — API-017/API-018 and BrowserDb cursor (#462, #465, #467) by adityamukho · Pull Request #468 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content
8000

feat: binding support — API-017/API-018 and BrowserDb cursor (#462, #465, #467) - #468

Merged
adityamukho merged 3 commits into
v3from
feat/binding-etl-surface
Oct 7, 2026
Merged

adityamukho merged 3 commits into
v3from
feat/binding-etl-surface

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Core half of the binding work for #462 (cursors), #465 (open_with_options) and #467 (LogWriter/FactRecord). The binding repos' v3 branches pin this commit.

Changes

  • API-017 invalid argument: {}, from MinigrafError::invalid_argument. A binding returns it for an argument it cannot convert, such as an entity id that is not a UUID string.
  • API-018 {} is closed, from MinigrafError::closed. A log writer used after finish or close returns it. Rust consumes these objects, so the Rust API never returns either code.
  • BrowserDb.query(datalog) returns a BrowserCursor with vars(), nextBatch(maxRows) (JSON rows as in execute(), or undefined) and close(). transact, retract and rule are API-012, and bind slots are API-010.
  • Spec: docs/superpowers/specs/2026-10-07-binding-etl-surface-design.md describes the shape every binding shares, the v3 branching, and which parts do not apply in the browser.
  • wasm32 test build: removed a duplicate page_cache_capacity and moved dir_sync's tempfile tests off wasm32. Without that fix the browser tests did not compile.

Testing

  • cargo test: 1,337 passed, 9 ignored (one new unit test for the constructors).
  • Browser tests with wasm-bindgen-test in headless Firefox: 12 passed, 3 of them new cursor tests. No CI job runs these.
  • A doc-comment bug was caught while writing this: a /* ... */ in the BrowserCursor JS example ended wasm-bindgen's generated JSDoc comment early and broke the glue JS.

Refs #462, #465, #467

🤖 Generated with Claude Code

https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn

…rsor (#462, #465, #467)

Language bindings can now report what Rust's types rule out with the
core's own codes: MinigrafError::invalid_argument (API-017) for an
argument a binding cannot convert, and MinigrafError::closed (API-018)
for a log writer used after finish or close.

BrowserDb.query returns a BrowserCursor (vars, nextBatch with JSON rows,
close), matching Minigraf::query (API-012, API-010).

The wasm32 test build compiles again: drop a duplicate
page_cache_capacity and gate the tempfile-based dir_sync tests off
wasm32.

The binding shape shared by every binding repo is specified in
docs/superpowers/specs/2026-10-07-binding-etl-surface-design.md.

Refs #462, #465, #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
@codecov
codecov Bot commented Oct 7, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

adityamukho and others added 2 commits October 7, 2026 11:25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0