Package 'rho.coding'

Title: Rho Coding Tools
Description: Supplies coding-agent tools with explicit execution semantics, including cross-platform Bash selection, process execution in mirai workers, isolated R evaluation, opt-in current-session R evaluation, and a locked JSONL implementation of the agent session-journal contract.
Authors: Sounkou Mahamane Toure [aut, cre]
Maintainer: Sounkou Mahamane Toure <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1.9001
Built: 2026-07-21 22:52:04 UTC
Source: https://github.com/RGenomicsETL/Rho

Help Index


Coding tools and their execution contracts

Description

The shell contract preserves Bash semantics across platforms and returns a typed resolution explaining which executable was selected. Shell processes execute through rho.compute and processx.

Details

R evaluation has explicit state semantics: RhoMiraiExpressionEvaluator is isolated and may overlap, while RhoCurrentSessionREvaluator receives a caller-supplied environment and requires exclusive scheduling.


Authored memory revisions and tools

Description

Authored memory is an append-only temporal port. rho_remember() creates a live note, rho_edit_memory() applies a typed edit only when its expected revision is still current, and rho_forget() appends a tombstone. Recall and history retain attribution and revision identity; no operation destroys an earlier observation.

Details

MemoryStore is the structural interface consumed by the coding tools. rho_in_memory_memory_store() is the process-local reference implementation. Other packages can implement the same generics over DuckDB, NNG, or another temporal observation store.

rho_memory_tools() returns remember, recall, edit_memory, forget, and memory_history. Mutating calls require an explicit author. Edit and forget require the revision identifier returned by recall, so a stale model action resolves to RhoMemoryConflict instead of overwriting newer work.


JSON session documents and the coding-host JSONL journal

Description

rho_json_session_codec() contains an explicit registry of stable semantic record types. A RhoJsonSemanticAdapter maps one stable wire tag and field set to the current in-memory S7 class. Package names, S7 class names, and reflected property sets are never written to the journal. An extension adds a value by supplying rho_json_semantic_adapter() with its own stable tag and explicit fields.

Details

rho_encode_session_value() and rho_decode_session_value() retain R atomic storage modes, list names, missing values, and registered semantic values. Unknown S7 objects resolve to RhoSessionCodecErrorValue rather than acquiring an accidental storage schema from the current package namespace.

rho_jsonl_session_journal() implements the SessionJournal interface as a coding-host adapter. File reads, locking, validation, and append run in mirai workers. Each LF-delimited entry record carries a committed position and typed entry document. A file lock and the append request's expected position reject stale writers before mutation. A missing final LF, malformed record, or invalid semantic document resolves to a typed error value.