Done. X = a, exit 1 → Fetch::Found. #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "repl-is-broken-by-bson-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Root cause — the bson capability-table refactor (df76b24→d6f3228) removed the
json encoder from the runtime, but crates/repl/src/run.rs was never updated;
it kept requesting --format json, which the engine rejects (exit 2, empty
stdout), so fetch() always fell through to Fetch::NoSolutions → " false.".
Every ?- query in the REPL has been broken since, not just yours. Your Prolog
was correct.
The fix (crates/repl/src/run.rs, rewritten):
display path and works on the default [text] binary — no capability
injection, no new parsers, no linking the heavy runtime.
parsed from error: on stdout, stderr fallback).
uniform Var = Value lines per solution, so the first variable's name is the
group delimiter — no external count needed. Handles false./true. and values
containing =.
semantics (re-fetch on doubled limit at the boundary).
(top_field/json_count/json_exhausted/json_error).
The regression guard — fetch_runs_a_real_compiled_binary compiles your exact
membercheck program via plgc and asserts the bound-variable query returns ["X
= a"], plus the no-solution, multi-solution, limit-truncation, and parse-error
paths. This is the test that was missing: every prior test operated on
hand-written string fixtures, so a broken wire contract sailed past CI. It
locates plgc via $PLGC or target//plgc, which cargo test --workspace
always builds.
Results: 495 tests pass workspace-wide, cargo fmt --check clean, cargo clippy
-D warnings clean. I changed only crates/repl/src/run.rs — the
runtime/compiler were already correct and untouched.