π‘οΈ hermes-time-machine
Zero-Risk Autonomous Time Travel & Self-Healing for Hermes Agent & Desktop
Built for the Nous Research Hermes Agent Hackathon
β‘ What is Time Machine?
hermes-time-machine transforms Hermes Agent into a fearless, zero-risk autonomous software developer. By maintaining an isolated bare git store and SQLite ledger inside the plugin's private data directory ($HERMES_HOME/plugin-data/time-machine/), it provides both human operators and autonomous agents with:
- Autonomous Self-Healing Recovery (
time_machine_recover): Diagnoses broken tests, identifies root-cause culprit edits from tracebacks, safely stages restoration plans in dry-run mode, and returnssuggested_verify_commandfor execution through Hermes' nativeterminaltool. - Surgical Per-File Rollback (
time_machine_restore): Reverts only the broken file while preserving newly added features in other files. Never executesgit checkout -fon the user's repository. - Rollback of a Rollback Safety Net: Captures an automatic
pre_restore_safety_backupsnapshot in the plugin's bare store before any file is restoredβzero data loss guarantee. - Human Approval Guard: Restorations default to preview mode (
dry_run=true) and require explicit user approval (via/tm restore <snapshot_id>or interactive confirmation) before modifying files on disk. - "What Introduced This?" Diff Search (
time_machine_search): Search code diffs across history to pinpoint exact snapshots and line numbers. - Hermes Desktop & Dashboard Surfaces: Status bar indicator (
statusBar.right), timeline sidebar pane (panes), and web dashboard tab.
π‘οΈ Architecture & Security Guarantees
-
Zero Host Test Runner
subprocess.run:
time_machine_recovernever executes user verification commands directly on the host. Instead, it diagnoses the failure, stages the recovery, and returnssuggested_verify_commandin its structured payload. The model then executes the test via Hermes's ownterminaltool under the user's configured backend (Docker, SSH, or local host) with proper user approval and environment isolation. -
Real Human Approval Guard:
The model cannot unilaterally overwrite disk files by passing flags. All restorations default todry_run = True. Physical disk updates require explicit human approval via the/tm restore <id>slash command or interactive user confirmation. -
Isolated Private Storage (
$HERMES_HOME/plugin-data/time-machine/):
All plugin snapshots and metadata are kept strictly in the plugin's private data directory:- SQLite Ledger:
$HERMES_HOME/plugin-data/time-machine/ledger.db - Bare Git Store:
$HERMES_HOME/plugin-data/time-machine/store(project refs atrefs/time-machine/{hash16})
The plugin never touches or mutates$HERMES_HOME/state.dbor core checkpoint directories.
- SQLite Ledger:
-
Surgical Blob Extraction (No
git checkout -f):
Files are restored by extracting individual blobs directly from the plugin's private bare git store (git --git-dir=... show <commit>:<file>) and writing them surgically to the target file. It never detachesHEADor runsgit checkout -fin the user's workspace. -
Path Traversal & Boundary Safety:
All target files are strictly scoped toctx.session_cwdand validated withresolve(). Paths traversing outside the workspace boundary are rejected. -
Native Conversation State Handled by Core:
Conversation branch creation and tree management are delegated to Hermes core's native/rewindand/branchcommands.
ποΈ Repository Layout
hermes-time-machine/
βββ plugin.yaml # Manifest declaring 5 tools, 4 hooks, and /tm command
βββ __init__.py # Plugin lifecycle hooks, /tm slash command, and context bridge
βββ ledger.py # SQLite ledger + private bare git store manager
βββ schemas.py # Tool schemas (5 tools with dry-run default)
βββ tools.py # Tool handlers strictly scoped to ctx.session_cwd
βββ dashboard/
β βββ manifest.json # Declares backend FastAPI extension router
β βββ plugin_api.py # REST endpoints (/status, /snapshots, /diff, /restore, /recover, /search)
β βββ dist/
β βββ index.js # Web dashboard UI bundle registered with window.__HERMES_PLUGINS__
βββ desktop/
β βββ plugin.js # Desktop SDK UI (statusBar.right chip + panes timeline)
βββ scripts/
β βββ demo_walkthrough.py # Standalone reproducible walkthrough script
βββ tests/
β βββ test_plugin.py # Unit & integration test suite
β βββ desktop_plugin.test.mjs # Automated Node.js Desktop SDK test
βββ README.md
π§ Tools & Commands
1. Agent Toolset (tools.py)
time_machine_list_snapshots: List snapshots captured during the current session.time_machine_diff: View unified diff between a snapshot and current workspace (or between two snapshots).time_machine_restore: Preview or surgically restore files from a snapshot (defaults todry_run=true).time_machine_recover: Diagnose test failures, identify culprit files, and return recovery diff +suggested_verify_command.time_machine_search: Search code diffs across history by keyword or symbol.
2. User Slash Command (/tm)
/tmor/tm list: Display recent session snapshots in a clean table./tm diff <snapshot_id>: Show unified diff of a snapshot against workspace./tm restore <snapshot_id> [files...]: Explicitly approve and execute surgical file restore./tm recover: Run self-healing diagnostic and display recommended recovery plan./tm search <query>: Search history for commits introducing specific lines or symbols./tm export: Export full session history formatted as Markdown.
3. Core Commands for Conversation State
/rewind: Core Hermes command to rewind conversation turns and messages./branch: Core Hermes command to branch the session into a new conversation tree.
π§ͺ Verification & Testing
Official Hermes Admission Validator
Tested against hermes plugins validate from Hermes core:
β manifest β plugin.yaml parses
β manifest fields β name, version, description present
β requires_hermes β spec '>=0.21.0' parses
β config schema β shape valid
β requires_env β all entries UPPER_SNAKE
β oauth β not declared
β loadable β entry: __init__.py, desktop/plugin.js
β python dependencies β none declared
β capability probe β register() ran in isolation
β declared tools β matches registrations
β declared hooks β matches registrations
β declared middleware β matches registrations
β built-in tool collisions β no collisions
β security scan β safe
β no core override β no runtime rebinds of Hermes core
β desktop surface β stays inside the plugin SDK surface
β Isolation β runs in the plugin host (plugins.isolation: host)
Validation passed. (16/16 Checks Passed, 0 Errors, 0 Warnings)
Official Hermes Plugin Catalog Validator
python scripts/validate_plugin_catalog.py plugin-catalog/time-machine.yaml
OK: 1 file(s) valid
π Quick Start
1. Installation
Clone into your Hermes plugins directory:
git clone https://github.com/Prasad-PingFederate/hermes-time-machine.git ~/.hermes/plugins/time-machine
2. Run Tests
pytest tests/test_plugin.py -v
node --test tests/desktop_plugin.test.mjs
README from the reviewed commit 9e02342; it updates when the author re-pins.

Prasad-PingFederate