Skip to content

fix!: keep unavailable command outcomes neutral - #381

Merged
eitsupi merged 4 commits into
mainfrom
fix/neutral-unobserved-outcomes
Sep 27, 2026
Merged

eitsupi merged 4 commits into
mainfrom
fix/neutral-unobserved-outcomes

Conversation

@eitsupi

@eitsupi eitsupi commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • distinguish successful, failed, and unavailable command outcomes without replacing R's native REPL
  • keep prompt, history, history-forget, and sponge state neutral when error tracking is unavailable
  • preserve and chain the startup options(error) handler through lexical closure capture while respecting later user changes
  • avoid evaluating active bindings or writing active/locked tracking bindings across the Rust/R boundary
  • evaluate the internal setup code in the base environment so user workspace masking cannot affect it

R compatibility

Safe binding inspection uses R_existsVarInFrame, which became public in R 4.2. The symbol is loaded as an optional capability rather than a requirement for loading libR.

Capability Behavior
R_existsVarInFrame available Install the error wrapper and provide full success/failure tracking
R_existsVarInFrame unavailable, including standard R versions older than 4.2 Do not install the wrapper; leave outcomes unavailable, history exit statuses NULL, the prompt neutral, and history-forget/sponge state unchanged

This is a breaking change for command outcome tracking on R versions without that API, but it does not establish R 4.2 as arf's minimum supported R version. Normal R semantics take priority over outcome accuracy.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features --workspace --locked -- -D warnings
  • cargo test --all-targets --all-features --workspace --locked
  • interactive product test with R 4.0.5 and R 4.1.3: no tracking state or wrapper is installed, errors return to the prompt, and later evaluation succeeds
  • interactive product test with R 4.4.3: the wrapper is installed, failures update the prompt, and evaluation continues afterward

@eitsupi
eitsupi marked this pull request as draft September 27, 2026 08:39
@eitsupi eitsupi changed the title fix: keep unavailable command outcomes neutral fix!: keep unavailable command outcomes neutral Sep 27, 2026
@eitsupi
eitsupi marked this pull request as ready for review September 27, 2026 09:43
@eitsupi
eitsupi merged commit 03a5b17 into main Sep 27, 2026
13 checks passed
@eitsupi
eitsupi deleted the fix/neutral-unobserved-outcomes branch September 27, 2026 09:44
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