Native-first OpenClaw memory curation, v1 migration, audit, transaction recovery, and isolated self-test.
--- name: "signal-dreaming" description: "Native-first OpenClaw memory curation, v1 migration, audit, transaction recovery, and isolated self-test." homepage: "https://github.com/lzyling/signal-dreaming" license: "MIT-0" metadata: version: "2.0.1" minimum_openclaw: "2026.7.1" tested_openclaw: "2026.7.1" runtime: "Node.js 24+; Bash 3.2+ for wrappers and self-test" platforms: "macOS, Linux" --- # Signal Dreaming v2 Native-first, gate-driven memory curation. OpenClaw `memory-core` owns daily ingestion, recall signals, Light/REM/Deep phases, promotion state, `DREAMS.md`, and its managed sweep. This skill owns only reversible Markdown curation after a deterministic gate and fail-closed compatibility preflight. ## Use modes - **audit** — read-only health, candidate, lifecycle, privacy, size, compatibility, and recovery review. - **preview** — exact proposed `MEMORY.md` / L2 changes, no live writes. - **curate** — gate-driven scheduled or explicit manual curation through a staged transaction. - **migrate** — read-only v1.3.1 → v2 preflight, then an explicitly approved, reversible cron cutover. - **recover** — discover, inspect, abort, or roll back a v2 transaction with explicit confirmation. - **self-test** — run the isolated transaction, gate, path, validation, and recovery acceptance suite. Scheduled deployments may check the gate daily or weekly. Never create a second native Dreaming owner or a second indexed dream diary. ## Native boundary Before any write, follow `references/native-capability-contract.md`. OpenClaw 2026.7.1+ and the documented read-only schemas are the minimum contract. Missing commands, missing fields, schema drift, unhealthy native audit, or ambiguous ownership means audit-only. Use supported read-only surfaces: - `openclaw memory status --json` - `openclaw memory promote --json --include-promoted` - bounded `openclaw memory promote-explain ... --json` - `openclaw memory rem-harness --json` for diagnosis only - sanitized `openclaw cron list --all --json` evidence for ownership checks Never: - read or edit plugin-state, SQLite, recall locks, or private store files; - reproduce native scoring or Light/REM/Deep phases; - auto-run `memory promote --apply`, `rem-backfill`, or `--stage-short-term`; - treat `DREAMS.md`, `memory/dreaming/**`, or `memory/.dreams/**` as factual sources; - use broad maintenance searches to manufacture recall signals; - edit OpenClaw config, cron, or restart Gateway without explicit approval. ## Runtime support - OpenClaw 2026.7.1 or newer. - Node.js 24 or newer; no third-party npm runtime dependencies. - macOS and Linux are supported. - Bash 3.2 or newer is required for `dream-audit.sh` and `self-test.sh`. - Invoke bundled `.sh` wrappers with `bash`; ClawHub archives do not preserve executable bits. - Windows is unsupported in v2.0. Path, permission, atomic replacement, and shell behavior have not passed a Windows acceptance suite. ## Durable memory model - `MEMORY.md` — compact bootstrap index: standing facts, active state, durable preferences, and L2 pointers. - `memory/<topic>.md` — durable topic detail. v2.0 supports top-level topic files only. - `memory/YYYY-MM-DD*.md` — immutable source notes; read only when provenance needs verification. - `memory/dream-log.md` — read-only v1 legacy diary. - `.backup/memory-dreams/<run-id>/` — v2 transaction backup, staging, manifest, and quarantine. - `logs/signal-dreaming/state.json` — non-indexed curation gate state. Nested `memory/**` topic targets are unsupported in v2.0 and fail closed. Existing nested material remains untouched and is not included in the gate snapshot. Editorial target for `MEMORY.md` is 8 KiB. The automatic trim trigger is 10 KiB; actual bootstrap truncation is always a hard condition. ## Workflow 1. Read `references/dream-protocol.md` and `references/native-capability-contract.md` completely. For a v1 upgrade, also read `references/migration-v1-to-v2.md` completely. 2. Run the deterministic gate. 3. In scheduled mode, exit on `fire=false` before model curation. 4. If a write may occur, collect sanitized native/cron evidence and run `migration-preflight.mjs`. Any uncertainty means audit-only. 5. Discover unfinished transactions with `transaction-list.mjs`; recover or stop before beginning another transaction. 6. Build an exact source-grounded write plan with identity, lifecycle, authority, contradiction, and privacy checks. 7. Begin a transaction with `memory-transaction.mjs` and edit staging copies only. 8. Verify, audit, and recheck live hashes. 9. Commit atomically per file; then mark the gate state. 10. Report touched files, evidence, warnings, and rollback id. Do not write a second indexed dream diary. ## Safety invariants - Daily notes, nested L2 targets, and native Dreaming artifacts are never write targets. - Closed, archived, paused, and superseded work stays non-active unless trusted newer user evidence reopens it. - Historical approval never becomes standing authority. - Unresolved contradictions are reported, not silently overwritten. - Secrets and unnecessary private detail are omitted; audits output filenames/categories only. - Native candidates require source verification before L2 routing. - Unknown native CLI versions, capabilities, schemas, or ownership fail closed to audit-only. - If live hashes change after staging, block commit. - Recovery never touches memory-core internals or OpenClaw config. ## Commands ```bash node <SKILL_DIR>/scripts/curation-gate.mjs check <WORKSPACE_ROOT> node <SKILL_DIR>/scripts/migration-preflight.mjs <WORKSPACE_ROOT> < <SANITIZED_PREFLIGHT_JSON> node <SKILL_DIR>/scripts/transaction-list.mjs <WORKSPACE_ROOT> node <SKILL_DIR>/scripts/memory-transaction.mjs begin <WORKSPACE_ROOT> <RUN_ID> MEMORY.md memory/<topic>.md node <SKILL_DIR>/scripts/memory-transaction.mjs verify <WORKSPACE_ROOT> <RUN_ID> node <SKILL_DIR>/scripts/memory-transaction.mjs commit <WORKSPACE_ROOT> <RUN_ID> node <SKILL_DIR>/scripts/memory-transaction.mjs status <WORKSPACE_ROOT> <RUN_ID> node <SKILL_DIR>/scripts/memory-transaction.mjs abort <WORKSPACE_ROOT> <RUN_ID> --confirm <RUN_ID> node <SKILL_DIR>/scripts/memory-transaction.mjs rollback <WORKSPACE_ROOT> <RUN_ID> --confirm <RUN_ID> bash <SKILL_DIR>/references/dream-audit.sh <WORKSPACE_ROOT> MEMORY.md memory/<topic>.md node <SKILL_DIR>/scripts/curation-gate.mjs mark <WORKSPACE_ROOT> <RUN_ID> bash <SKILL_DIR>/scripts/self-test.sh ``` ## Scheduling Run native Dreaming once daily. Run at most one v2 curator at least one hour later: - **daily gate** — check every day; curate only when the gate fires; - **weekly low-frequency** — check once weekly; accept slower reaction to changes. The v2 job is a curator, not another Dreaming owner. If the scheduler cannot evaluate the gate before model startup, a no-op agent turn may still occur. Cron creation, native Dreaming changes, publishing, and Gateway restarts remain separate explicit operations.
don't have the plugin yet? install it then click "run inline in claude" again.