{"content":"Dev journal — feat/studio-chapter-triggers (Phase 1 slice 3, owner ruling 三者叠加 complete: budget + task boundary + manual).\n\n• Budget trigger: at every turn end the runner evaluates the Studio working set against min(260K tokens, 0.55 × route context window) using the host's REAL measured usage (estimator values are never trusted for auto-closes). Over budget → the active chapter closes automatically at the turn boundary — the incident session's day-long slide to 530K tokens can no longer happen unattended.\n• Task-boundary trigger (章节 = 任务): task_subtask_accept completing a WHOLE task fires onTaskCompleted through the long-term-task control; the owning conversation's chapter closes at the next turn end when the chapter has substance (≥6 messages — tiny chapters are not worth an LLM card + compaction + cache reset).\n• Shared decision logic is a pure module (studioChapterTriggers.ts) with a 30-min per-session auto-close rate limit so a failed compaction cannot storm retries; busy sessions keep their boundary flags instead of stranding them for the interval.\n\nTests: studioChapterTriggers 6/6 (threshold math incl. 128K-window proportionality, rate limiting, task-boundary priority and thin-chapter fallthrough, estimator rejection, accept-tool wiring); test:studio-context 26+4 green; compile clean. Branch feat/studio-chapter-triggers.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}