You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return`Context at ${pct}% — deep in the degraded zone. Compaction may trigger soon
21
-
(emergency summarization at ~90%). Prefer a deliberate handoff now: save
22
-
reusable state to the ledger, draft a clear next-task brief, and call handoff.`;
20
+
if(boundary){
21
+
return`Notebook topic changed from ${boundary.from??"(unset)"} to ${boundary.to}.
22
+
Treat this as a strong task-boundary signal. Prefer a deliberate handoff before
23
+
continuing under the new topic: save durable findings to the notebook, draft a
24
+
concise situational brief, and call handoff. Only continue inline if this was
25
+
merely a rename rather than a real pivot.`;
23
26
}
24
27
25
-
if(pct>=50){
26
-
return`Context at ${pct}% — well past the primacy-zone heuristic. If the current job is
27
-
done or the context is noisy, consider a handoff soon. Save reusable state to
28
-
the ledger and draft a concise but sufficiently detailed brief for what comes
29
-
next.`;
28
+
constcontextLead=pct===null
29
+
? "Topic-aware context reminder."
30
+
: pct>=70
31
+
? `Context at ${pct}% — topic discipline is urgent.`
32
+
: pct>=50
33
+
? `Context at ${pct}% — topic discipline matters now.`
34
+
: `Context at ${pct}% — choose your next step by topic fit.`;
35
+
36
+
if(topic){
37
+
consturgency=pct!==null&&pct>=70
38
+
? "If the work no longer fits this topic, prefer a deliberate handoff now. If it still fits and only a focused noisy branch is needed, spawn it instead of polluting the parent context."
39
+
: "If the current work still fits this topic, prefer spawn for isolated noisy subtasks. If it no longer fits, prefer handoff instead of dragging stale context forward.";
40
+
return`${contextLead}
41
+
Active notebook topic: ${topic}.
42
+
Use the topic as the current semantic frame. ${urgency}
43
+
Save durable findings to the notebook before handoff.`;
30
44
}
31
45
32
-
// 30-50%
33
-
return`Context at ${pct}% — past the primacy-zone heuristic. One context, one job.
34
-
If you're mid-job and still clear, continue. If the current phase is complete
35
-
or the context is noisy, consider a handoff and draft a clear brief for what
36
-
comes next.`;
46
+
constnoTopicUrgency=pct!==null&&pct>=70
47
+
? "Assign a fresh topic in the next clean context after handoff."
48
+
: "Assign a short stable topic soon. If the work stays within that topic, prefer spawn for noisy subtasks. If the work shifts beyond it, prefer handoff.";
49
+
return`${contextLead}
50
+
No active notebook topic is set. ${noTopicUrgency}`;
0 commit comments