Skip to content

feat: Hermes Agent integration — memory provider, skills, crons#33

Open
benslockedin wants to merge 1 commit intomainfrom
feat/hermes-integration
Open

feat: Hermes Agent integration — memory provider, skills, crons#33
benslockedin wants to merge 1 commit intomainfrom
feat/hermes-integration

Conversation

@benslockedin
Copy link
Copy Markdown
Contributor

Summary

  • Memory provider for NousResearch Hermes Agent — 3 tools (alive_world, alive_load, alive_search), smart prefetch, stash persistence, squirrel YAML on session end
  • 11 Hermes skills in agentskills.io SKILL.md format (load, save, world, capture, search, create, bundle, daily, history, mine, cleanup)
  • 8 cron templates with setup script (morning rhythm, project pulse, inbox triage, health audit, stash router, mining, pruning, people refresh)
  • Runtime files — soul-patch.md (personality layer) + agents.md (squirrel runtime rules)
  • 3-path onboarding installer — detects ALIVE/Hermes/both and guides setup

Built from the 14-page alive-hermes-spec.pdf (LaTeX). Memory provider tested: 138 walnuts discovered, smart prefetch working, stash persistence confirmed.

Companion PR to NousResearch/hermes-agent will add just the memory provider (3 files) following the pattern of their existing providers (Honcho, Mem0, etc.).

Test plan

  • Run memory provider import test: python -c "from hermes.memory_provider import ALIVEProvider; p = ALIVEProvider(); print(p.is_available())"
  • Test alive_world tool returns walnut list
  • Test alive_load tool returns briefing for a known walnut
  • Run full Hermes Agent session with ALIVE as memory provider
  • Test setup-crons.sh registers all 8 crons
  • Verify install.sh detects correct onboarding path

🤖 Generated with Claude Code

…runtime

Full ALIVE-Hermes integration built from the alive-hermes-spec.pdf:
- Memory provider (3 tools: alive_world, alive_load, alive_search)
- 11 Hermes skills in agentskills.io SKILL.md format
- 8 cron templates with setup script
- Runtime files (soul-patch.md, agents.md)
- 3-path onboarding installer (install.sh)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@patrickSupernormal
Copy link
Copy Markdown

Merge safety review (advisory) — Patrick Brosnan, non-collaborator on alivecontext/alive. Comment weight only, not an approving review.

Verdict: YELLOW — 6 mechanical fixes needed in a follow-up commit before merge. Architecturally clean.

Headline: Architecturally this PR is the safest possible shape for a new-subsystem integration — pure additive (+2961/-0, zero deletions, zero modifications of existing files), everything under a new hermes/ top-level directory, stdlib-only Python (no PyYAML / requests / cryptography), zero file overlap with any other open PR, no hook registration inside plugins/alive/hooks/hooks.json, no changes to plugin.json. On merge, the worst-case impact is "a new directory exists" — no runtime interaction with the rest of the plugin. Path handling uses Path.relative_to(world_root) with a ValueError guard which correctly prevents escaping the world. Credit where due: this is how to ship a major new integration safely.

But 6 real bugs need a follow-up commit before merge:

  1. hermes/install.sh:2025-2032 — quoted heredoc silently disables shell expansion. cat > ... << 'WORLDKEY' uses a single-quoted delimiter, so line 2028 created: $(date +%Y-%m-%d) lands in the world key as the literal string $(date +%Y-%m-%d). Every Path B onboarding run produces a malformed .alive/key.md. Fix: change << 'WORLDKEY' to << WORLDKEY (unquoted) or compute the date into a variable first.

  2. hermes/hermes-skills/alive-search/SKILL.md:34 — typo: missing underscore in glob. First glob is "$ALIVE_WORLD_ROOT"/*/kernel/log.md (missing the _ prefix). Top-level walnuts (the common case, e.g. 04_Ventures/stellarforge/_kernel/log.md) are silently excluded from log search because the typo'd glob doesn't match them and the second glob needs 2 levels of nesting. Fix: */kernel/log.md*/_kernel/log.md.

  3. hermes/memory-provider/__init__.py:2838-2871started and ended timestamps both equal session-end time. on_session_end computes a single now_iso and writes it to both fields. initialize() never captures the start time. Every squirrel YAML entry shows zero-duration sessions. Fix: capture self._started_at in initialize(), use it for started: in on_session_end.

  4. hermes/memory-provider/__init__.py:2682-2694on_turn_start walks the entire world on every turn. for key_file in self._world_root.rglob("_kernel/key.md"): iterates every walnut on every user message, then only uses the result to emit a logger.debug(...) call — no state change. At 138 walnuts (per PR body), that's 138 filesystem stat calls per turn for a debug log line. Contradicts the provider's headline "smart prefetch saves tokens" value prop. Fix: cache at initialize() time, or remove the loop entirely since it doesn't influence state.

  5. hermes/setup-crons.sh:3050-3104 — silent error hiding on every hermes cron create. 2>/dev/null && echo "[+]" || echo "[!] failed" discards the stderr that would tell the operator WHY the create failed (hermes not installed, flag unknown, schedule invalid), and the || echo rescue prevents set -euo pipefail from aborting. Operator sees 8 "[!] failed" lines with no diagnostic. Fix: write stderr to a log file or capture into a variable.

  6. hermes/setup-crons.sh:3090 vs hermes/cron-templates/alive-mine/SKILL.md:1 — skill name mismatch. Cron registers --skill alive-mine-cron, but the folder is alive-mine/ and the SKILL.md frontmatter declares name: alive-mine-cron. Whether this works depends on Hermes' resolver — if it uses folder name, this crons to a non-existent skill. Fix: pick one name, apply consistently.

Minor (not blockers): walnut-name match uses substring instead of word boundary (daily matches "write a daily summary"); on_memory_write stashes every write unconditionally as insight_candidate (over-capture); hand-rolled YAML parser won't handle block scalars or lists; YAML writes are non-atomic (no tmp-rename); no tests for 838 lines of provider code. I would NOT block merge on adding tests given the isolation — ship the provider, get real Hermes users, add tests as the API stabilises.

Merge order: Middle (position 3-4). Fully isolated, can technically merge at any position, but size (27 files, +2961 LOC) deserves fresh reviewer attention — not late when fatigued by conflict resolution. Zero inter-PR conflicts with #28, #29, #31, #32, #34, #35.

Full cross-PR synthesis (conflict matrix, recommended merge order for all 7 open PRs, per-PR verdicts, blocker list): see the cover comment on #29#29 (comment)

Generated via flow-next epic fn-8-vly (stackwalnuts walnut). 🐿️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants