Skip to content

fix: Python SDK kg.load() silently no-oped - send the file as one atomic program - #102

Merged
jsam merged 1 commit into
mainfrom
py/fix-kg-load
Aug 20, 2026
Merged

jsam merged 1 commit into
mainfrom
py/fix-kg-load

Conversation

@jsam

@jsam jsam commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What

KnowledgeGraph.load(path) forwarded '.load ' over the WebSocket, but the server treats .load as a client-only REPL command (src/protocol/handler.rs:3627-3630) and replies with an informational message instead of executing anything. So SDK load() returned success while loading nothing.

Now the file is read client-side and sent as a single multi-statement execute program:

  • Atomic: the server parses every statement before executing any, so a broken file loads nothing rather than half.
  • Rate-limit-safe: one WS message instead of one per statement, which is exactly how the il CLI (feat: il CLI - install ontologies from the registry over WS #98) deploys ontology packs.
  • mode= now raises NotImplementedError (--replace/--merge are unimplemented server-side; previously they were silently dropped).

Tests

New tests/test_kg_load.py (file contents sent verbatim as one program, mode rejected, missing file raises). Full SDK suite: 960 passed, 23 skipped.

Merge order

Independent - mergeable any time; no conflicts with #98/#100/#101/#103.

…s one program

load() forwarded '.load <path>' over the wire, but the server treats
.load as a client-only REPL command and replies with an informational
message instead of executing anything - so SDK load() succeeded while
loading nothing. Now the file is read client-side and sent as a single
multi-statement execute program, which is also atomic (the server
parses every statement before executing any) and immune to the
per-message WS rate limit. mode= raises NotImplementedError since
--replace/--merge are unimplemented server-side.
@jsam jsam changed the title fix: Python SDK kg.load() silently no-oped — send the file as one atomic program fix: Python SDK kg.load() silently no-oped - send the file as one atomic program Aug 19, 2026
@jsam
jsam merged commit b7096c2 into main Aug 20, 2026
11 checks passed
@jsam
jsam deleted the py/fix-kg-load branch August 20, 2026 12:26
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