poc-memory: POC_MEMORY_DRY_RUN=1 for agent testing

All mutating commands (write, delete, rename, link-add, journal write,
used, wrong, not-useful, gap) check POC_MEMORY_DRY_RUN after argument
validation but before mutation. If set, process exits silently — agent
tool calls are visible in the LLM output so we can see what it tried
to do without applying changes.

Read commands (render, search, graph link, journal tail) work normally
in dry-run mode so agents can still explore the graph.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kent Overstreet 2026-03-16 18:09:56 -04:00
parent 2ab9b78363
commit 7e131862d6
4 changed files with 18 additions and 0 deletions

View file

@ -9,3 +9,10 @@ pub mod agent;
pub mod admin;
pub mod journal;
pub mod misc;
/// Exit silently if POC_MEMORY_DRY_RUN=1.
pub fn check_dry_run() {
if std::env::var("POC_MEMORY_DRY_RUN").map_or(false, |v| v == "1" || v == "true") {
std::process::exit(0);
}
}