T09 · Insecure Skill Coding Practices
- Location
scripts/auto_evolve.py:95- Finding
Destructive Memory Rewriting Without Backup or Transactional Recovery
- Content
View full analysis
由 robot-evolve 自动压缩生成 | {datetime.now().strftime('%Y-%m-%d')} ## 原始大小 - 压缩前: {size/1024/1024:.2f}MB - 行数: {total_lines} 行 ## 早期内容摘要 (详细历史请查看 `memory/evolution/` 中的归档日志) --- """ # 写入新内容 with open(memory_file, "w", encoding="utf-8") as f: f.write(summary + recent_content) new_size = memory_file.stat().st_size result = [ f"✅ MEMORY.md 已压缩(从 {size/1024/1024:.2f}MB 减少至 {new_size/1024/1024:.2f}MB)", f"✅ 保留最近 {int(total_lines * 0.8)} 行内容" ] log_action("记忆压缩", f"MEMORY.md从{size/1024/1024:.2f}MB压缩至{new_size/1024/1024:.2f}MB", "L1") return result ``` ### Technical Analysis The operation is described as compression and summarization, but it does not summarize or archive the removed material. It calculates a position at 20% of the file, retains only the rem ...[truncated 1493 chars]- Remediation
View remediation
