Skill: sakenw/memory-governor (version 0.2.9)

--- name: memory-governor description: Memory governance kernel for AI agents that complements OpenClaw Dreaming with explicit correction staging, target-class routing, adapter boundaries, and safer manual hardening rules. --- # Memory Governor Reusable memory-governance core for different host environments. The OpenClaw integration in this repository is only a reference host profile, not the only host model. It is not a second-brain system, sync bus, or knowledge manager. It governs what should be remembered, where it should go, when it should be promoted, and what should be excluded. It is a governance kernel, not an execution-first productivity skill. Its value is highest when a host already has multiple memory layers, multiple memory-writing skills, or adapter drift. ## When to Use Use this skill when: - you need to decide whether something should enter memory - you need to choose the right memory layer or target class - you need to promote daily, correction, or working state into durable rules - multiple skills are starting to define memory differently and need governance ## First Reading Path If this is your first time opening `memory-governor`, start here: 1. `SKILL.md` 2. `references/memory-routing.md` 3. `references/promotion-rules.md` 4. `references/exclusions.md` 5. `references/adapters.md` The remaining reference files are optional on first read. ## What Counts as Memory Only information that improves future judgment, recovery, execution quality, or coordination consistency counts as memory. Typical examples: - stable long-term preferences - stable long-term facts - key same-day events - explicit corrections - unproven but promising candidate lessons - reusable lessons - current progress state - short-term recovery hints For content that should stay out of memory, see [references/exclusions.md](references/exclusions.md). ## Core Rule The thing being standardized is the **memory contract**, not every skill implementation. That means: - all skills should follow the same classification, routing, promotion, and exclusion rules - each skill may keep its own internal logic, downstream tools, interaction style, and directory habits In short: **standardize the core, not everything else** ## Target Classes The kernel defines abstract target classes before it defines any optional skill path. Recommended standard target classes: - `long_term_memory` - `daily_memory` - `learning_candidates` - `reusable_lessons` - `proactive_state` - `working_buffer` - `project_facts` - `system_rules` - `tool_rules` Concrete file paths are adapter details, not the contract itself. Notes: - `learning_candidates` is a low-commitment staging layer for corrections and emerging lessons - it exists to prevent single observations from hardening too early - `proactive_state` and `working_buffer` are stateful targets - they should not become infinite append-only logs - they need freshness, replace or merge, and retention rules by default ## Routing Order When evaluating a candidate memory, reason in this order: 1. Is it worth remembering at all? 2. What memory type is it? 3. Which target class does that type belong to? 4. Which adapter in the current host should store that target class? 5. Is it still short-term, or is it ready for promotion? 6. Does it match any exclusion rule? See [references/memory-routing.md](references/memory-routing.md) for the routing table. See [references/routing-precedence.md](references/routing-precedence.md) for ambiguity resolution. ## Promotion Rules All promotion should extract and refine before it hardens. Never: - write raw logs directly into long-term memory - treat a working buffer as long-term memory - use system-governance files as temporary capture inboxes See [references/promotion-rules.md](references/promotion-rules.md) for details. See [references/correction-pipeline.md](references/correction-pipeline.md) for the correction-to-candidate-to-rule flow. See [references/candidate-review.md](references/candidate-review.md) for keep/promote/discard review workflow. See [references/dreaming-integration.md](references/dreaming-integration.md) for how this kernel should coexist with OpenClaw Dreaming without duplicate promotion paths. See [references/stateful-targets.md](references/stateful-targets.md) for update semantics on stateful targets. See [references/schema-conventions.md](references/schema-conventions.md) if the host wants stronger structured constraints. See [references/retention-rules.md](references/retention-rules.md) for lifecycle rules. See [references/read-order.md](references/read-order.md) for recovery-time read order. ## Skill Integration When another skill integrates with this kernel: - the skill may declare which information types it emits - the skill may declare where those types usually land - the skill should not invent a new global memory-layer definition - the skill should not bypass exclusion rules - the skill should not confuse downstream storage rules with upstream memory rules See [references/skill-integration.md](references/skill-integration.md). ## Adapters `memory-governor` may provide default adapters, but those adapters are not the only truth. Examples: - `long_term_memory` -> `MEMORY.md` - `daily_memory` -> `memory/YYYY-MM-DD.md` - `reusable_lessons` -> `~/self-improving/...` if `self-improving` is installed - `reusable_lessons` -> a local fallback file if `self-improving` is absent See [references/adapters.md](references/adapters.md) for default adapter behavior. See [references/integration-checklist.md](references/integration-checklist.md) for integration checks. See [references/installation-integration.md](references/installation-integration.md) for installation and host integration guidance. See [references/host-profiles.md](references/host-profiles.md) for host differences. ## Never Do - do not turn this skill into a monolithic personal memory system - do not embed Obsidian, Notion, or OmniFocus implementation details into the governance kernel - do not force every skill into the same implementation style - do not invent a new primary memory directory unless the governance layer explicitly approves it - do not write secrets, raw long logs, or short-lived noise into memory ## Phase Boundary The current phase is governance core only. That means: - it may define contracts - it may define references - it may constrain how other skills write memory - it may not quietly grow into a unified execution bus at this stage If the project later wants an orchestration layer or a full personal memory system, that should be scoped separately after the governance layer is stable.

path: CHANGELOG.md
content: # Changelog

## 0.2.9 - 2026-04-07

### Added

- `references/dreaming-integration.md` to define how `memory-governor` should coexist with OpenClaw Dreaming

### Changed

- README positioning now explains that `memory-governor` complements Dreaming instead of replacing it
- promotion rules now separate Dreaming-preferred `daily_memory -> long_term_memory` from manual-only hardening paths
- read-order guidance now explicitly excludes `DREAMS.md` from normal startup and recovery reads
- adapter, host-profile, installation, and skill-integration docs now define `DREAMS.md` / `memory/.dreams/` as engine-owned artifacts and keep explicit correction staging out of Dreaming

## 0.2.8 - 2026-04-05

### Added

- `learning_candidates` as a low-commitment target class for corrections and emerging lessons
- `references/correction-pipeline.md` describing the staged correction flow
- fallback template for candidate-layer capture
- checker, validator, and generic host example support for `learning_candidates`
- candidate review workflow documentation and `review-learning-candidates.py` helper
- stronger candidate entry lifecycle guidance, including `lifecycle_stage` and `evidence_count`
- machine-checkable integration checks for host entry files and writer skill contracts
- OpenClaw-style simulated tests covering fallback-only, external-adapter, partial-adapter, and invalid-schema scenarios

### Changed

- explicit corrections now route to `learning_candidates` by default instead of hardening immediately
- promotion rules now describe minimal candidate-to-lesson thresholds
- skill integration docs now explain correction staging and sampling boundaries
- host validation now checks for real `memory-governor` / `Memory Contract` markers instead of file existence only

## 0.2.7 - 2026-04-05

### Added

- maintainer-facing `tests/` with validator, host-checker, and bootstrap coverage
- more complex host fixtures covering split, directory/pattern, unknown target, and missing fallback cases
- `dev/` area for plans and evaluation materials
- `releases/` directory for versioned release notes

### Changed

- repository layout is now clearer about runtime package vs maintainer-only material
- maintainer entry docs are now bilingual in `dev/` and `releases/`

## 0.2.5-beta - 2026-03-31

### Changed

- public README now states more clearly that `memory-governor` is a governance kernel, not an execution-first skill
- public positioning now explains who should use it and when it may feel too heavy

## 0.2.4-beta - 2026-03-31

### Fixed

- `check-memory-host.py` and `validate-memory-frontmatter.py` now support Python 3.9 / 3.10 via `tomli` fallback

### Changed

- installation docs now call out Python version compatibility explicitly

## 0.2.3-beta - 2026-03-31

### Added

- migration guide for hosts that already have a messy memory setup
- manifest examples for `reusable_lessons` as `directory` or `pattern`

### Changed

- host checker and manifest contract now support `fallback_paths`
- installation and integration docs now point legacy hosts to the migration path
- integration checklist now calls out non-single `reusable_lessons` modes explicitly

## 0.2.2-beta - 2026-03-31

### Added

- bilingual public-facing intro sections in `README.md`
- bilingual opening guidance in `SKILL.md`

### Changed

- public packaging now reads more clearly for both English and Chinese readers

## 0.2.1-beta - 2026-03-31

### Added

- clearer English public-facing summary in `README.md`
- bilingual skill description in `SKILL.md` for ClawHub-facing metadata

### Changed

- public packaging now explains the `Installed / Integrated / Validated` model more clearly for external readers

## 0.2.0-beta - 2026-03-31

This is the first distributable beta shape of `memory-governor`.

### Added

- generic core + host profiles packaging model
- packaged fallback templates in `assets/fallbacks/`
- installation and integration guide
- host profile reference for `Generic` and `OpenClaw`
- snippets for host-level and skill-level integration
- before / after comparison page
- generic host validation record
- standalone `examples/generic-host/` example directory
- lightweight bootstrap script for generic hosts
- adapter manifest contract via `memory-governor-host.toml`
- manifest-driven host checker flow for generic and OpenClaw hosts

### Changed

- path-centric design language was tightened into `memory type -> target class -> adapter`
- optional skills such as `self-improving` and `proactivity` are now treated as adapters, not core dependencies
- OpenClaw is now framed as a reference host profile rather than the universal default
- OpenClaw host can now declare its adapter map explicitly instead of relying only on reference-profile inference

### Fixed

- machine-local absolute links were removed from package-facing docs
- fallback assets are now packaged inside the skill
- adapter resolution order is documented explicitly
- host checking can now prefer explicit manifest contracts over directory guessing

### Current Scope

`memory-governor` remains a governance kernel.

It does not attempt to become:

- a second-brain platform
- a universal sync bus
- a forced workspace migration tool

### Known Gaps

- no polished public landing page yet
- no richer installer beyond the lightweight bootstrap
- no versioned release automation


path: README.md
content: # Memory Governor

**Memory governance for AI agents. Complements OpenClaw Dreaming instead of replacing it.**

Languages: **English** | [中文](#中文)

`memory-governor` is a governance kernel for hosts that already have multiple memory layers, memory-writing skills, or optional adapters. It gives those systems one shared contract for deciding what should be remembered, where it should go, when it should stay temporary, and when it is safe to harden into durable guidance.

OpenClaw Dreaming is great at background consolidation from short-term signals into long-term memory. `memory-governor` focuses on the adjacent gap: explicit correction staging, memory routing, adapter boundaries, and manual hardening rules.

In short:

- Dreaming handles background consolidation.
- `memory-governor` handles capture rules, target classes, correction staging, and hardening boundaries.

## Why Install It

Install `memory-governor` when your agent memory is starting to drift:

- multiple skills write memory-like state
- explicit corrections are getting mixed into daily notes
- single observations harden into long-term rules too quickly
- optional adapters such as `self-improving` or `proactivity` create routing ambiguity
- you want one contract before the system becomes path-based chaos

This is not an execution-first productivity skill. It is infrastructure for memory-heavy agent systems.

## What It Adds

- Standard memory target classes:
  `long_term_memory`, `daily_memory`, `learning_candidates`, `reusable_lessons`, `proactive_state`, `working_buffer`, `project_facts`, `system_rules`, and `tool_rules`
- A routing model:
  `memory type -> target class -> adapter / fallback`
- A low-commitment `learning_candidates` layer for explicit corrections and first-sighting lessons
- Candidate review guidance for `keep / promote / discard`
- Clear promotion authority:
  Dreaming-preferred for `daily_memory -> long_term_memory`, manual review for correction hardening and system-rule promotion
- Boundaries for Dreaming artifacts:
  `DREAMS.md` and `memory/.dreams/` are engine-owned artifacts, not standard memory target classes
- Host manifest support through `memory-governor-host.toml`
- Host checker, frontmatter validator, candidate reviewer, and generic-host bootstrap scripts
- A generic host example that does not require OpenClaw-specific directories

## Core Model

`memory-governor` separates memory decisions into three layers:

1. **Memory type**
   What kind of information is this?
2. **Target class**
   Which abstract memory layer should own it?
3. **Adapter / fallback**
   Where does this host store that target class?

That keeps the core contract independent from any one plugin, folder layout, or host implementation.

## Dreaming Compatibility

`memory-governor` should not compete with Dreaming.

Recommended split:

- Dreaming:
  `daily_memory -> long_term_memory`
- `memory-governor`:
  capture rules, correction staging, adapter boundaries, and manual hardening
- Human / explicit review:
  `learning_candidates -> reusable_lessons -> system_rules / tool_rules`

Do not model `DREAMS.md` or `memory/.dreams/` as normal memory target classes. Treat them as Dreaming-owned artifacts.

See [dreaming-integration.md](references/dreaming-integration.md).

## Readiness Model

`memory-governor` uses three readiness states:

- `Installed`
  The skill is available and the rules can be read.
- `Integrated`
  The host has wired itself to the memory contract.
- `Validated`
  The host checker has confirmed the wiring.

Installation does **not** silently rewrite `AGENTS.md`, other skills, or existing memory files. Host integration should be explicit.

## Quick Start

Recommended first reading path:

1. [SKILL.md](SKILL.md)
2. [memory-routing.md](references/memory-routing.md)
3. [promotion-rules.md](references/promotion-rules.md)
4. [dreaming-integration.md](references/dreaming-integration.md)
5. [adapters.md](references/adapters.md)
6. [installation-integration.md](references/installation-integration.md)

For a generic host example:

- [examples/generic-host/README.md](examples/generic-host/README.md)

For package maintenance:

```sh
python3 -m unittest discover -s tests -p 'test_*.py' -v
```

## Scripts

- [check-memory-host.py](scripts/check-memory-host.py)
  checks host manifest wiring, fallback paths, and integration declarations
- [validate-memory-frontmatter.py](scripts/validate-memory-frontmatter.py)
  validates structured memory files
- [review-learning-candidates.py](scripts/review-learning-candidates.py)
  reviews candidate freshness and structure without auto-promoting
- [bootstrap-generic-host.sh](scripts/bootstrap-generic-host.sh)
  creates a minimal generic host skeleton
- [refresh-clawhub-package.sh](scripts/refresh-clawhub-package.sh)
  refreshes the publish-only ClawHub package

Python compatibility:

- Python 3.11+ uses standard-library `tomllib`
- Python 3.9 / 3.10 should install `tomli`

## Package Layout

Runtime package:

- `SKILL.md`
- `README.md`
- `VERSION`
- `references/`
- `assets/`
- `scripts/`
- `examples/generic-host/`

Maintainer-only material:

- `tests/`
- `dev/`
- `releases/`

ClawHub should be published from:

- `publish/clawhub/`

not from the repository root.

## What It Is Not

`memory-governor` is not:

- a second-brain platform
- a Notion / Obsidian sync engine
- a universal sync bus
- an auto-archiving system
- a replacement for Dreaming
- a runtime hook system that forces memory routing automatically

It gives the host a contract. The host still decides how to integrate it.

## Current Version

`0.2.9`

## 中文

**面向 AI agent 的记忆治理内核。它不是 Dreaming 的替代品，而是 Dreaming 的补完层。**

`memory-governor` 适合已经出现多层记忆、多种写记忆 skill、或者可选 adapter 越来越多的宿主系统。它提供一套统一 contract，用来判断什么值得记、应该进入哪一层、什么时候保持短期、什么时候可以被硬化成长期规则。

OpenClaw Dreaming 很适合做短期信号到长期记忆的后台巩固。`memory-governor` 负责旁边那个缺口：明确纠错的候选层、记忆路由、adapter 边界、人工升格边界。

一句话：

- Dreaming 负责后台巩固。
- `memory-governor` 负责捕获规则、target classes、纠错候选层和 hardening 边界。

## 为什么安装

当你的 agent 记忆开始变复杂时，`memory-governor` 会更有价值：

- 多个 skill 都在写 memory-like state
- 明确纠错混进了 daily notes
- 单次观察太快硬化成长期规则
- `self-improving`、`proactivity` 这类可选 adapter 开始带来路由歧义
- 你想在系统变乱之前先建立一套共享 contract

它不是一个“装上立刻替你干活”的生产力 skill。它更像复杂记忆系统的基础设施。

## 它提供什么

- 标准 memory target classes：
  `long_term_memory`、`daily_memory`、`learning_candidates`、`reusable_lessons`、`proactive_state`、`working_buffer`、`project_facts`、`system_rules`、`tool_rules`
- 路由模型：
  `memory type -> target class -> adapter / fallback`
- 低承诺候选层 `learning_candidates`，用于明确纠错和首次出现但尚未证明可复用的经验
- `keep / promote / discard` 的 candidate review 规则
- 清晰的 promotion authority：
  Dreaming 优先处理 `daily_memory -> long_term_memory`，人工 review 处理纠错 hardening 和系统规则升格
- Dreaming 产物边界：
  `DREAMS.md` 和 `memory/.dreams/` 是 engine-owned artifacts，不是标准 target classes
- `memory-governor-host.toml` 宿主 manifest
- host checker、frontmatter validator、candidate reviewer、generic-host bootstrap 等轻量工具
- 不依赖 OpenClaw 固定目录结构的 generic host 示例

## 核心模型

`memory-governor` 把记忆决策拆成三层：

1. **Memory type**
   这条信息是什么？
2. **Target class**
   它应该进入哪个抽象记忆层？
3. **Adapter / fallback**
   当前宿主把这个 target class 落到哪里？

这样治理内核就不会被某个插件、目录结构或宿主实现绑死。

## 和 Dreaming 的关系

`memory-governor` 不应该和 Dreaming 竞争。

推荐分工：

- Dreaming：
  `daily_memory -> long_term_memory`
- `memory-governor`：
  捕获规则、纠错候选层、adapter 边界、人工 hardening
- 人工 / 显式 review：
  `learning_candidates -> reusable_lessons -> system_rules / tool_rules`

不要把 `DREAMS.md` 或 `memory/.dreams/` 当成普通 memory target class。它们应被视为 Dreaming 的 engine-owned artifacts。

详见 [dreaming-integration.md](references/dreaming-integration.md)。

## 接入状态

`memory-governor` 推荐用三种状态理解：

- `Installed`
  skill 已安装，规则可读
- `Integrated`
  宿主已经显式接入这套 contract
- `Validated`
  host checker 已确认接线状态

安装不会静默修改 `AGENTS.md`、其他 skill 或已有记忆文件。宿主集成应该显式执行。

## 快速开始

推荐阅读顺序：

1. [SKILL.md](SKILL.md)
2. [memory-routing.md](references/memory-routing.md)
3. [promotion-rules.md](references/promotion-rules.md)
4. [dreaming-integration.md](references/dreaming-integration.md)
5. [adapters.md](references/adapters.md)
6. [installation-integration.md](references/installation-integration.md)

Generic host 示例：

- [examples/generic-host/README.md](examples/generic-host/README.md)

维护者测试入口：

```sh
python3 -m unittest discover -s tests -p 'test_*.py' -v
```

## 它不是什么

`memory-governor` 不是：

- second-brain 平台
- Notion / Obsidian 同步器
- 通用同步总线
- 自动归档系统
- Dreaming 替代品
- 强制执行记忆路由的 runtime hook 系统

它提供的是 contract。宿主仍然需要决定如何接入。


path: assets/fallbacks/learning-candidates.md
content: +++
target_class = "learning_candidates"
schema_version = "0.1"
updated_at = "2026-04-05T00:00:00Z"
candidate_status = "candidate"
+++

# Learning Candidates

Use this file for low-commitment corrections and emerging lessons that are not yet proven durable.

## Candidates

### Candidate: replace direct hardening with staged correction capture

- summary: explicit corrections should land here before becoming reusable lessons
- why_it_matters: one-off fixes should not become durable rules too early
- promotion_signals: repeated across tasks, rewritten as a general rule
- lifecycle_stage: collecting_evidence
- evidence_count: 1
- next_review: review at task closeout or when the same mistake appears again


path: assets/fallbacks/proactive-state.md
content: +++
target_class = "proactive_state"
schema_version = "0.1"
updated_at = "2026-03-31T00:00:00Z"
state_mode = "combined"
current_objective = ""
current_blocker = ""
next_move = ""
+++

# proactive-state.md

Fallback template for the `proactive_state` target class.

Use this when no preferred adapter is available.

## Current Task State

- current objective
- current blocker
- next move

## Durable Boundaries

- durable proactive boundaries that matter for the current line of work

## Rules

- treat this as the current truth, not a running transcript
- replace stale fields when the task state changes
- extract durable lessons before promoting elsewhere
- clear or refresh when the task is done


path: assets/fallbacks/reusable-lessons.md
content: +++
target_class = "reusable_lessons"
schema_version = "0.1"
updated_at = "2026-03-31T00:00:00Z"
scope = "global"
+++

# reusable-lessons.md

Fallback template for the `reusable_lessons` target class.

Use this when no preferred adapter is available.

## Lessons

- reusable execution lessons
- distilled corrections
- cross-task stable working methods

## Do Not Store

- raw logs
- temporary session state
- project-local facts that do not generalize
- unprocessed scratch notes


path: assets/fallbacks/working-buffer.md
content: +++
target_class = "working_buffer"
schema_version = "0.1"
updated_at = "2026-03-31T00:00:00Z"
task_ref = ""
buffer_status = "active"
+++

# working-buffer.md

Fallback template for the `working_buffer` target class.

Use this when no preferred adapter is available.

## Breadcrumbs

- temporary recovery breadcrumbs
- fragile intermediate conclusions
- notes needed to resume interrupted work

## Rules

- short-lived by default
- do not treat as long-term memory
- promote only after distillation


path: assets/snippets/ADAPTERS-fallback-note.md
content: ## Adapter Note

This workspace treats optional skills as adapters, not as mandatory dependencies.

If a preferred adapter is unavailable:

- keep the target class
- switch to the documented fallback
- do not rewrite the memory model just because one adapter is missing


path: assets/snippets/AGENTS-memory-governance.md
content: ## Memory Governance

This workspace follows `memory-governor`.

Route memory in two steps:

1. classify the information into a target class
2. let the current environment's adapter map that class to a concrete file

Do not let individual skills define their own global memory rules.

For the full contract, see `memory-governor/SKILL.md`.


path: assets/snippets/SKILL-memory-contract.md
content: ## Memory Contract

This skill follows `memory-governor`.

Typical outputs:

- [memory type] -> [target class]
- [memory type] -> [target class]

Current adapter examples:

- [target class] -> [current path or downstream system]

Constraints:

- This skill does not define its own global memory rules.
- This skill should not bypass `memory-governor` promotion or exclusion rules.
- If an optional adapter is missing, use the current fallback behavior instead of inventing a new global rule.


path: examples/generic-host/HOST.md
content: # Host Memory Governance

This host follows `memory-governor`.

Rules:

- classify memory before choosing a file
- route memory to target classes before resolving concrete paths
- use the local adapter map for host-specific paths
- fall back to local memory files when optional adapters are unavailable

This host does not assume:

- `AGENTS.md`
- OpenClaw workspace layout
- `self-improving`
- `proactivity`

In this host, `memory-governor` is treated as a generic governance core, not an OpenClaw-only package.


path: examples/generic-host/README.md
content: # Generic Host Example

这个目录演示：

> 一个不具备 OpenClaw 目录结构的普通宿主，如何接入 `memory-governor`

它不是 OpenClaw 镜像。

它故意假设宿主只有最基本的能力：

- 一个宿主级说明文件
- 一个 `skills/` 目录
- 一个本地 `memory/` 目录
- 没有 `self-improving`
- 没有 `proactivity`
- 没有 `AGENTS.md`

## What This Example Contains

- `HOST.md`
  宿主级“记忆治理声明”
- `memory-governor-host.toml`
  给 checker 读取的 machine-readable adapter manifest
  现在也声明了 host entry 和 writer contract 路径
- `adapter-map.md`
  这个宿主当前采用的 target class 到路径映射
- `memory/long-term.md`
  `long_term_memory` 的一个宿主级落点示例
- `skills/example-writer/SKILL.md`
  一个接入了 `memory-governor` 的普通 skill 示例
- `memory/learning-candidates.md`
  本地 `learning_candidates` fallback 示例
- `python3 ../scripts/review-learning-candidates.py memory/learning-candidates.md`
  对候选层做轻量 review 检查
- `memory/proactive-state.md`
  本地 `proactive_state` fallback 示例
- `memory/reusable-lessons.md`
  本地 fallback 示例
- `memory/working-buffer.md`
  本地 fallback 示例
- `docs/project-facts.md`
  `project_facts` 落点示例
- `docs/tool-rules.md`
  `tool_rules` 落点示例

## What This Example Proves

它证明三件事：

1. 宿主不必长得像 OpenClaw
2. target class 可以映射到宿主自己的目录结构
3. optional skill 缺失时，仍然可以靠 fallback 正常成立

## Suggested Reading Order

1. `HOST.md`
2. `memory-governor-host.toml`
3. `adapter-map.md`
4. `memory/proactive-state.md`
5. `skills/example-writer/SKILL.md`
6. `memory/learning-candidates.md`
7. `memory/reusable-lessons.md`
8. `memory/working-buffer.md`


path: examples/generic-host/adapter-map.md
content: # Adapter Map

这是 generic host 的一个示例 adapter map。

它不是唯一正确写法，但它展示了宿主如何在不依赖 OpenClaw 目录的情况下接入 `memory-governor`。

给人读的时候看这份。  
给工具读的时候看 `memory-governor-host.toml`。

## Current Mappings

- `long_term_memory` -> `memory/long-term.md`
- `daily_memory` -> `notes/daily/YYYY-MM-DD.md`
- `reusable_lessons` -> `memory/reusable-lessons.md`
- `proactive_state` -> `memory/proactive-state.md`
- `working_buffer` -> `memory/working-buffer.md`
- `project_facts` -> `docs/project-facts.md`
- `system_rules` -> `HOST.md`
- `tool_rules` -> `docs/tool-rules.md`

## Notes

- 这里没有依赖 `self-improving`
- 这里没有依赖 `proactivity`
- `proactive_state`、`reusable_lessons` 和 `working_buffer` 直接用本地 fallback 风格文件承接
- 如果宿主将来安装了专门 adapter，可以在不改 target class 语义的前提下替换路径


path: examples/generic-host/docs/project-facts.md
content: # Project Facts

这里承接当前宿主里的项目事实型记忆。

它用于放项目特有、可复查、但不应误升格为全局经验的内容。


path: examples/generic-host/docs/tool-rules.md
content: # Tool Rules

这里承接当前宿主里的工具规则。

它用于放工具特性、gotcha、调用边界和使用约定。


path: examples/generic-host/memory/learning-candidates.md
content: +++
target_class = "learning_candidates"
schema_version = "0.1"
updated_at = "2026-04-05T00:00:00Z"
candidate_status = "candidate"
+++

# Learning Candidates

This file is the local fallback for `learning_candidates`.

## Candidates

### Candidate: route explicit corrections here before hardening

- summary: capture explicit corrections before they become reusable lessons
- why_it_matters: prevents a single correction from turning into a permanent rule
- promotion_signals: same correction appears again, or user says it should always apply
- lifecycle_stage: collecting_evidence
- evidence_count: 1
- next_review: review at task closeout


path: examples/generic-host/memory/long-term.md
content: # Long-Term Memory

这是 generic host 的长期记忆占位文件。

它不是 `memory-governor` 强制的格式，只是示例宿主里 `long_term_memory` 的一个落点。


path: examples/generic-host/memory/proactive-state.md
content: +++
target_class = "proactive_state"
schema_version = "0.1"
updated_at = "2026-03-31T00:00:00Z"
state_mode = "combined"
current_objective = ""
current_blocker = ""
next_move = ""
+++

# Proactive State

This file is the local fallback for `proactive_state`.

Use it when the host does not install a dedicated proactivity adapter.

## Current Task State

- current objective
- current blocker
- next move

## Durable Boundaries

- activation preferences that still matter for this line of work
- proactive boundaries worth preserving across interruptions

## Rules

- keep current task state easy to scan
- replace stale task fields instead of appending forever
- keep durable boundaries separate from transient breadcrumbs
- clear or refresh task-specific fields when the task is complete


path: examples/generic-host/memory/reusable-lessons.md
content: +++
target_class = "reusable_lessons"
schema_version = "0.1"
updated_at = "2026-03-31T00:00:00Z"
scope = "global"
+++

# Reusable Lessons

This file is the local fallback for `reusable_lessons`.

## Lessons

- the host does not install a dedicated self-improvement adapter
- a lesson is reusable beyond the current task
- the lesson is stable enough to help future work

## Do Not Store

- raw logs
- one-off chatter
- secrets
- unverified guesses


path: examples/generic-host/memory/working-buffer.md
content: +++
target_class = "working_buffer"
schema_version = "0.1"
updated_at = "2026-03-31T00:00:00Z"
task_ref = ""
buffer_status = "active"
+++

# Working Buffer

This file is the local fallback for `working_buffer`.

## Breadcrumbs

- recovery hints
- temporary next-step context
- short-lived execution breadcrumbs

## Rules

- short-lived by default
- do not promote directly from here to long-term memory without extraction


path: examples/generic-host/memory-governor-host.toml
content: version = "0.1"
profile = "generic"

[integration]
host_entry_paths = ["HOST.md"]
writer_contract_paths = ["skills/example-writer/SKILL.md"]

[targets.long_term_memory]
mode = "single"
paths = ["memory/long-term.md"]
structured = false

[targets.daily_memory]
mode = "pattern"
paths = ["notes/daily/YYYY-MM-DD.md"]
structured = false

[targets.learning_candidates]
mode = "single"
paths = ["memory/learning-candidates.md"]
structured = true

[targets.reusable_lessons]
mode = "single"
paths = ["memory/reusable-lessons.md"]
structured = true

[targets.proactive_state]
mode = "single"
paths = ["memory/proactive-state.md"]
structured = true

[targets.working_buffer]
mode = "single"
paths = ["memory/working-buffer.md"]
structured = true

[targets.project_facts]
mode = "single"
paths = ["docs/project-facts.md"]
structured = false

[targets.system_rules]
mode = "single"
paths = ["HOST.md"]
structured = false

[targets.tool_rules]
mode = "single"
paths = ["docs/tool-rules.md"]
structured = false


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)