OpenClaw to Hermes Migration (6/13) — 5-Week Plan: Feature Categorization and Profile Consolidation
A structured breakdown of schedule design, feature categorization, and profile consolidation techniques for incrementally migrating an accumulated agent platform.
What This Post Covers
- Classification criteria for normalizing a multi-file agent system into functional categories (A–K)
- 5-week schedule design: schema → data migration → adapters → asset porting → dual execution + cutover
- Profile consolidation approach: selection principles for reducing fragmented workspaces
- Daemon-to-library transition: rationale and trade-offs in a single-user system
Approach: Debt Cleanup, Not Code Port
Moving an accumulated agent system to a new runtime is not the hard part — a straight copy takes one or two days. The schedule expands when data migration, validation, and dual execution are included. The real cost of migration accumulates in data integrity and the verification window, not in the code itself.
This post defines how to divide that window and measure it.
Feature Categorization for Migration (A–K)
Viewed at the file level, the migration target is large. Viewed at the functional level, it compresses to a single-digit set of categories. The purpose of normalizing before scheduling is straightforward: schedules move by category, and categories become the unit of validation.
| Category | Core | |
|---|---|---|
| A | Memory System | 4-tier, Retain tags, U-tag dialectic, Reflect, micro-cycle, Topic-Cued Recall, semantic search |
| B | Heartbeat | Multi-tier escalation reasons + quota checks |
| C | Self-Review | Multi-stage pipeline + Skill Evolution Loop |
| D | Daily Audit | Phases A–E (guide/update detection, diagnosis, aggregation, final review) |
| E | Researcher Deep Mode | Multi-round AutoSearch + multi-step web access |
| F | Channel Routing | Discord primary channel + Telegram Forum Topic branching |
| G | Profile Mapping | Workspace → profile consolidation |
| H | Hooks | PostToolUse, PreToolUse, SessionStart/End/Compact |
| I | Security Model | Loopback, token, dmPolicy, single-user scope |
| J | Auto-Update | com.hermes.update-check (new) |
| K | Deprecation Targets | heartbeat-tick.py, etc. |
Cost Distribution
Category A (Memory System) accounts for more than half of total migration effort. The constraint is that the 4-tier structure and U-tag dialectic must be migrated losslessly while replacing the storage backend with SQLite. The 4-tier structure cannot be restored from a simple key-value dump, and dialectic tags require time-ordering and reference relationships to preserve semantic meaning.
Category K is excluded from scheduling. Explicitly inventorying assets to be discarded automatically narrows the migration scope.
5-Week Schedule
| Week | Work | Deliverables |
|---|---|---|
| 1 | memcore SQLite schema + library skeleton | Schema DDL, empty library shell |
| 2 | bank/ → memcore migration (rsync + migration scripts) | Converted SQLite DB, validation report |
| 3 | Hermes install + minimal profile + MemoryProvider adapter | Readable minimal runtime |
| 4 | Asset porting + Hermes profile configuration | Fully functional runtime |
| 5 | Dual execution + validation + cutover | Equivalence verification logs, cutover decision |
Design Principle: Build Read Before Write
Weeks 1–3 focus on migrating data and making it readable. Week 4 handles logic porting. Week 5 handles equivalence comparison and cutover. Completing reads before writes surfaces migration errors early. Going in reverse order causes migration failures to accumulate until execution time, increasing rollback cost.
Dual Execution Is the Primary Safety Mechanism
Week 5's dual execution phase runs both systems simultaneously and compares output. The sequence: run the same memory micro-cycle on both sides → compare output → if equivalent, cut over; if divergent, analyze the diff. The critical point is that no switch is flipped in a single step.
This structure is a variant of the Strangler Fig pattern. The legacy system remains live while the replacement runs the same functionality in parallel. The switch is thrown only after verification evidence accumulates. Neither side is decommissioned before that threshold is reached.
Profile Consolidation
A fragmented workspace structure is the result of accumulation, not optimal design. The consolidation criterion is: do active skill categories overlap? Overlapping profiles merge; independent ones remain separate.
| Profile | Absorbed From | Active Skill Categories |
|---|---|---|
| mir-coordinator | mir + planner | Routing, conversation, PRD |
| research | researcher | Web research, AutoSearch Deep |
| writer | communicator | Writing, editing |
| coder | orchestrator | Coding, CLI, sub-agent factory |
| google-workspace | Gmail, Calendar, Drive | |
| memory-ops | memory-runner + memory-manager + reviewer | Bank I/O, Reflect, monthly review |
What Moves Out of Profile Scope
monitor and telegram-ops are demoted from profile level to cron/hook level. Simple routing operations do not warrant a dedicated profile. The decision criterion: does the component carry state? Stateless routing is satisfied by a hook alone.
Measuring the Reduction
Reducing profile count decreases the number of switching decisions not linearly but in pair-wise proportion. The cognitive load reduction does not occur when the count is roughly halved — it occurs when each profile's role is defined as mutually exclusive.
Daemon-to-Library Transition
The most structurally significant decision in this migration is implementing the memory layer as a library, not a daemon. The legacy system ran multiple background processes — oMLX server, gateway daemon, and others. The new system handles memory exclusively through SQLite + a Python library (memcore).
Hidden Costs of a Daemon
In a single-user system, a daemon imposes the following requirements:
- Process death detection — a mechanism to notice when the process has died
- Restart policy — choosing among launchd, systemd, or supervisor
- Health checks — endpoint design + periodic invocation
- Log rotation — preventing disk saturation
- Concurrency control — required when multiple clients are assumed
A library requires only import. In a single-user environment, concurrency problems do not arise. SQLite's WAL mode satisfies single-writer + multi-reader access requirements.
Transition Scope
oMLX is retained — embedding serving is not easily replaced by a library. The gateway and memory daemons are fully absorbed into the library layer. As a result, a significant number of LaunchAgents are scheduled for removal.
Limitations and Open Questions
This plan applies to single-user systems. In a multi-user environment, the daemon-to-library transition does not hold — concurrency and resource isolation become required. Profile consolidation is similarly valid only when roles can be defined as mutually exclusive.
Open questions:
- During dual execution, what magnitude of output divergence qualifies as "equivalent"? Byte-level comparison is infeasible when LLM sampling introduces nondeterminism. A semantic equivalence criterion is needed.
- Category A's dialectic tags require preserving a reference graph. Whether to model this as a table structure in SQLite or as a JSON column remains an open decision.
- Can profile count be reduced further? Usage patterns may support merging mir-coordinator and writer.
Where This Applies
The schedule design and categorization method in this post are reusable in the following scenarios:
- Migrating an accumulated agent system to a different runtime
- Migrations that involve schema replacement alongside logic porting
- Cases where workspace or profile count has fragmented beyond actual need
- Determining when a daemon-based architecture can be absorbed into a library
The core principle: include the verification window explicitly in the schedule. When only code porting is scheduled, verification becomes "something to do when done" — and done never arrives.
Series overview: Series index
๋๊ธ
๋๊ธ ์ฐ๊ธฐ