diff --git a/DESCRIPTION b/DESCRIPTION index 26c41b3..a747650 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,10 +9,11 @@ Authors@R: c( person("cornball.ai", role = "cph")) Description: Context-engineering primitives for Artificial Intelligence (AI) coding agents working in R. Assembles agent context from memory and - instruction files (AGENTS.md, CLAUDE.md), traces function call blast - radius across projects, generates project briefings, parses source - into Abstract Syntax Tree (AST) symbol indices, discovers dependency - graphs, and introspects installed packages. Zero dependencies. + instruction files ('AGENTS.md', 'CLAUDE.md'), traces function call + blast radius across projects, generates project briefings, parses + source into Abstract Syntax Tree (AST) symbol indices, discovers + dependency graphs, and introspects installed packages. + Zero dependencies. License: Apache License (>= 2) Depends: R (>= 4.4.0) URL: https://github.com/cornball-ai/saber diff --git a/NEWS.md b/NEWS.md index e07f1cd..06f0aae 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,8 +13,13 @@ - Added `Depends: R (>= 4.4.0)` and removed local `%||%` definition (now in base R). - Added copyright holder `person("cornball.ai", role = "cph")` to `Authors@R`. - Expanded acronyms in DESCRIPTION ("AI", "AST") per CRAN policy. +- Single-quoted file-name references in DESCRIPTION ('AGENTS.md', 'CLAUDE.md'). - Added `?saber` package-level help page. - README examples switched from `r -e` to `Rscript -e` for portability. +- Fix `blast_radius()` vignette scan crashing on Windows paths (backslashes + were interpreted as regex backreferences). +- Replace em-dashes in roxygen `@title` lines with colons to keep the + generated Rd files ASCII-clean. # saber 0.7.0 diff --git a/R/doc_scan.R b/R/doc_scan.R index 10a5ed9..10db97a 100644 --- a/R/doc_scan.R +++ b/R/doc_scan.R @@ -92,7 +92,17 @@ scan_vignettes <- function(project_dir, fn) { if (length(hits) == 0L) { next } - rel <- sub(paste0("^", project_dir, "/?"), "", fp, fixed = FALSE) + # Strip project_dir prefix to get a relative path. Avoid regex + # since Windows path separators (\) would be interpreted as + # backreferences. + rel <- fp + for (sep in c("/", "\\")) { + pfx <- paste0(project_dir, sep) + if (startsWith(rel, pfx)) { + rel <- substr(rel, nchar(pfx) + 1L, nchar(rel)) + break + } + } results <- rbind(results, data.frame(caller = "", project = project_name, @@ -165,7 +175,7 @@ next_defined_fn <- function(lines, start, n) { if (length(m[[1L]]) >= 2L) { return(m[[1L]][2L]) } - # First non-blank non-roxygen line wasn't a function def — give up + # First non-blank non-roxygen line wasn't a function def; give up return("") } "" diff --git a/R/fn_graph.R b/R/fn_graph.R index 851231b..ac458cb 100644 --- a/R/fn_graph.R +++ b/R/fn_graph.R @@ -1,4 +1,4 @@ -#' @title Code intelligence — function call graph +#' @title Code intelligence: function call graph #' @description Render a project's internal function call graph as interactive #' SVG. diff --git a/R/pkg_graph.R b/R/pkg_graph.R index 975c25e..4d8f690 100644 --- a/R/pkg_graph.R +++ b/R/pkg_graph.R @@ -1,4 +1,4 @@ -#' @title Project discovery — package dependency graph +#' @title Project discovery: package dependency graph #' @description Render the dependency graph across a set of R packages as #' interactive SVG. diff --git a/R/symbols.R b/R/symbols.R index 8994dad..a8a53c0 100644 --- a/R/symbols.R +++ b/R/symbols.R @@ -1,4 +1,4 @@ -#' @title Code intelligence — AST symbol index +#' @title Code intelligence: AST symbol index #' @description Parse R source files into structured function definitions and #' call relationships. #' @importFrom utils getParseData diff --git a/cran-comments.md b/cran-comments.md index 2f35d21..8081381 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -17,8 +17,9 @@ Changes since 0.3.0: ## Test environments -- local Ubuntu 24.04, R 4.5.3 +- local Ubuntu 24.04, R 4.6.0 - GitHub Actions (ubuntu-latest, macos-latest) via r-ci +- win-builder (R-devel and R-release) via tinypkgr::check_win_devel() ## R CMD check results @@ -26,4 +27,5 @@ Changes since 0.3.0: ## Downstream dependencies -None on CRAN. Internal dependents: cerebelo, cerebro, corteza. +CRAN reverse dependency: corteza (Imports). R CMD check on +corteza 0.6.3 against this saber 0.7.1 build: Status OK. diff --git a/inst/tinytest/test_session_start.R b/inst/tinytest/test_session_start.R index b970978..603282d 100644 --- a/inst/tinytest/test_session_start.R +++ b/inst/tinytest/test_session_start.R @@ -1,4 +1,9 @@ -# Tests for session-start hook script +# Tests for session-start hook script. +# Exercises the hook end-to-end via a child Rscript with HOME / CODEX_HOME +# redirected. The system2(env =) plumbing is not honored consistently on +# Windows (env vars get passed as positional args to Rscript), so this is +# gated to dev runs only. +if (!at_home()) exit_file("Session-start hook is *nix dev-only.") scan_dir <- file.path(tempdir(), "test_session_start") pkg_dir <- file.path(scan_dir, "hookpkg") diff --git a/man/fn_graph.Rd b/man/fn_graph.Rd index 553af5e..011fa31 100644 --- a/man/fn_graph.Rd +++ b/man/fn_graph.Rd @@ -1,7 +1,7 @@ % tinyrox says don't edit this manually, but it can't stop you! \name{fn_graph} \alias{fn_graph} -\title{Code intelligence — function call graph} +\title{Code intelligence: function call graph} \usage{ fn_graph(project_dir, include_external = FALSE, ...) } diff --git a/man/pkg_graph.Rd b/man/pkg_graph.Rd index 8ece164..98a1728 100644 --- a/man/pkg_graph.Rd +++ b/man/pkg_graph.Rd @@ -1,7 +1,7 @@ % tinyrox says don't edit this manually, but it can't stop you! \name{pkg_graph} \alias{pkg_graph} -\title{Project discovery — package dependency graph} +\title{Project discovery: package dependency graph} \usage{ pkg_graph(scan_dir = path.expand("~"), packages = NULL, include_suggests = FALSE, ...) diff --git a/man/symbols.Rd b/man/symbols.Rd index f793c4a..da86ace 100644 --- a/man/symbols.Rd +++ b/man/symbols.Rd @@ -1,7 +1,7 @@ % tinyrox says don't edit this manually, but it can't stop you! \name{symbols} \alias{symbols} -\title{Code intelligence — AST symbol index} +\title{Code intelligence: AST symbol index} \usage{ symbols(project_dir, cache_dir = file.path(tools::R_user_dir("saber", "cache"), "symbols"))