Skip to content

feat(sessions): export sessions to Markdown/QMD - #59542

Closed
web3blind wants to merge 1 commit into
NousResearch:mainfrom
web3blind:feat/session-md-export
Closed

feat(sessions): export sessions to Markdown/QMD#59542
web3blind wants to merge 1 commit into
NousResearch:mainfrom
web3blind:feat/session-md-export

Conversation

@web3blind

Copy link
Copy Markdown
Contributor

Summary

  • add hermes sessions export-md for Markdown/QMD session exports
  • support filtered bulk export, dry-run previews, logical compression-lineage export, and manifest JSONL with SHA-256 metadata
  • add guarded single-session --delete-after-verified --yes flow that verifies the export before deletion
  • document the new workflow and add regression coverage for formatter, CLI, and session-store helpers

Verification

  • python3 -m py_compile hermes_cli/session_export_md.py hermes_cli/main.py hermes_state.py
  • scripts/run_tests.sh tests/hermes_state/test_session_md_export.py tests/hermes_cli/test_session_export_md.py tests/hermes_cli/test_sessions_export_md_cli.py tests/hermes_cli/test_sessions_delete.py tests/test_hermes_state.py — 349 passed, 0 failed
  • git diff --check
  • smoke-tested read-only logical export against a local session; smoke-tested delete-after-verified only against a temporary HERMES_HOME/state.db

@web3blind

web3blind commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Context / rationale:

This PR adds a readable Markdown/QMD export path for Hermes sessions as a safer alternative to going straight from SQLite retention pressure to destructive pruning.

Why this matters:

  • Session history is long-term user memory, not just disposable logs.
  • The existing JSONL export is good for machines, but awkward for humans, Obsidian, grep/rg, and RAG-style recall.
  • archive is intentionally a SQLite soft-archive, not a portable external backup.
  • A verified file export gives users a safer workflow: materialize sessions first, inspect/search them outside SQLite, then only delete a specifically named session when the export verifies.

Safety choices in this PR:

  • Bulk Markdown/QMD export is read-only and requires an explicit filter such as --older-than or --source.
  • --dry-run previews candidates without writing files.
  • --lineage logical keeps compression chains together as one logical document.
  • Each export writes/updates manifest.jsonl with path, message count, lineage ids, and SHA-256.
  • --delete-after-verified is intentionally limited to one --session-id and requires --yes; it verifies the written file before deleting.

This keeps the dangerous operation narrow while making the safe archival path easy.

@alt-glitch alt-glitch added type/feature New feature or request comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jul 6, 2026
teknium1 added a commit that referenced this pull request Jul 7, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR #59542 by @web3blind.
teknium1 added a commit that referenced this pull request Jul 7, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR #59542 by @web3blind.
@teknium1

teknium1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #60186 (#60186) — thanks @web3blind!

Your commit was cherry-picked onto current main with your authorship preserved in git log. During salvage we restructured the surface per our conventions: instead of a separate export-md subcommand, your Markdown/QMD exporter now lives on the existing export subcommand as --format md|qmd, and we broadened it with the shared prune/archive filter set and an opt-in --redact pass. All your core work — the formatter, SHA-256 verification, compression-lineage export, manifest, and the guarded delete-after-verified flow — landed intact.

@teknium1 teknium1 closed this Jul 7, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR NousResearch#59542 by @web3blind.
justemu pushed a commit to justemu/hermes-agent that referenced this pull request Jul 18, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR NousResearch#59542 by @web3blind.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR NousResearch#59542 by @web3blind.
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR NousResearch#59542 by @web3blind.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…format'

Replaces the parallel export-md subcommand from the salvaged commit with
a --format jsonl|md|qmd flag on the existing export subcommand, so all
session export formats share one surface. Adds AUTHOR_MAP entry.

Salvage follow-up for PR NousResearch#59542 by @web3blind.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants