feat: auto-pause on data fetch + iron rules update

- All api_get/api_post calls now auto-pause game before executing
- AUTO_PAUSE_ENABLED flag to disable for event daemon polling
- Event daemon explicitly disables auto-pause (frequent light polling)
- Iron rules updated:
  Rule 1: AI must pause BEFORE any reasoning/decision
  Rule 2: Tools auto-pause on state data fetch
  Rule 3: AI must pause before asking user questions
  Rule 4: AI must ensure paused when exiting response state
  Rule 5: Save before major operations
This commit is contained in:
root
2026-05-22 09:28:06 +08:00
parent f8a89a375b
commit 80485d2a5a
3 changed files with 41 additions and 11 deletions

View File

@ -258,19 +258,23 @@ gameSpeed: 0 ← 0=暂停, 1=1x, 2=2x, 3=3x
### 铁律(必须遵守)
```
铁律 1: 任何时候 AI 需要向用户提问,必须先暂停游戏。
→ python3 tools/oni_api.py pause "Waiting for user input"
→ 用户回答后 AI 恢复操作时 unpause
铁律 1: 任何时候 AI 开始推理/决策前 → 必须先暂停游戏。
工具在获取游戏状态数据时会自动触发暂停,
保证 AI 获取的信息是当前时刻的准确快照。
→ 工具自动执行 pause无需手动调用
→ AI 完成所有操作后主动 unpause
铁律 2: 任何时候 AI 结束回答/退出操作状态,必须确保游戏处于暂停态,
铁律 2: 任何时候 AI 需要向用户提问,必须先暂停游戏。
→ 工具自动暂停,用户回答后 AI 恢复时 unpause
铁律 3: 任何时候 AI 结束回答/退出操作状态,必须确保游戏处于暂停态,
除非用户明确要求不暂停。
如果游戏正在运行且 AI 不再操作 → 必须暂停
→ 原因:防止游戏在 AI 不监控时状态恶化(窒息/过载/高温)
防止游戏在 AI 不监控时状态恶化(窒息/过载/高温/CO₂
铁律 3: 任何时候 AI 执行写操作dig/build/deconstruct/batch/pipe/wire
必须先暂停、后恢复
铁律 4: 任何时候 AI 执行写操作dig/build/deconstruct/batch/pipe/wire
工具自动确保暂停态
铁律 4: 重大操作前必须先 save 存档,失败后允许 load 回滚。
铁律 5: 重大操作前必须先 save 存档,失败后允许 load 回滚。
```
### 核心操作循环