Skip to content

cleanup for CRAN#5

Merged
egenn merged 15 commits into
mainfrom
devel
Apr 29, 2026
Merged

cleanup for CRAN#5
egenn merged 15 commits into
mainfrom
devel

Conversation

@egenn
Copy link
Copy Markdown
Member

@egenn egenn commented Apr 28, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 28, 2026 22:34
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the package to version 0.8.1, adds API documentation links, and introduces a verbosity parameter to the available_tools function. It also modifies the security logging logic to use getOption with a temporary file fallback to satisfy CRAN policies. A high-severity bug was identified in the Agent's generate method, where the removal of the default logfile fallback could result in a NULL value being passed to the logging function, causing a crash during security incident reporting.

Comment thread r/R/07_Agent.R Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the rtemis.llm package for CRAN readiness by tightening documentation, metadata, and defaults (notably around tool listings and security/audit logging) while fixing minor example syntax issues.

Changes:

  • Refresh package metadata (version/date/Description URLs) and add bug-report links.
  • Make available_tools() support a verbosity argument and document it.
  • Adjust security logging defaults to avoid writing into the working directory, and clean up examples/docs.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
r/man/rtemis.llm-package.Rd Adds GitHub issues link in “Useful links”.
r/man/responses.Rd Fixes example call syntax (adds missing comma).
r/man/reasoning.Rd Fixes example call syntax (adds missing comma).
r/man/llmapply.Rd Fixes example call syntax (adds missing comma).
r/man/available_tools.Rd Documents new verbosity parameter and updated return wording.
r/R/zzz.R Cleans comments and changes startup message emoji.
r/R/utils_security.R Moves incident log default to getOption(..., tempfile(...)) to satisfy CRAN expectations.
r/R/map.R Fixes roxygen example call syntax (adds missing comma).
r/R/07_Agent.R Updates logfile documentation and changes logfile resolution in generate.Agent.
r/R/00_init.R Implements available_tools(verbosity = 1L) behavior (conditional printing).
r/DESCRIPTION Bumps version/date and adds explicit endpoint URLs in Description.
Makefile Ensures document-r runs formatting first.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread r/R/07_Agent.R Outdated
Comment thread r/R/utils_security.R
"rtemis_security_logfile",
tempfile("rtemis_security_log_", fileext = ".jsonl")
)
) {
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because generate.Agent passes logfile = logfile explicitly, this default only applies when the argument is omitted; if logfile is explicitly NULL, the fallback here won’t run and incident logging will write to stdout instead of a file. To make logging robust, defensively coerce NULL to the getOption/tempfile fallback inside the function body (or avoid passing NULL from the caller).

Suggested change
) {
) {
if (is.null(logfile)) {
logfile <- getOption(
"rtemis_security_logfile",
tempfile("rtemis_security_log_", fileext = ".jsonl")
)
}

Copilot uses AI. Check for mistakes.
Comment thread r/R/07_Agent.R Outdated
Comment on lines 28 to 33
#' @field logfile Optional character: Path to the agent's security log. Important! If NULL, the package
#' defaults to
#' `getOption("rtemis_security_logfile", tempfile("rtemis_security_log_", fileext = ".jsonl"))` to
#' satisfy CRAN policy. It is important to set it to a non-temporary location that will persist
#' and you can access. Otherwise, security incidents may be missed. Can be overridden per call
#' on [generate].
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring says the package defaults the agent logfile to getOption("rtemis_security_logfile", tempfile(...)) when logfile is NULL, but the Agent constructor currently stores logfile = NULL without resolving it. Either implement this default resolution (e.g., in the constructor or generate path) or adjust the documentation so it matches actual behavior.

Suggested change
#' @field logfile Optional character: Path to the agent's security log. Important! If NULL, the package
#' defaults to
#' `getOption("rtemis_security_logfile", tempfile("rtemis_security_log_", fileext = ".jsonl"))` to
#' satisfy CRAN policy. It is important to set it to a non-temporary location that will persist
#' and you can access. Otherwise, security incidents may be missed. Can be overridden per call
#' on [generate].
#' @field logfile Optional character: Path to the agent's security log. If NULL, no agent-level
#' logfile path is stored on the object. For persistent security logging, set this to a
#' non-temporary location that will persist and you can access. Otherwise, security incidents
#' may be missed. Can be overridden per call on [generate].

Copilot uses AI. Check for mistakes.
@egenn egenn merged commit 10e585c into main Apr 29, 2026
1 check passed
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.

2 participants