Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 12 additions & 2 deletions R/doc_scan.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<vignette>",
project = project_name,
Expand Down Expand Up @@ -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("")
}
""
Expand Down
2 changes: 1 addition & 1 deletion R/fn_graph.R
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion R/pkg_graph.R
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion R/symbols.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ 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

0 errors | 0 warnings | 0 notes

## 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.
7 changes: 6 additions & 1 deletion inst/tinytest/test_session_start.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion man/fn_graph.Rd
Original file line number Diff line number Diff line change
@@ -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, ...)
}
Expand Down
2 changes: 1 addition & 1 deletion man/pkg_graph.Rd
Original file line number Diff line number Diff line change
@@ -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, ...)
Expand Down
2 changes: 1 addition & 1 deletion man/symbols.Rd
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down