Skip to content

feat: persistent memory via symlinks (Option A) + self-check validation - #2

Merged
intricko merged 4 commits into
mainfrom
feature/persistent-memory
Aug 3, 2026
Merged

intricko merged 4 commits into
mainfrom
feature/persistent-memory

Conversation

@intricko

@intricko intricko commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Version Hermes MEMORY.md / USER.md via the whole-folder symlink pattern (same as skills), per the validated Option A split.

Changes

File Change
.devcontainer/post-create-cmd.sh Authoritative symlink creation: ~/.hermes/memories.devcontainer/memories (runs once on fresh container, before Hermes instantiates the runtime dir)
.devcontainer/start-hermes.sh Slim repair guard (~12 lines) for pre-existing containers where postCreateCommand doesn't re-run
.devcontainer/self-check.sh New Persistence section (9a + 9b) validating both symlinks: memories + skills, 3-case logic (correct / real-dir / missing)
.github/workflows/devcontainer-ci.yml memories/** + skills/**runtime path group (30s lint-check, not 15min full-build); lint-check gains "Validate symlink persistence" step
.devcontainer/memories/ New tracked store: MEMORY.md, USER.md, .gitignore (*.lock, *.log)
.devcontainer/wiki/persistent-memory-proposal.md Reference doc (synced with skill)
.devcontainer/skills/codespace-persistent-symlinks/ Procedural skill (synced with wiki)
.devcontainer/mnemon/seed.json 5 new entries: Option A decision, self-check, CI wiring, wiki, skill

Design decisions

  • Option A: post-create is authoritative; start-hermes keeps only a repair guard (user-approved, spare single-responsibility design)
  • Content changes stay fast: memories/skills are runtime → lint-check only; boot scripts remain infrastructure → full-build
  • Symlink checks run in both places: self-check (smoke test, infra changes) + lint-check step (content changes)
  • 9c tracked-content check removed as redundant with git checkout

Verification

  • 20/20 ad-hoc checks pass (CI wiring, self-check syntax + live run, lint gates, seed validation)
  • Live self-check Persistence section: both symlinks correct
  • seed.json valid (24 insights, schema_version=1)

Notes

  • USER.md contains user preferences (private-ish) — tracked by design, per user decision
  • Lock/log files excluded via .gitignore

- post-create-cmd.sh: authoritative creation of ~/.hermes/memories -> .devcontainer/memories (whole-folder symlink, skills pattern), runs before Hermes instantiates the runtime dir
- start-hermes.sh: slim repair guard for pre-existing containers (postCreateCommand doesn't re-run)
- self-check.sh: Persistence section validates both symlinks (memories + skills), 3-case logic, 9c content check removed as redundant with git checkout
- devcontainer-ci.yml: memories/skills in runtime path group (30s lint-check, not 15min full-build); lint-check gains 'Validate symlink persistence' step
- .devcontainer/memories/: MEMORY.md, USER.md, .gitignore (*.lock, *.log) — git-tracked persistence store
- wiki: persistent-memory-proposal.md (reference) + INDEX entry
- skill: codespace-persistent-symlinks (procedural) + seed.json entries for Option A, self-check, CI wiring, wiki, skill
@intricko
intricko merged commit 9dd491f into main Aug 3, 2026
3 checks passed
@intricko
intricko deleted the feature/persistent-memory branch August 3, 2026 07:29
intricko added a commit that referenced this pull request Aug 18, 2026
…o#24)

* Add codespace keepalive to prevent idle shutdown (#1)

* Add codespace keepalive to prevent idle shutdown

Two-layer keepalive so headless services (gateway, ollama) aren't reaped
by the Codespaces idle timeout:

- keepalive.sh: (A) periodic terminal heartbeat on the session tty to
  mimic client activity (GitHub platform idle signal); (B) pinger to the
  VS Code server internal /delay-shutdown endpoint to reset the 5-min
  server-side shutdown timer. Zero-auth endpoint, verified HTTP 200.
- start-hermes.sh: start keepalive idempotently (pgrep-guarded) on every
  codespace start/rebuild, using existing SCRIPT_DIR var.
- wiki/keepalive-proposal.md: design, layers, success criteria, risks.
- wiki/codespace-lifecycle.md: reference on Codespaces idle detection.
  (Folds in the removed orphan skill's content.)
- wiki/INDEX.md + mnemon/seed.json updated (keepalive, importance=5).

Shell syntax, seed.json validation, and keepalive --test pass locally.

* chore: add trailing newlines to keepalive and wiki files (markdownlint MD047)

* feat: add non-blocking CI watch pattern to skill and playbook

Add a new section to the github-codespace skill documenting the
background + notify_on_complete pattern for watching long CI builds
without blocking the agent turn or burning a sleep-polling loop.

Cross-reference this in the codespace-playbook wiki (Step 3: Monitor)
as a third option alongside polling and streaming approaches, so both
the skill (procedural) and wiki (reference) stay in sync.

Skill change: .devcontainer/skills/github-codespace/SKILL.md
  - "Non-blocking watch from an agent turn" subsection under CI Monitoring

Wiki change: .devcontainer/wiki/codespace-playbook.md
  - "Agent session approach" bullet in Step 3: Monitor (Poll or Stream)
  - links to the skill for full rationale and code

No functional code changes; documentation/skill only.

* fix: discover keepalive heartbeat tty at runtime, drop hardcoded PID

Replace the hardcoded hermes PID (17522) with runtime pgrep discovery that
resolves the interactive hermes process attached to a tty, skipping the
headless gateway/dashboard/supervised processes. Keeps keepalive portable
across rebuilds and CI (where that PID won't exist).

* fix: make keepalive --test robust to cwd; clean output

- Resolve SCRIPT_DIR/SELF from the script's own location so --test passes
  when invoked from the repo root or CI, not just from .devcontainer/.
- Fix handed-off \n Note echo that printed a literal backslash-n.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* feat: persistent memory via symlinks (Option A) + self-check validation (#2)

* feat: persistent memory via symlinks (Option A) + self-check validation

- post-create-cmd.sh: authoritative creation of ~/.hermes/memories -> .devcontainer/memories (whole-folder symlink, skills pattern), runs before Hermes instantiates the runtime dir
- start-hermes.sh: slim repair guard for pre-existing containers (postCreateCommand doesn't re-run)
- self-check.sh: Persistence section validates both symlinks (memories + skills), 3-case logic, 9c content check removed as redundant with git checkout
- devcontainer-ci.yml: memories/skills in runtime path group (30s lint-check, not 15min full-build); lint-check gains 'Validate symlink persistence' step
- .devcontainer/memories/: MEMORY.md, USER.md, .gitignore (*.lock, *.log) — git-tracked persistence store
- wiki: persistent-memory-proposal.md (reference) + INDEX entry
- skill: codespace-persistent-symlinks (procedural) + seed.json entries for Option A, self-check, CI wiring, wiki, skill

* fix: remove trailing spaces in persistent-memory-proposal.md (MD009)

* fix: symlink persistence check must be static (bare runner has no devcontainer symlinks)

* chore: sync MEMORY.md with runtime rules (CI path-filter convention, gh pr create ref-lag workaround)

---------

Co-authored-by: gitricko <gitricko@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

1 participant