Repository navigation
fix(protocol): structured per-statement status - #154
Merged
Merged
Conversation
jsam
force-pushed
the
fix/remove-legacy-session-ws
branch
from
October 2, 2026 13:38
71ccfd0 to
9aecb06
Compare
jsam
force-pushed
the
fix/structured-statement-status
branch
2 times, most recently
from
October 3, 2026 10:53
44ed835 to
1bd28b5
Compare
QueryJob records each failed statement as {index, code, message} in
QueryResult.errors instead of only a message row. A one-statement
program that fails is a WS error frame with a code; a longer program
returns a result whose errors[] names each failed statement, including
when the program ends in a query. Removes is_error_message phrase
matching; ontology commands and .kg drop cleanup read errors.
soft_errors returns the engine's errors[] when present. For engines without it, message rows must match an exact success shape: the old prefix allowlist accepted "Relation 'x' not found." and "Rule 'x' not found." as success. Adds table-driven tests over every engine message.
Rule, session-rule, storage and query failures no longer abort the program: each is recorded in errors[] with a code and later statements still run. Session-bound /ws rules and facts get code=validation, index and .kg use errors are classified by cause, and ontology remove/upgrade tolerate rules that are already gone. SDK and GUI frame types model errors and code.
Rebased onto #152: map StorageError::InvalidName to Validation, and expect invalid-name statements as structured statement errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jsam
force-pushed
the
fix/structured-statement-status
branch
from
October 3, 2026 11:00
1bd28b5 to
2d998d0
Compare
jsam
added a commit
that referenced
this pull request
Oct 3, 2026
#156's rejection test predates #154, which reports statement failures in QueryResult.errors instead of an Err. Co-authored-by: Claude Opus 5.5 <[email protected]>
jsam
added a commit
that referenced
this pull request
Oct 3, 2026
* fix(protocol): report per-statement failures structurally
QueryJob records each failed statement as {index, code, message} in
QueryResult.errors instead of only a message row. A one-statement
program that fails is a WS error frame with a code; a longer program
returns a result whose errors[] names each failed statement, including
when the program ends in a query. Removes is_error_message phrase
matching; ontology commands and .kg drop cleanup read errors.
* fix(ontology-client): read structured statement errors in soft_errors
soft_errors returns the engine's errors[] when present. For engines
without it, message rows must match an exact success shape: the old
prefix allowlist accepted "Relation 'x' not found." and
"Rule 'x' not found." as success. Adds table-driven tests over every
engine message.
* fix(protocol): route every statement failure through statement status
Rule, session-rule, storage and query failures no longer abort the
program: each is recorded in errors[] with a code and later statements
still run. Session-bound /ws rules and facts get code=validation, index
and .kg use errors are classified by cause, and ontology remove/upgrade
tolerate rules that are already gone. SDK and GUI frame types model
errors and code.
* fix(protocol): adapt to the InvalidName storage error from #152
Rebased onto #152: map StorageError::InvalidName to Validation, and expect
invalid-name statements as structured statement errors.
jsam
added a commit
that referenced
this pull request
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failed statements were returned as OK message rows, so clients had to match message text to find failed writes.
{index, code, message}inerrors. Later statements still run.errorframe with acode. A longer program gets aresultwitherrors[]./wsrules and facts..kg useerrors are classified by cause.is_error_messagephrase matching is removed.soft_errorsreadserrors[]and falls back to exact-shape matching, with table-driven tests.errorsandcode.Tests:
tests/statement_status_tests.rs(in-process and/ws) covers an oversized insert, a 2nd-statement failure, an invalid rule mid-program where the 3rd statement still applies, not_found and conflict codes, and ontology remove/upgrade with a missing rule.Gates: fmt, clippy
-D warnings(rustc 1.99), workspace tests (3420 passed), snapshot tests (1149 passed).