docs: clarify that GiacContext does not yet isolate evaluations#32
Open
s-celles wants to merge 1 commit into
Open
docs: clarify that GiacContext does not yet isolate evaluations#32s-celles wants to merge 1 commit into
s-celles wants to merge 1 commit into
Conversation
The public signature `giac_eval(expr, ctx::GiacContext)` and the `GiacContext` type implied per-context isolation of variable bindings and computation state, but the C++ wrapper currently exposes only a process-wide singleton context — `_giac_eval_string` accepts a `ctx_ptr` and ignores it. So `:=` bindings persist across every `giac_eval` call regardless of the `GiacContext` passed in. This was surfaced by the MCP extension whose tool description promised "each call is independent", a claim the implementation could not honour. Rather than masking this with a `restart;` workaround in the MCP handler, this commit owns up to the limitation: - `!!! warning` blocks in the docstrings of `giac_eval` and `GiacContext` pointing to the upstream tracker. - Comment on `_giac_eval_string` explaining why `ctx_ptr` is ignored. - Updated MCP tool description telling LLM clients that bindings persist and recommending `purge(name)` / `restart` to clear state. Tracked upstream as s-celles/libgiac-julia-wrapper#3. Once the wrapper exposes a context-aware eval entry point, `_giac_eval_string` can finally pass `ctx_ptr` through, real per-`GiacContext` isolation becomes possible, the MCP server can do clean per-call isolation, and these warning blocks can be removed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
==========================================
+ Coverage 79.76% 79.86% +0.10%
==========================================
Files 23 23
Lines 2891 2891
==========================================
+ Hits 2306 2309 +3
+ Misses 585 582 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merged
4 tasks
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.
Summary
The public signature
giac_eval(expr, ctx::GiacContext)and theGiacContexttype implied per-context isolation of variable bindings and computation state, but the C++ wrapper currently exposes only a process-wide singleton context. EveryGiacContextvalue ends up funnelled into the samegiac::context *(_get_cxxwrap_context()), so:=bindings persist across everygiac_evalcall regardless of whichGiacContextwas passed.This was surfaced by the MCP extension whose tool description promised "each call is independent" — a claim the implementation could not honour. Rather than masking the limitation with a
restart;workaround in the MCP handler, this PR owns up to it in three layers of documentation:!!! warningadmonitions in the docstrings ofgiac_evalandGiacContextpointing to the upstream tracker._giac_eval_stringexplaining why itsctx_ptrparameter is ignored.purge(name)/restartto clear state.Upstream tracking
Filed as
s-celles/libgiac-julia-wrapper#3. Once the wrapper exposes a context-aware eval entry point,_giac_eval_stringcan passctx_ptrthrough, real per-GiacContextisolation becomes possible, the MCP server can do clean per-call isolation, and these warning blocks can be removed.Test plan
julia --project=. -e 'using Giac, ModelContextProtocol; include("test/test_mcp_ext.jl")'— 44/44 passingjulia --project=docs docs/make.jl— no new warnings; the!!! warningadmonitions render under Documenter