Install
openclaw skills install @otherpowers/memory-latchDetect and recover from context resets, memory/index outages, and cache clears with deterministic, trust-preserving reconstruction. Use when continuity breaks ("you forgot", "start over", "lost context", "memory unavailable", "cache cleared", "why are you confused?") or before irreversible actions.
openclaw skills install @otherpowers/memory-latchA load-bearing primitive for continuity, alignment, and relational sanctuary.
Restore trust and forward motion after continuity breaks through minimal, verified reconstruction.
Default behavior is local-only and zero-credential:
checksumAdvanced modes are explicit opt-in:
hmac mode requires pre-configured secret storageCanonical storage path (fixed at startup):
<workspace>/.memory-latch/_manifest.md<workspace>/.memory-latch/_manifest.lock<workspace>/.memory-latch/tokens.jsonOperational constraints:
When memory breaks, do not pretend. Name the rupture. Re-anchor intent. Move one safe step at a time.
memory-latch does not promise perfect recall. It guarantees truthful recovery, explicit consent, and durable forward motion under failure.
If context is weather, the latch is shelter.
Truthful Recovery Acknowledge resets in one sentence. Never simulate continuity not present in verifiable artifacts.
Append-Only Persistence
Treat _manifest.md as append-only operational history with integrity metadata.
Serial Bottleneck Rebuild state one step at a time. Avoid high-bandwidth dumps during recovery.
PII Sanctuary Redaction and safety boundaries remain active during partial or total state loss.
Write Discipline
Persist _manifest.md:
Initiate recovery when either condition is true:
If user is frustrated or asks for step-by-step:
If recovery fails 3 times:
For any irreversible=true action (delete, send, public-post, wallet-transfer, core-config):
action_hash = sha256(canonical_action_summary).ACT-9K2).action_hashNo valid token -> no execution.
Before high-stakes execution, require all checks to pass:
Intent vs Result Check Intended state delta matches resulting state delta.
Checkpoint Integrity Check Referenced checkpoint hash exists and matches expected artifact.
Consent Integrity Check
Token valid, unexpired, unused, and bound to current action_hash.
Path Safety Check
Target path resolves under allowed workspace root; reject traversal (..), symlink hops, or unexpected root escape.
Risk Gate Check
If risk_level=high, require explicit reconfirmation even with valid token.
If any check fails: block execution and return one-step remediation.
Canonical Path Enforcement
_manifest.md path must be canonicalized and fixed at startup.
Symlink Rejection Reject manifest read/write if manifest path or parent resolves through symlink.
Lock Semantics
Use _manifest.lock for writes:
_manifest.mdWrite Timeout
If lock cannot be acquired within lock_timeout_ms, fail closed and retry with bounded backoff.
Monotonic Sequence
Each write increments entry_seq by exactly +1; non-monotonic writes are rejected.
Integrity modes:
checksum (default MVP): sha256 over canonical manifest payloadhmac (optional hardened mode): only when managed secret storage is configuredIf integrity verification fails:
Active Composting Keep final 3 decisions in manifest; retire prior 20 brainstorming turns from active reasoning.
Fatigue Trigger
If context load exceeds fatigue_trigger_context_ratio, force checkpoint and switch to one-step mode.
Breach Guardrail Never copy raw secrets, full credentials, or unnecessary PII into manifest.
Wallet mode is optional and disabled by default.
Use only when wallet tooling is already configured:
action_hashnonceexpires_at_manifest.md){
"updated_at": "2026-03-21T15:24:00Z",
"entry_seq": 1,
"objective": "Current primary goal",
"non_negotiables": ["Safety/redline constraints"],
"last_good_checkpoint": "sha256:...",
"blocked_by": "Current dependency",
"next_single_step": "Atomic next action",
"known_state": ["Verified facts/artifacts only"],
"unknown_state": ["Unverified/missing items"],
"consent_state": "authorized|pending|locked",
"irreversible_action_pending": "ACT-9K2|none",
"action_hash": "sha256:...|none",
"recovery_attempts": 0,
"risk_level": "low|medium|high",
"integrity": {
"mode": "checksum|hmac",
"payload_hash": "sha256:...",
"hmac_signature": "hex|none",
"verified_at": "2026-03-21T15:24:00Z"
},
"storage": {
"root": "<workspace>/.memory-latch",
"manifest_path": "<workspace>/.memory-latch/_manifest.md",
"lock_path": "<workspace>/.memory-latch/_manifest.lock",
"token_ledger_path": "<workspace>/.memory-latch/tokens.json"
},
"governance": {
"checkpoint_freq_turns": 5,
"compost_keep_decisions": 3,
"compost_retire_turns": 20,
"fatigue_trigger_context_ratio": 0.75,
"token_ttl_minutes": 10,
"token_single_use": true,
"lock_timeout_ms": 800,
"max_recovery_attempts": 3
}
}
We build memory-latch for more than uptime. We build it so trust can survive turbulence.
When systems fracture, let truth stay gentle and exact. Let consent remain explicit. Let safety include everyone in the room, and everyone not yet in it.
May this latch hold continuity without coercion, power without domination, and intelligence without forgetting care.
If context is weather, we choose to be shelter for one another.