● Scaffold checkpoint done. End-to-end smoke runs: #38
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-prolog-v1!38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "repl"
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?
?- member(X, [a, b, c]).
X = a
; or . > ;
X = b
; or . > ;
X = c
; or . > .
?-
What's in:
installs via just install.
Done, Error}. 5 unit tests covering the canonical streaming case, parse
error, ISO type_error, inline consult, and step-limit propagation.
embedded-newline flattening. 5 unit tests including XDG honor and tail
behavior.
#[allow(dead_code)] on the parts the TUI loop will consume next iteration.
engine path today (; for next, . to commit, quit./EOF to exit).
with the third inter-crate pin count and a cargo publish -p
patch-prolog-repl step between lsp and the CLI.
clean).
Deferred for the next iteration (per design):
decision noted in app.rs — likely either rerun-and-skip or self_cell.
resource_error(steps) because the engine surfaces missing-predicate errors
with similar shape; not blocking, but worth a closer look when wiring the
bindings panel.
?- member(X, [a, b, c]). X = a ; or . > ; X = b ; or . > ; X = c ; or . > . ?- What's in: - crates/repl/ wired into the workspace; prlg-repl binary builds and installs via just install. - engine.rs — Session (stdlib + consult files) → Query → Step::{Solution, Done, Error}. 5 unit tests covering the canonical streaming case, parse error, ISO type_error, inline consult, and step-limit propagation. - history.rs — XDG-aware path, append/load with tail trimming and embedded-newline flattening. 5 unit tests including XDG honor and tail behavior. - app.rs + keys.rs — App struct and Action enum sketched; field-level #[allow(dead_code)] on the parts the TUI loop will consume next iteration. - main.rs — clap CLI, line-mode stdin/stdout driver that exercises the full engine path today (; for next, . to commit, quit./EOF to exit). - justfile install + build + pkg-check updated; release workflow extended with the third inter-crate pin count and a cargo publish -p patch-prolog-repl step between lsp and the CLI. - just ci green (38 + 11 = 49 tests, clippy clean, all four crates package clean). Deferred for the next iteration (per design): - ratatui main loop, panel layout, bindings panel, vim-line modal editing. - The Session/Query self-referential question (App can't hold both as-is); decision noted in app.rs — likely either rerun-and-skip or self_cell. - Step-limit shows as existence_error(...) in some tests rather than resource_error(steps) because the engine surfaces missing-predicate errors with similar shape; not blocking, but worth a closer look when wiring the bindings panel.Review
What it does: Scaffolds
patch-prolog-repl(binaryprlg-repl): a UI-free engine driver (Session/Query/Step), XDG-aware persistent history,App/Actionskeletons for the coming ratatui loop, and a working line-mode driver. Workflow/justfile extended for the fourth crate.Verified locally (scratch copy of the branch): all 11 tests pass, and the end-to-end smoke works exactly as the PR description claims —
member(X, [a,b,c]).streams a/b/c on;,X is foo.surfacestype_error(evaluable, foo)and returns to the prompt, history file lands under$XDG_DATA_HOME/prlg/history,quit.is not recorded. Checkpoints 2, 3, 5, 6 fromdocs/design/REPL.mdare demonstrably working in line mode; 1 and 4 are the pending TUI work, as declared.Design conformance is good: vim-line pinned
=7.5.7per the doc's clone-or-depend decision, history-as-only-persistent-state per Constraints, fresh solver per goal per Domain Events,STDLIB_PLconsumed from core (the #36 lesson applied), andpkg-checkpackages the new crate. The Session/Query self-referential problem is honestly flagged inapp.rsrather than hacked around.🔴 Blocking
Nothing. Incomplete is the declared state, and nothing here breaks a release if one fired today — with one caveat in 🟡 1.
🟡 Worth addressing (small, ideally before merge)
cargo test," butmain.rsships a working line-mode REPL (the PR description even shows its transcript). If a release tag fires before the TUI lands, this is the crates.io-facing description. One-paragraph fix.XDG_DATA_HOME.history::tests::xdg_data_home_is_honored_when_setmutates the process env (unsafe set_var) whileapp::tests::app_constructs_from_session_with_empty_transcriptconcurrently callsApp::new→default_path()→history::load(). Today it's benign (recalledisn't asserted), but it's a latent flake — and the app test also reads the developer's real~/.local/share/prlg/history. Cleanest fix: giveAppawith_history_path(Option<PathBuf>)constructor for tests, which the TUI loop will likely want anyway.ingest()silently drops future directives. It manually extendsdirectives.dynamic. Destructure instead —let ProgramDirectives { dynamic } = d;— so adding a field toProgramDirectivesin core becomes a compile error here rather than a silent drop.vim-line,ratatui,crossterm). Fine if the TUI lands before the next release; if not, installers compile the full TUI stack for a line-mode binary. Noteunused_crate_dependenciesis allow-by-default, soclippy -D warningswon't flag this.record_historyrecords goals that failed to parse. Plausibly intentional (recall-to-fix-the-typo is good UX) — if so, a one-line comment; if not, move the call inside theOkarm.🟢 Minor / for the next iteration
;presses.self_cellworks; a third option worth weighing is changing core'sSolverto holdArc<CompiledDatabase>instead of&db, which dissolves the lifetime entirely and simplifies every embedder.stream_solutionsprompts; or . >even for zero-bindingtrue.solutions; SWI auto-commits deterministic goals. Needs one-solution lookahead — fine to defer.history::appendflattens\nbut not\r— a\r\ngoal leaves a stray CR on the line.Queryisn't fused —next()afterDone/Erroris documented as "don't," but unguarded. Cheap to fuse when the TUI loop makes the call pattern less linear.step_limit_propagates_to_solverasserts anyError— already acknowledged in the PR description; tighten once theresource_errorvsexistence_errorshape question is resolved.error(type_error(evaluable, foo), Cannot evaluate as arithmetic)— unquoted prose as the second arg of the error term reads oddly.Verdict
Good checkpoint — honest about what's stubbed, the engine/UI seam is in the right place, and everything claimed is reproducible. Items 1–3 are each a few minutes and worth folding in before merge; the rest can ride with the TUI iteration.
Review by Claude Code