hermes-agent/tools
teknium1 1cfc3425af fix(checkpoints): require positive volume-attachment evidence before orphan classification
Follow-up to the cherry-picked #69063: egilewski's review found that the
_dir_has_any_entry(parent) guard treats ANY entry in the mount point's
parent as proof the volume is attached — but unmounting exposes the
UNDERLAY directory's own files (e.g. a .keep placeholder), so a populated
underlying mount-point dir still classified the project as an orphan and
deleted its ref/index/metadata. Reproduced on both main and the PR head.

Attachment evidence is now positive instead of circumstantial:

* _volume_evidence() records the parent directory's (st_dev, st_ino)
  identity in the project's metadata while the workdir is observably
  live (at _register_project/_touch_project time). A mount point
  resolves to the mounted filesystem's root while attached and to the
  underlay directory after detach — same path, different directory,
  different identity.
* _workdir_is_observably_gone() now requires the parent visible at
  prune time to match that recorded identity before the populated-parent
  check can classify an orphan. A mismatch means a different directory
  (the underlay) is showing through — a detached volume, not an
  observed deletion.
* Metadata without a recorded identity (written by older versions) is
  never orphan-classified — unsure never deletes; the retention/stale
  rule still reclaims genuinely abandoned projects off last_touch.
* The frozen pre-v2 layout has no metadata channel for the identity, so
  it keeps the structural checks only (require_parent_identity=False).
* A failed evidence probe on re-registration preserves the previously
  recorded identity — stale evidence can only make pruning MORE
  conservative.

Windows: st_dev/st_ino of 0 (filesystems without file IDs, some network
shares) is treated as "no evidence recorded", which falls into the
conservative never-orphan path. os.path.ismount and Path.stat are
cross-platform; no POSIX-only calls added.

tests/tools/test_checkpoint_manager.py: adds egilewski's exact
regression (checkpoint history for mnt/volume/project, detach exposes
mnt/volume/.keep, prune with orphan deletion enabled → NOT deleted;
fails on the bare cherry-pick, passes with this fix), plus
no-recorded-identity conservatism and probe-failure identity
preservation. His absent-parent/empty-parent/retention/genuine-deletion/
live-project controls all still pass.

Reported-by: egilewski (review on #69063)
2026-07-24 19:10:34 -07:00
..
computer_use fix: repair sweep fallout — duplicate encoding kwargs, non-subprocess call sites, kwarg-snapshot tests 2026-07-24 11:45:57 -07:00
environments fix: repair sweep fallout — duplicate encoding kwargs, non-subprocess call sites, kwarg-snapshot tests 2026-07-24 11:45:57 -07:00
neutts_samples
…
__init__.py
…
ansi_strip.py
…
approval.py
…
async_delegation.py fix(gateway,tools,agent): close leaked SQLite connections in delivery, delegation, and verification ledgers 2026-07-24 15:55:08 -07:00
binary_extensions.py
…
blueprints.py
…
browser_camofox.py
…
browser_camofox_state.py
…
browser_cdp_tool.py
…
browser_dialog_tool.py
…
browser_supervisor.py
…
browser_tool.py fix: add explicit UTF-8 encoding to all subprocess text=True calls (#53428) 2026-07-24 11:45:57 -07:00
budget_config.py
…
checkpoint_manager.py fix(checkpoints): require positive volume-attachment evidence before orphan classification 2026-07-24 19:10:34 -07:00
clarify_gateway.py fix(clarify): one canonical timeout across CLI, TUI/desktop, and gateway (#69774) 2026-07-22 23:25:13 -05:00
clarify_tool.py
…
close_terminal_tool.py
…
code_execution_tool.py fix(kanban): harden delegated-child mutation boundary 2026-07-23 07:33:36 -07:00
computer_use_tool.py
…
credential_files.py
…
cronjob_tools.py fix(cron): reconcile external provider after a claimed direct run (#70479) 2026-07-24 13:37:04 +10:00
daemon_pool.py
…
debug_helpers.py
…
delegate_tool.py fix(gateway): deliver kanban/delegate wake-ups to api_server sessions 2026-07-23 11:55:17 -07:00
delegation_live_log.py
…
desktop_ui.py
…
discord_tool.py
…
env_passthrough.py
…
env_probe.py fix(windows): re-fit env_probe console suppression to the temp-file _run + add no-window tests (#67690 follow-up) 2026-07-23 18:20:24 -07:00
fal_common.py
…
feishu_doc_tool.py
…
feishu_drive_tool.py
…
file_operations.py
…
file_state.py
…
file_tools.py
…
focus_pane_tool.py
…
fuzzy_match.py
…
homeassistant_tool.py
…
hook_output_spill.py
…
image_generation_tool.py
…
image_source.py
…
interrupt.py
…
kanban_tools.py fix(gateway): deliver kanban/delegate wake-ups to api_server sessions 2026-07-23 11:55:17 -07:00
lazy_deps.py fix: add explicit UTF-8 encoding to all subprocess text=True calls (#53428) 2026-07-24 11:45:57 -07:00
managed_tool_gateway.py fix(windows): sweep remaining bare read_text/write_text sites + linter rule 2026-07-24 17:10:39 -07:00
mcp_dashboard_oauth.py
…
mcp_oauth.py
…
mcp_oauth_manager.py
…
mcp_stdio_watchdog.py
…
mcp_tool.py fix(mcp): use encoding_error_handler='replace' for stdio transport 2026-07-24 15:47:12 -07:00
memory_tool.py fix(memory): close second-read drift race and treat invalid UTF-8 as unreadable 2026-07-24 15:58:01 -07:00
microsoft_graph_auth.py
…
microsoft_graph_client.py
…
neutts_synth.py
…
open_preview_tool.py
…
openrouter_client.py
…
osv_check.py
…
patch_parser.py
…
path_security.py
…
process_registry.py fix(process_registry): reader loop no longer hangs when an orphaned grandchild holds the stdout pipe 2026-07-24 15:59:02 -07:00
project_tools.py
…
read_extract.py
…
read_terminal_tool.py
…
registry.py
…
schema_sanitizer.py
…
send_message_tool.py fix(slack): prefer live send adapter and try multi-workspace tokens individually 2026-07-23 12:01:24 -07:00
session_search_tool.py fix(search): require compacted=1 not just active=0, scope delegation-under-compression 2026-07-22 16:59:09 -07:00
skill_manager_tool.py fix(skills): scope 60-char description enforcement to the create path 2026-07-24 07:54:21 -07:00
skill_provenance.py
…
skill_usage.py fix(skills): tolerate non-UTF-8 bytes in hub lock.json 2026-07-24 17:10:39 -07:00
skills_ast_audit.py
…
skills_guard.py
…
skills_hub.py fix: add UTF-8 encoding to read_text/write_text in tools/ and agent/ 2026-07-24 17:10:39 -07:00
skills_sync.py fix: add UTF-8 encoding to read_text/write_text in tools/ and agent/ 2026-07-24 17:10:39 -07:00
skills_tool.py fix(skills): scope 60-char description enforcement to the create path 2026-07-24 07:54:21 -07:00
slash_confirm.py
…
terminal_tool.py fix(kanban): keep delegated results in worker turn 2026-07-23 08:33:55 -07:00
thread_context.py
…
threat_patterns.py
…
tirith_security.py fix: add explicit UTF-8 encoding to all subprocess text=True calls (#53428) 2026-07-24 11:45:57 -07:00
todo_tool.py
…
tool_backend_helpers.py
…
tool_output_limits.py
…
tool_result_storage.py
…
tool_search.py
…
transcription_tools.py fix(tools): utf-8 decode for STT/TTS command-provider popen_kwargs 2026-07-24 15:47:12 -07:00
tts_streaming.py feat(voice): speech-interrupted latch in the TTS streaming core 2026-07-22 17:53:06 -05:00
tts_tool.py fix(tools): utf-8 decode for STT/TTS command-provider popen_kwargs 2026-07-24 15:47:12 -07:00
url_safety.py fix(url_safety): harden proxy DNS delegation — literal IPs stay fail-closed + regression tests 2026-07-24 10:37:29 -07:00
video_generation_tool.py
…
vision_tools.py fix(security): pin DNS resolutions for SSRF-safe fetches 2026-07-23 11:44:43 -07:00
voice_mode.py fix: add explicit UTF-8 encoding to all subprocess text=True calls (#53428) 2026-07-24 11:45:57 -07:00
web_tools.py fix: add encoding="utf-8" to Path.write_text() calls (P1) 2026-07-24 17:10:39 -07:00
website_policy.py
…
write_approval.py
…
x_search_tool.py docs(xai): clarify x_search vs xurl routing without schema cross-refs 2026-07-23 21:06:47 -07:00
xai_http.py fix: add UTF-8 encoding to read_text/write_text in tools/ and agent/ 2026-07-24 17:10:39 -07:00
xai_video_tools.py
…
yuanbao_tools.py
…