summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 12:41:52 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 12:41:52 -0400
commit271bb3251267fec68f5c9cec63314b22cfaefe75 (patch)
tree7807872b74b49ba77a145c51c405f690425c6b43 /debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py
parent05797fd8cf884bb680540dfc188f36836a215c9f (diff)
downloadopen-iov-271bb3251267fec68f5c9cec63314b22cfaefe75.tar.gz
open-iov-271bb3251267fec68f5c9cec63314b22cfaefe75.zip
debug: risc-v-gsp-rm-debugger final pass - remove in-development notices, complete rename, adversarial-review fixes
Remove the '# TOOL IN DEVELOPMENT - NOT READY YET!' notices from the tool docs/README/scripts and the project docs; record the removal (2026-10-02) against the tool audit (debug/risc-v-gsp-rm-vm/docs/27-TOOL-AUDIT.md), the 194-test suite and the value-validation demos (docs/25-VALUE-VALIDATION.md). Complete the cosmetic rename to risc-v-gsp-rm-debugger in user-facing prose and commands (launcher, roadmap, docs); internal greeneye package and code identifiers unchanged. Adversarial-review fixes: deterministic control-discovery sweep (flaky test root-caused), UUID session dirs + atomic JSON writes for concurrent runs, Ghidra bridge loopback enforcement and clean shutdown, fp register restore in Session.call, version_diff --dry-run, 30 s interrupt budget, dry-run non-destructiveness verified. Docs: flag-removal records, link fixes, command/flag corrections (fdematch arity, port_new_device --out, trace filename), F2 orchestration note in future-eng-ops; STATE-CURRENT status refreshed.
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py')
-rw-r--r--debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py b/debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py
index 0733c48..ebbc390 100644
--- a/debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py
+++ b/debug/risc-v-gsp-rm-vm/harness/value_demos/_common.py
@@ -17,6 +17,7 @@ import json
import os
import shutil
import sys
+import tempfile
import time
HERE = os.path.dirname(os.path.abspath(__file__))
@@ -95,11 +96,24 @@ def artifact_dir(name: str) -> str:
return path
+def session_dir(root: str, label: str = "session") -> str:
+ """A unique recording dir under ``root``.
+
+ Demos share a fixed artifact root so their reports are discoverable, but
+ two concurrent demo runs (tests, agents) must never share one
+ ``events.jsonl`` or a reader can see a half-written recording.
+ """
+ os.makedirs(root, exist_ok=True)
+ return tempfile.mkdtemp(prefix=f"{label}-", dir=root)
+
+
def write_json(path: str, payload) -> str:
os.makedirs(os.path.dirname(path), exist_ok=True)
- with open(path, "w", encoding="utf-8") as fh:
+ tmp = f"{path}.tmp-{os.getpid()}"
+ with open(tmp, "w", encoding="utf-8") as fh:
json.dump(payload, fh, indent=2, sort_keys=True)
fh.write("\n")
+ os.replace(tmp, path)
return path