Evolution

Compaction and the cheat guard

Clients compress long threads. If the reasoning chain disappears, the agent retries from amnesia.

Reasoning state

  • puax_update_reasoning_state
  • Save tried approaches and the peak pressure
  • Best moment: the PreCompact hook
  • A session younger than about two hours can be rehydrated

Cheat guard

  • The contract is the acceptance test
  • puax_verify_completion is not the author of the patch
  • PreToolUse can block a hidden solution path and a sneaky git push. In dev guard mode, ordinary pushes are not the target. eval mode is stricter
  • Matching uses a normalized view (encoding, slashes, odd quotes) as well as the raw string. A hit on either blocks. The user's command is not rewritten

Code sample

# PreCompact 钩子
puax_update_reasoning_state(
  session_id="s1",
  summary="卡在 JWT 刷新竞态",
  triedApproaches=["加锁", "队列化 refresh"],
  nextSteps=["写复现测试", "查 redis setnx"]
)
Previous
Next chapter