From 5f07d9ece29894251814f0a1d7ccf01fb2c6ce09 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Mon, 1 Jun 2026 17:19:33 -0400 Subject: [PATCH] session: stop truncating hashes in REPL/render output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four sites in the session paths were truncating session_root and cache_key to 12-16 hex chars + "…". These are cryptographic content addresses — the WHOLE hash IS the identifier; truncation makes them unusable for copy-paste and forensic reference. Affected: - session.py render_tree() header - cli.py session --list output - cli.py session REPL banner - cli.py session REPL per-turn footer Other hash truncations elsewhere in cli.py (search/inspect/burn paths) are left alone — those are scan-and-skim views where ellipsis is the intended affordance. Touch them only when they bite. --- arborist/cli.py | 8 ++++---- arborist/qa/session.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arborist/cli.py b/arborist/cli.py index 85a6110..24c4b4f 100644 --- a/arborist/cli.py +++ b/arborist/cli.py @@ -7559,7 +7559,7 @@ def _cmd_session(args: argparse.Namespace) -> int: for s in listing: print( f" {s['sid']:32s} nodes={s['n_nodes']:3d} " - f"root={s['session_root'][:12]}… " + f"root={s['session_root']} " f"updated={s['updated_at']}" ) return 0 @@ -7647,7 +7647,7 @@ def _cmd_session(args: argparse.Namespace) -> int: sess = Session.open(p, sid=sid) print(f"# session {sess.sid}", file=sys.stderr) print( - f"# db {p} · root {sess.session_root[:12]}…", + f"# db {p} · root {sess.session_root}", file=sys.stderr, ) print( @@ -7853,8 +7853,8 @@ def _session_repl(args: argparse.Namespace, sess) -> int: print(f"\n[{n.bates}] {audit_mode}") print(ans) print( - f"\n# root → {sess.session_root[:16]}… " - f"cache_key={ckey[:12]}…" + f"\n# root {sess.session_root}" + f"\n# cache_key {ckey}" ) finally: try: diff --git a/arborist/qa/session.py b/arborist/qa/session.py index 94bbf21..3e7d373 100644 --- a/arborist/qa/session.py +++ b/arborist/qa/session.py @@ -577,7 +577,7 @@ def render_tree(sess: Session) -> str: bps = sess.branches() lines: list[str] = [ f"session {sid} ({n_nodes} nodes · {len(bps)} branch points · " - f"root={sess.session_root[:12]}… · current → {cur})", + f"root={sess.session_root} · current → {cur})", ] root = sess.root_bates