AI agent memory needs a verification step
说明与用途
memory_governance.py CLI 用于验证 AI 内存更新,检测项目文件中的不一致,并在确认更改后才标记为已验证。
问题
AI agents can update MEMORY.md but leave other project files outdated, causing inconsistencies.
结果
The CLI ensures that AI-driven memory updates are verified against all related project files, preventing hidden inconsistencies and maintaining a history of contradictions.
工作流
- Initialize the pack with
python3 extras/memory-governance/memory_governance.py --target /path/to/your-project init - Run
python3 scripts/memory_governance.py doctorto check for contradictions and receipts - When a file move occurs, run
python3 scripts/memory_governance.py impact --event file_move --terms "old-component" --recordto create a receipt - Verify the receipt with
python3 scripts/memory_governance.py verify --receipt R-000001 --allow "archive/**" - Add contradictions using
python3 scripts/memory_governance.py contradict add --old "INDEX.md is optional" --new "INDEX.md changes with files" --evidence "DECISION-42" - Use
doctorto detect open contradictions and resolve them - Repeat verification after updates to ensure all references are current
证据
An AI can update MEMORY.md and still leave five other files describing the old project.
The new extras/memory-governance/ pack in wallaby-agent-rules does this without a model, a database, or a service. One Python file. JSON for state.
The pack turns those into four deterministic checks: file_missing, file_exists, text_contains, and json_equals.
The pack has 14 regression tests covering installation, all nine event types, premise exit codes, contradiction history, explicit scan limits, and false-green prevention.
- 记录日期: 2026-11-02T02:58:52.154Z