Cognitive runtime
Heartbeat and first-turn pressure
puax_tick is one beat: detect, raise pressure, pick a role, inject a thin prompt, record evolution. The return value is an AMP/0.1 envelope.
Who fires it
- Default: the host hook. SessionStart must not block the user's first message.
- Manual: with no hook, the agent calls
puax_tickand passes the latest user message.
Events
SessionStart, UserPromptSubmit, PostToolUse, PreCompact, Stop, Manual.
Time-to-first-pressure
The cold start should apply pressure on turn one, not after a tool lecture. Check with:
npx puax-mcp-server doctor\nnode evals/test-ttf.jsThe heartbeat injects the compact thin prompt by default. A tight context_budget drops it to minimal. An explicit mode that does not fit is also dropped to the floor. It does not stuff the full prompt in.
Code sample
puax_tick({
session_id: "sess-1",
event: "UserPromptSubmit",
message: "为什么还不行?同一报错已经第三次了",
task_type: "repair"
})
# Stop 时带上结局,进化才记实绩
puax_tick({
session_id: "sess-1",
event: "Stop",
success: true
})