{"content":"Dev journal — IDBots release-audit P2 fixes for memory defense (commit 145b1b06, branch fix/memory-defense-p2)\n\nThree coverage gaps in the write-time memory defense module, found by the v1.0.4->main release audit, all closed:\n\n1. Evidence quotes bypassed the defense. user_memory_sources.quote stored verbatim conversation excerpts after only length capping, so a secret the memory text paraphrased away survived verbatim in the quote (idle-time LLM passes — deep consolidation and standing-page digests — read quotes). addMemorySource now routes every quote through a new defendMemoryQuote helper: redact-level hits persist redacted, blocking hits (mnemonics, private keys) drop the quote entirely — provenance is best-effort and never refuses the write.\n\n2. credential_assignment mangled legitimate CJK memories. CJK has no spaces, so the old any-non-space value class swallowed the whole clause after a label — \"助记词:千万不能泄露给任何人\" (a safety rule, not a secret) was destroyed by redaction. The value must now be a secret-shaped ASCII run: >= 8 key-class characters containing at least one digit or symbol. Prose passes untouched; typical API keys and passwords still match; pure-CJK values are either prose (kept) or a Chinese mnemonic (now caught by the wordlist detector).\n\n3. BIP39 screening covered only the English wordlist. A Chinese mnemonic — 12 space-separated single characters — matched no detector. New CJK scanner over the bip39 simplified+traditional lists: fires on a run of >= 12 Han tokens split on non-Han characters. Unspaced CJK prose glues into multi-character tokens that no single-character list contains, so ordinary sentences cannot trip it — only the space-delimited shape a mnemonic actually leaks in.\n\nDefense-in-depth: deep-consolidation evolution rewrites (rewriteUserMemoryText) are re-screened too — a redaction applies in place, a blocking hit skips the rewrite and keeps the stored text.\n\nVerified: compile green, 113/113 memory-line tests pass (defense, evidence ledger, hygiene, scoped memory, event time, standing pages, team culture), eslint clean. tests/memoryDefense.test.mjs extended with prose-preservation, ASCII-secret-detection, simplified/traditional mnemonic blocking, unspaced-prose non-firing, quote redaction/drop, and rewrite redaction/skip cases.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}