Skip to content

feat(r): opt-in "maps" capability — plumbing, prompts, docs - #324

Draft
cpsievert wants to merge 6 commits into
mainfrom
feat/maps-capability-r
Draft

cpsievert wants to merge 6 commits into
mainfrom
feat/maps-capability-r

Conversation

@cpsievert

Copy link
Copy Markdown
Contributor

Summary

R side of the opt-in "maps" capability (sibling to #323 for Python; spec in local docs/superpowers/specs/2026-10-12-maps-capability-design.md).

Included here:

  • Opt-in plumbing: tools = c("default", "maps"). "default" expands to the default tool set (also fixes the existing "must restate every tool to add one" problem); "maps" is a capability modifier that aborts with a clear error if "visualize" is absent, and is dropped alongside "visualize" when the ggsql package is missing.
  • Prompt: the ggsql-spatial.md partial (byte-identical to the Python copy) renders only when maps is enabled. It teaches the ggsql:world choropleth-join pattern, lon/lat point maps, named projections, and guardrails.
  • Docs/NEWS: "Maps" section in the visualize vignette + NEWS entry.

Not included yet (needs the in-progress R caching-reader work, which is currently uncommitted in a local checkout of ggsql-caching-reader-r): the spatial-extension pre-warm in viz_caching_reader() and spatial error translation in the viz tool. Until those land, enabling maps gives the LLM spatial guidance but queries fail with ggsql's raw extension error — so do not merge before that follow-up. One open dependency for the follow-up: the extension install location must respect CRAN policy (a user cache dir rather than ~/.duckdb), which may need a small ggsql-r hook.

Verification

  • TDD coverage: normalize_tools sentinel expansion and maps-requires-visualize error, check_viz_deps dropping maps, prompt rendering with/without maps.
  • devtools::test(filter = "QueryChat") and filter = "QueryChatSystemPrompt": 0 failures.

@cpsievert
cpsievert force-pushed the feat/maps-capability-r branch from 3de5ada to 4bafa97 Compare October 13, 2026 15:10

This branch has not been deployed

No deployments
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