openhermes 4.9.2 β†’ 4.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CONTEXT.md +7 -7
  2. package/ETHOS.md +2 -2
  3. package/README.md +34 -33
  4. package/bootstrap.ts +310 -160
  5. package/harness/agents/oh-planner.md +1 -1
  6. package/harness/agents/openhermes.md +27 -126
  7. package/harness/codex/AUTOPILOT.md +131 -23
  8. package/harness/codex/CHARTER.md +4 -5
  9. package/harness/lib/background/background.test.ts +216 -0
  10. package/harness/lib/background/index.ts +7 -0
  11. package/harness/lib/background/interfaces.ts +31 -0
  12. package/harness/lib/background/manager.ts +320 -0
  13. package/harness/lib/composer/compose.test.ts +179 -0
  14. package/harness/lib/composer/compose.ts +65 -0
  15. package/harness/lib/composer/fragments/01-identity.md +1 -0
  16. package/harness/lib/composer/fragments/02-delegation.md +7 -0
  17. package/harness/lib/composer/fragments/03-permissions.md +13 -0
  18. package/harness/lib/composer/fragments/04-task-flow.md +55 -0
  19. package/harness/lib/composer/fragments/05-confidence.md +5 -0
  20. package/harness/lib/composer/fragments/06-parallelization.md +17 -0
  21. package/harness/lib/composer/fragments/07-shell.md +41 -0
  22. package/harness/lib/composer/fragments/08-routing.md +8 -0
  23. package/harness/lib/composer/fragments/09-guardrails.md +25 -0
  24. package/harness/lib/composer/index.ts +1 -0
  25. package/harness/lib/guards/guard-config.ts +72 -0
  26. package/harness/lib/hooks/builtins/confidence-gate-hook.ts +68 -0
  27. package/harness/lib/hooks/builtins/delegation-depth-hook.ts +78 -0
  28. package/harness/lib/hooks/builtins/dynamic-route-hook.ts +99 -0
  29. package/harness/lib/hooks/builtins/error-recovery-hook.ts +107 -0
  30. package/harness/lib/hooks/builtins/memory-sync-hook.ts +73 -0
  31. package/harness/lib/hooks/builtins/next-route-hook.ts +24 -0
  32. package/harness/lib/hooks/builtins/plan-check-hook.ts +43 -0
  33. package/harness/lib/hooks/builtins/route-tracking-hook.ts +201 -0
  34. package/harness/lib/hooks/builtins/sanity-check-hook.ts +52 -0
  35. package/harness/lib/hooks/builtins/shell-detect-hook.ts +96 -0
  36. package/harness/lib/hooks/builtins/subagent-failure-hook.ts +93 -0
  37. package/harness/lib/hooks/hooks.test.ts +1092 -0
  38. package/harness/lib/hooks/index.ts +42 -0
  39. package/harness/lib/hooks/registry.ts +416 -0
  40. package/harness/lib/hooks/types.ts +119 -0
  41. package/harness/lib/memory/index.ts +18 -0
  42. package/harness/lib/memory/interfaces.ts +53 -0
  43. package/harness/lib/memory/memory-manager.ts +205 -0
  44. package/harness/lib/memory/memory.test.ts +485 -0
  45. package/harness/lib/memory/plan-store.ts +346 -0
  46. package/harness/lib/plans/plan-location.ts +134 -0
  47. package/harness/lib/recovery/handler.ts +243 -0
  48. package/harness/lib/recovery/index.ts +14 -0
  49. package/harness/lib/recovery/interfaces.ts +48 -0
  50. package/harness/lib/recovery/patterns.ts +149 -0
  51. package/harness/lib/recovery/recovery.test.ts +312 -0
  52. package/harness/lib/routing/index.ts +21 -0
  53. package/harness/lib/routing/route-guidance.ts +147 -0
  54. package/harness/lib/routing/route-resolver.ts +58 -0
  55. package/harness/lib/routing/routing.test.ts +195 -0
  56. package/harness/lib/routing/skill-frontmatter.ts +125 -0
  57. package/harness/lib/routing/types.ts +52 -0
  58. package/harness/lib/sanity/anomaly-tracker.ts +127 -0
  59. package/harness/lib/sanity/checker.ts +189 -0
  60. package/harness/lib/sanity/index.ts +13 -0
  61. package/harness/lib/sanity/interfaces.ts +24 -0
  62. package/harness/lib/sanity/sanity.test.ts +472 -0
  63. package/harness/lib/sync/file-watcher.ts +175 -0
  64. package/harness/lib/sync/index.ts +11 -0
  65. package/harness/lib/sync/interfaces.ts +27 -0
  66. package/harness/lib/sync/plan-sync.ts +533 -0
  67. package/harness/lib/sync/sync.test.ts +858 -0
  68. package/harness/skills/oh-fusion/DEEP.md +109 -86
  69. package/harness/skills/oh-fusion/SKILL.md +47 -33
  70. package/harness/skills/oh-init/DEEP.md +2 -2
  71. package/harness/skills/oh-manifest/SKILL.md +2 -1
  72. package/harness/skills/oh-plan-review/DEEP.md +1 -1
  73. package/harness/skills/oh-planner/DEEP.md +3 -3
  74. package/harness/skills/oh-review/DEEP.md +5 -3
  75. package/harness/skills/oh-review/SKILL.md +1 -0
  76. package/harness/skills/oh-ship/SKILL.md +1 -1
  77. package/harness/skills/oh-skill-craft/SKILL.md +1 -4
  78. package/package.json +53 -55
  79. package/tsconfig.json +1 -1
  80. package/harness/commands/oh-doctor.md +0 -205
  81. package/harness/commands/oh-log.md +0 -18
  82. package/harness/skills/oh-learn/DEEP.md +0 -44
  83. package/harness/skills/oh-learn/SKILL.md +0 -30
  84. package/scripts/count-tokens.mjs +0 -158
  85. package/scripts/oh-doctor.ps1 +0 -342
package/CONTEXT.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # OpenHermes β€” Shared Language
2
2
 
3
3
  ## Terms
4
- **OpenHermes** β€” OpenCode-native orchestration layer for this package.
5
- **Skill** β€” A `SKILL.md` loaded on demand through OpenCode's skill tool.
6
- **Command** β€” A slash command backed by package-local markdown in `harness/commands/`.
7
- **Agent** β€” A primary or subagent definition loaded through OpenCode config.
8
- **Instruction** β€” Markdown loaded through `AGENTS.md` or `opencode.json` instructions.
9
- **Bootstrap** β€” The first-message context injected by the OpenHermes plugin.
4
+ **OpenHermes** β€” OpenCode-native orchestration layer for this package.
5
+ **Skill** β€” A `SKILL.md` loaded on demand through OpenCode's skill tool.
6
+ **Command** β€” A slash command backed by package-local command markdown; legacy compatibility loaders remain only where runtime-backed.
7
+ **Agent** β€” A primary or subagent definition loaded through OpenCode config.
8
+ **Instruction** β€” Markdown loaded through `AGENTS.md` or `opencode.json` instructions.
9
+ **Bootstrap** β€” The first-message context injected by the OpenHermes plugin.
10
10
 
11
11
  ### Confidence Gate Terms
12
12
  **Confidence Gate** β€” Phase 0.5 protocol in the autopilot loop that evaluates signal strength before routing. Bounded to 1 conversational exchange max.
@@ -24,4 +24,4 @@
24
24
  - OpenHermes is the default primary Agent.
25
25
 
26
26
  ## Flagged Ambiguities
27
- - Durable state is deferred for now and not a domain term for this pass.
27
+ - Durable state resolved β€” 4-Tier Memory subsystem (System/Project/Mission/Task) now provides structured persistence with importance-driven retention.
package/ETHOS.md CHANGED
@@ -8,8 +8,8 @@ OpenCode-native loading over manual copying or hidden state.
8
8
  ## Small Surface
9
9
  Every file earns its keep. Prefer markdown when behavior is declarative.
10
10
 
11
- ## Skills Over Glue
12
- Behavior lives in `SKILL.md`, `commands/*.md`, and `agents/*.md`.
11
+ ## Skills Over Glue
12
+ Behavior lives in `SKILL.md`, command markdown, and agent markdown. Legacy command-doc compatibility loaders remain supported only where runtime-backed.
13
13
 
14
14
  ## Always Delegate β€” Never Execute
15
15
  OpenHermes orchestrates and reports. Sub-agents execute. OpenHermes never writes code, runs tests, or touches files directly.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- <a href="https://www.npmjs.com/package/openhermes"><img src="https://img.shields.io/npm/v/openhermes?style=for-the-badge&label=version&color=FFD700" alt="npm version"></a>
8
+ <a href="https://www.npmjs.com/package/openhermes"><img src="https://img.shields.io/npm/v/openhermes?style=for-the-badge&label=version&color=FFD700" alt="v4.11.3"></a>
9
9
  <a href="https://github.com/nathwn12/openhermes/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="License: MIT"></a>
10
10
  <a href="https://opencode.ai"><img src="https://img.shields.io/badge/runs%20on-OpenCode-6366f1?style=for-the-badge" alt="Runs on OpenCode"></a>
11
11
  <a href="https://github.com/nathwn12/openhermes"><img src="https://img.shields.io/badge/⭐%20star%20on-GitHub-181717?style=for-the-badge" alt="Star on GitHub"></a>
@@ -31,27 +31,20 @@ To install from `dev` (latest features, may be unstable):
31
31
 
32
32
  ---
33
33
 
34
- ## One sentence. Nine steps.
34
+ ## One sentence. One engine.
35
35
 
36
- Add the plugin. Restart. Type:
36
+ OpenHermes v4.11 ships with a hardened internal architecture β€” 8 subsystems working together to make every session faster, more reliable, and fully autonomous:
37
37
 
38
- > *"Plan a CLI tool for managing dotfiles."*
39
-
40
- You see output. Behind the scenes, this runs:
41
-
42
- | # | What fires | What it does |
43
- |---|---|---|
44
- | **1** | `AUTOPILOT.md` decision matrix | Multi-step, vague β†’ `PLANNING NEEDED` |
45
- | **2** | `oh-planner` | Brainstorm mode: architecture, user flow, risks |
46
- | **3** | `oh-planner` β†’ `oh-grill` | Plan passes β†’ stress-test it |
47
- | **4** | `oh-grill` β†’ `oh-planner` (revise) | Gaps found β†’ planner revises |
48
- | **5** | `oh-planner` β†’ `oh-manifest` | Plan solid β†’ enter build loop |
49
- | **6** | `oh-planner` β†’ `oh-builder` β†’ `oh-gauntlet` | Implement β†’ test β†’ review β†’ loop |
50
- | **7** | `oh-gauntlet` β†’ `oh-ship` | Tests pass β†’ PR pipeline |
51
- | **8** | `oh-ship` β†’ `oh-retro` | Shipped β†’ retrospective |
52
- | **9** | `oh-retro` β†’ `oh-planner` | Ready for the next cycle |
53
-
54
- One sentence. Nine automated steps. Each skill loaded on demand, executed in isolation, routed to the next specialist. **Auto-classify, delegate, route, repeat.** That's the entire model.
38
+ | Subsystem | What it does |
39
+ |-----------|-------------|
40
+ | **Prompt Composer** | 9 modular fragments joined at runtime β†’ byte-identical. Add a fragment, never edit the composition code. |
41
+ | **Auto-Recovery** | 9 error categories with typed actions β€” retry with backoff, compact on overflow, escalate on unknowns. Self-healing. |
42
+ | **4-Tier Memory** | System β†’ Project β†’ Mission β†’ Task. Importance-scored, budget-enforced, plan-file-persisted. Context that survives hops. |
43
+ | **Hook Registry** | Pluggable pre-tool, post-tool, route, and session hooks with topological sort. 8 built-in hooks, zero routing boilerplate. |
44
+ | **MVCC Sync** | Atomic writes, version counters, conflict detection. Multiple sub-agents writing the same plan file β€” no data loss. |
45
+ | **Sanity Checker** | 8 output degeneration detectors β€” repetition, gibberish, low diversity β€” with automatic escalation and recovery injection. |
46
+ | **Background Cmd** | Fire-and-forget process spawning with timeout, status polling, and auto-cleanup. Non-blocking long-running tasks. |
47
+ | **Plan Location** | Resolves plan file paths per project with directory-per-project layout in `~/.local/share/openhermes/plans/`. |
55
48
 
56
49
  ---
57
50
 
@@ -78,15 +71,15 @@ The loop runs unsupervised because these never turn off:
78
71
  | Capability | Why it matters |
79
72
  |---|---|
80
73
  | **Self-driving loop** | Type once. OpenHermes classifies, delegates, and routes β€” no pauses, no asking permission, no verbosity. |
81
- | **31 specialist skills** | Planning β†’ building β†’ testing β†’ browser β†’ security β†’ review β†’ shipping β†’ retro. Every dev cycle phase. |
82
- | **Auto-detected user skills** | Drop a skill in `~/.agents/skills/`. OpenHermes finds it. Same name as a built-in? Your version wins. Survives `npm update`. |
83
- | **`/oh-doctor`** | Verify plugin load, skill discovery, command registration, config safety. |
84
- | **`/oh-log`** | Session log β€” routing hops, skill loads, compaction events. |
74
+ | **30 specialist skills** | Planning β†’ building β†’ testing β†’ browser β†’ security β†’ review β†’ shipping β†’ retro. Every dev cycle phase. |
75
+ | **Auto-detected user skills** | Drop a skill in `~/.agents/skills/` or `~/.config/opencode/skills/`. OpenHermes finds it. Same name as a built-in? Your version wins. Survives `npm update`. |
85
76
  | **Shared operating model** | CHARTER + AUTOPILOT + CONTEXT + ETHOS injected every session. Every interaction grounded in the same rules. |
86
77
  | **CORE/DEEP skill format** | Every skill is a two-file system: CORE (SKILL.md) handles 80% of passes in one read. DEEP.md loads on demand for hard cases. |
87
- | **Plan file storage** | `~/.local/share/opencode/openhermes/plans/`. Survives `npm update`. |
78
+ | **Plan file storage** | `~/.local/share/openhermes/plans/`. Survives `npm update`. |
79
+ | **8 internal subsystems** | Composer, recovery, memory, sync, hooks, plans, sanity, background β€” all native Node.js / TypeScript. |
80
+ | **Zero npm dependency additions** | All new subsystems use native Node.js and TypeScript only. No new packages. |
88
81
 
89
- ## 31 skills β€” three tiers
82
+ ## 30 skills β€” four tiers
90
83
 
91
84
  ### Tier 4 β€” Pipeline orchestrators
92
85
  Full multi-phase workflows:
@@ -132,7 +125,6 @@ Single-purpose, one thing well:
132
125
  | **oh-issue** | Break a plan/spec/PRD into independently-grabbable issues |
133
126
  | **oh-prd** | Conversation β†’ PRD β†’ GitHub issue |
134
127
  | **oh-freeze** | Restrict file edits to a specific directory |
135
- | **oh-learn** | Extract, evolve, promote session learnings as instincts |
136
128
  | **oh-guard** | Safety confirmation β€” warn before destructive operations |
137
129
  | **oh-skills-link** | Verify OpenCode discovers the skill directory |
138
130
  | **oh-skills-list** | List all available `oh-*` skills |
@@ -148,17 +140,26 @@ openhermes-pkg/
148
140
  β”œβ”€β”€ ETHOS.md # Operating principles
149
141
  β”œβ”€β”€ bootstrap.ts # Plugin entry β€” registers everything
150
142
  β”œβ”€β”€ index.ts # Package entrypoint
151
- β”œβ”€β”€ lib/ # harness-resolver.ts
152
143
  β”œβ”€β”€ harness/
153
144
  β”‚ β”œβ”€β”€ agents/ # Agent manifests (OpenHermes primary)
154
145
  β”‚ β”œβ”€β”€ codex/ # CHARTER, AUTOPILOT
155
- β”‚ β”œβ”€β”€ commands/ # Slash commands (/oh-doctor, /oh-log)
156
- β”‚ β”œβ”€β”€ instructions/ # SHELL.md
157
- β”‚ └── skills/ # 31 skill SKILL.md files (CORE/DEEP format)
146
+ β”‚ β”œβ”€β”€ instructions/ # SHELL.md
147
+ β”‚ β”œβ”€β”€ lib/ # Internal subsystems
148
+ β”‚ β”‚ β”œβ”€β”€ composer/ # Prompt fragment composition
149
+ β”‚ β”‚ β”œβ”€β”€ recovery/ # Auto-recovery with error patterns
150
+ β”‚ β”‚ β”œβ”€β”€ memory/ # 4-tier hierarchical memory
151
+ β”‚ β”‚ β”œβ”€β”€ sync/ # MVCC plan synchronization
152
+ β”‚ β”‚ β”œβ”€β”€ hooks/ # Pluggable hook registry
153
+ β”‚ β”‚ β”œβ”€β”€ plans/ # Plan file path resolution
154
+ β”‚ β”‚ β”œβ”€β”€ sanity/ # Output degeneration detection
155
+ β”‚ β”‚ └── background/ # Fire-and-forget command system
156
+ β”‚ └── skills/ # 30 skill SKILL.md files (CORE/DEEP format)
157
+ β”œβ”€β”€ lib/ # harness-resolver.ts
158
158
  └── test/
159
+ └── harness/ # Test utilities (fixture, builders, mocks)
159
160
  ```
160
161
 
161
- Plan files: `~/.local/share/opencode/openhermes/plans/<project>-plan-<nnn>.md`
162
+ Plan files: `~/.local/share/openhermes/plans/<project>/plan-<nnn>.md`
162
163
 
163
164
  ---
164
165
 
@@ -166,7 +167,7 @@ Plan files: `~/.local/share/opencode/openhermes/plans/<project>-plan-<nnn>.md`
166
167
 
167
168
  1. Add the plugin line to `opencode.json`
168
169
  2. Restart or reload OpenCode
169
- 3. Run `/oh-doctor` to verify everything loaded
170
+ 3. Verify the plugin loaded in the startup log
170
171
  4. Type *any* prompt β€” "plan a feature", "investigate this bug", "refactor this module"
171
172
 
172
173
  The first time you see OpenHermes auto-route to a specialist skill without you asking β€” you'll feel the loop.