rrlmgraph (development version)
Documentation
-
compute_relevance(): added a@noteparagraph explaining that the MCP server’s TypeScript BFS uses a depth-penalty signal in place of the co-change signal becauseCO_CHANGESedge weights are not stored in the exported SQLite schema. Closes mcp#41. -
vignettes/mcp-integration.Rmd: replaced the Available MCP tools table with the complete, correctly-named 8-tool set; previous table listed 4 wrong names (get_node,list_nodes,get_neighbours,graph_stats) and omittedfind_callees,search_nodes,add_task_trace, andrebuild_graph. Closes #91. -
vignettes/benchmark-results.Rmd: fixed stale strategy-name literals"rrlmgraph"/"rrlmgraph_mcp"in both plot chunks; correct names are"graph_rag_tfidf"/"graph_rag_mcp", so all data points were rendering grey. Closes #92. -
vignettes/benchmark-results.Rmd: corrected column names in thesummary-table,score-plot, andpairwisecode chunks to match the actual output ofrrlmgraphbench::compute_benchmark_statistics():ci_lower→ci_lo_95,ci_upper→ci_hi_95,mean_tokens→mean_total_tokens,n_obs→n,strategy_a/strategy_b→strategy_1/strategy_2. Added inline derivation of asignificantcolumn (absent from the function’s return value). Fixed prose referencedetect_hallucination()→count_hallucinations(). Closes #93. -
vignettes/mcp-integration.Rmd: corrected CLI flag--db→--db-path, file extensiongraph.db→graph.sqlitethroughout (architecture diagram, npx example, VS Code JSON config), and added the requireddb_pathargument to bothexport_to_sqlite()calls. Closes #94.
CI / Security
- All GitHub Actions workflows are now pinned to full commit SHA digests instead of mutable
@v4/@v2tags, eliminating the supply-chain risk described in OWASP A06. Closes #90.
rrlmgraph 0.1.3
Bug fixes
-
export_to_sqlite():.upsert_nodes()was reading the non-existent vertex attributetask_weightinstead of the actualtask_trace_weightattribute written bylog_task_trace(). Every exportedtask_weightvalue wasNA, silently breaking the feedback loop that re-ranks nodes after task completion (#89). -
task_trace_weightcold-start default changed from0.5to0.0(#78). Previously the very first BFS whentask_trace_weightwas uninitialized boosted all neighbours equally (0.5), causing spoke nodes to score abovemin_relevanceeven when unrelated to the query, inflating context size. The new default keeps spoke influence at zero until an explicit weight is provided.
rrlmgraph 0.1.2
New vignettes
-
LLM Chat with Context (
vignettes/llm-chat.Rmd): shows real model responses loaded from a pre-captured RDS — no API key required to read the vignette. -
Benchmark Results (
vignettes/benchmark-results.Rmd): compares the eight context-retrieval strategies from rrlmgraph-bench with summary tables and a score plot. -
MCP Server Integration (
vignettes/mcp-integration.Rmd): narrative guide and VS Code configuration for the rrlmgraph-mcp companion.
rrlmgraph 0.1.1
Bug fixes
-
extract_function_nodes()/.make_node(): node IDs now include the parent directory name as a prefix (e.g."R/utils::fn"instead of"utils::fn"), matching the seed-node format used by the benchmark task definitions. Previously,query_context()would abort with “seed_node not in graph” for any benchmark task, leavingretrieved_n = 0for therrlmgraph_tfidfstrategy on every trial (#78).
rrlmgraph 0.1.0
First release.
Improvements
-
plot.rrlm_graph(): replaced the staticigraph::plot.igraph()backend with an interactive Graphviz widget viaDiagrammeR::grViz(). Nodes are grouped into dashed sub-graph boxes by source file, coloured by node type, and sized by PageRank. The widget renders in the RStudio Viewer or any browser with full pan-and-zoom support (scroll to zoom centred on cursor, drag to pan, pinch on touch devices, double-click to reset) via injected vanilla JS – no CDN or plugin required. A newlayoutparameter selects the Graphviz engine ("dot"hierarchical,"neato","fdp","sfdp","circo"); a newfileparameter saves to.html(via htmlwidgets) or to.png/.pdf/.svg(via webshot2). - Vignette figure size increased to 10 × 8 inches.
Original first-release notes
-
R CMD check --as-cran: zero errors, zero warnings verified across ubuntu/windows/macos x R release/oldrel/devel (#25). -
DESCRIPTION: addedBugReportsURL andspellingtoSuggests. -
inst/WORDLIST: package-specific technical terms registered to passspelling::spell_check_package()cleanly. - CI: added spelling check step after
devtools::document()(#25).
Breaking changes
-
chat_with_context(): themodelparameter is nowNULLby default (was"gpt-4o-mini"). A per-provider sensible default is applied automatically. Code that passedmodelexplicitly is unaffected.
Improvements
-
chat_with_context()gains aproviderargument ("openai","ollama","github","anthropic"). Whenellmeris installed the appropriateellmer::chat_*()backend is used; thehttr2fallback is retained forprovider = "openai"whenellmeris absent (#41). -
ollama_available()no longer requires theollamarpackage. It now pings the Ollama REST API directly viahttr2(GET /api/tags). SetOLLAMA_BASE_URLto override the defaulthttp://localhost:11434(#40). - Ollama embedding calls (
embed_nodes(),embed_query()) now hitPOST /api/embeddirectly viahttr2, removing theollamardependency entirely (#40).
Bug fixes
-
R/parse_ast.R:as.character(expr[[1L]])now guarded with an extra[[1L]]so that namespace-qualified calls (pkg::fn) no longer produce a length-3 character vector, which previously caused a “condition has length > 1” crash when building the graph. Same guard added in.collect_nse_symbols()and.find_qualified_calls(). R6Class detection changed to use%in%rather than==for robustness against multi-element vectors. -
R/graph_build.R:build_test_edges()now skips unresolvable bare names instead of throwing “subscript out of bounds” when a called symbol does not appear in the function-node index. -
NAMESPACE: restoredS3method()registrations forplot.rrlm_graph,print.rrlm_graph,summary.rrlm_graph,print.rrlm_context, andsummary.rrlm_context. Previously the file listed plainexport()entries, which broke S3 dispatch so igraph methods were called instead. A newR/imports.Rcarrying all@importFromroxygen tags ensuresdevtools::document()regenerates the fullimportFrom()block. -
print.rrlm_graph(),summary.rrlm_graph(): replacedcli::cli_*()calls withcat()so output is captured bycapture.output()in tests and pipe operators work correctly. -
inst/WORDLIST: addedcentres,cex,Kamada,Kawaito silencespelling::spell_check_package()failures in CI. -
tests/testthat/test-parse-ast.R: fixedwrite_r_file()helper so the temporary file outlives the helper call (was deleted immediately bywithr::local_tempfile(); now usestempfile()+withr::defer(..., envir = parent.frame())). -
tests/testthat/test-s3-methods.R: replacedigraph::V(g)$attr <- NULLwithigraph::delete_vertex_attr()/igraph::delete_edge_attr()to match the igraph 2.x API.
New features
Graph construction
-
build_rrlm_graph()– build a typed knowledge graph for any R project. -
update_graph_incremental()– re-parse only changed files for fast single-file updates. -
extract_function_nodes()– AST-based function node extraction supporting standard assignments, S4 generics/methods, and R5/R6 classes. -
find_calls_in_body()– enumerate global symbol references in a function body, filtering NSE false-positives. -
build_call_edges()– intra-project CALLS edges. -
build_import_edges()– IMPORTS edges from source files to package dependencies (library calls, qualified calls, and DESCRIPTION fields). -
build_test_edges()– TEST edges from test files to user-defined functions.
Querying and context assembly
-
query_context()– relevance-guided BFS producing a token-budgeted context object for use with an LLM. -
compute_relevance()– composite relevance score (semantic, PageRank, task-trace, co-change). -
build_node_context()– full or compressed text representation of a single graph node. -
assemble_context_string()– structured, LLM-ready prompt string from ranked node hits.
Embedding
-
embed_nodes()– TF-IDF (default), Ollama, or OpenAI dense embeddings. -
embed_query()– project a free-text query into the model’s vector space. -
cosine_similarity()– cosine similarity between two numeric vectors. -
ollama_available()– runtime check for a reachable Ollama daemon.
LLM interface
-
chat_with_context()– chat with an LLM using graph-derived context; usesellmerwhen installed, falls back tohttr2.
Task learning
-
log_task_trace()– append a JSONL feedback entry to.rrlmgraph/task_trace.jsonl. -
update_task_weights()– apply exponential decay and accumulate per-node weights from the trace file. -
update_task_polarity()– rewrite polarity values of recent trace entries.
Cache and export
-
save_graph_cache()– serialise graph to.rrlmgraph/graph.rds. -
load_graph_cache()– restore graph from cache, refreshing task weights. -
is_cache_stale()– compare cache mtime against R source files. -
export_to_sqlite()– write nodes, edges, and traces to a SQLite database for the TypeScript MCP server.
Project detection
-
detect_rproject()– detect project type and discover all R source files.
Instructions
-
generate_instructions()– generate a Copilot-style instruction Markdown file from the project graph.
S3 methods