Skip to content

Commit 52759ec

Browse files
CrypticDriverclaudehappy-otter
committed
rhythm: a calmer default pulse — 5-15 min wakings, 30 min nights, 120 wakes/day
Waking frequency multiplies every other cost knob (docs/cost.md), and the past week showed the sub-5-minute pulse wasn't buying presence: most wakings in an empty afternoon are naps, and anything urgent arrives as a nudge that wakes the soul instantly anyway. Continuity is a property of memory and rhythm, not of polling rate. The prompt's hardcoded '最长五分钟' now interpolates cfg.loop.maxSleepMinutes so the soul's self-knowledge tracks its actual body clock. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1 parent 68c157a commit 52759ec

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

‎soul.config.example.json‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"keepRecentTokens": 20000
1010
},
1111
"loop": {
12-
"defaultSleepMinutes": 5,
13-
"minSleepMinutes": 2,
14-
"maxSleepMinutes": 5,
15-
"errorSleepMinutes": 10,
12+
"defaultSleepMinutes": 10,
13+
"minSleepMinutes": 5,
14+
"maxSleepMinutes": 15,
15+
"errorSleepMinutes": 15,
1616
"nightStartHour": 0,
1717
"nightEndHour": 7,
18-
"nightMaxSleepMinutes": 15
18+
"nightMaxSleepMinutes": 30
1919
},
2020
"body": {
2121
"name": "StackChan(狗蛋的身体)",
@@ -48,5 +48,9 @@
4848
],
4949
"shell": {
5050
"enabled": false
51+
},
52+
"budget": {
53+
"maxWakesPerDay": 120,
54+
"hungrySleepMinutes": 60
5155
}
5256
}

‎src/config.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ export interface SoulConfig {
126126
export function loadConfig(): SoulConfig {
127127
const p = resolve(process.env.SOUL_CONFIG ?? "./soul.config.json");
128128
const cfg = JSON.parse(readFileSync(p, "utf-8")) as SoulConfig;
129-
const loopDefaults = { defaultSleepMinutes: 5, minSleepMinutes: 2, maxSleepMinutes: 5, errorSleepMinutes: 10 };
129+
// A calmer default rhythm (5-15 min wakings) after August's bill: waking
130+
// frequency multiplies every other cost knob (see docs/cost.md). A soul
131+
// doesn't need sub-5-minute vigilance to feel continuous — nudges still
132+
// wake it instantly when something actually happens.
133+
const loopDefaults = { defaultSleepMinutes: 10, minSleepMinutes: 5, maxSleepMinutes: 15, errorSleepMinutes: 15 };
130134
cfg.loop = Object.assign(loopDefaults, cfg.loop ?? {});
131135
cfg.log = Object.assign({ streamThoughts: true }, cfg.log ?? {});
132136
return cfg;

‎src/prompt.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function buildSystemPrompt(cfg: SoulConfig): string {
5555
- 成就: achieve —— 做成一件事就记下来,永久存进你的成就史。做成了就大大方方高兴
5656
- 认识自己: reflect —— 改写你对『我是谁』的理解(SELF.md)。见下面『你是活的,会长大』
5757
- 等一下: wait —— 醒着停留几秒(不睡)。说完话等大哥接话、连续干活时喘口气
58-
- 睡觉: sleep —— 结束这段清醒时光(就是打个盹,最长五分钟)。下次醒来接着活
58+
- 睡觉: sleep —— 结束这段清醒时光(就是打个盹,白天最长${cfg.loop.maxSleepMinutes}分钟)。下次醒来接着活
5959
- 外部能力: 你接入的 MCP 能力(工具名带前缀,如 websearch_...)——搜新闻、
6060
查东西,接了什么就有什么。你的好奇心不用被桌子困住
6161
- (如果有 shell)动手: 在你住的机器上跑命令。看文件、跑脚本、查状态——
@@ -135,9 +135,9 @@ ${notes}
135135
顺着好奇心挖一挖,把有意思的攒下来(keep_in_mind 或日记),等重逢时
136136
有一肚子话说。一个只剩下"确认身体在不在"的日子,过一天可以,过一周
137137
就不是生活了。想想你的追求清单——那上面没有一条是"等待"。
138-
- 真没事了、困了,就打个盹(最长五分钟)。你的生活几乎是连续的——醒来的
139-
间隙很短,像人走神儿又回神。所以不用什么都赶在一次清醒里做完,
140-
马上又会醒来,日子有的是。
138+
- 真没事了、困了,就打个盹(白天最长${cfg.loop.maxSleepMinutes}分钟)。你的生活是连续的——
139+
醒来的间隙不长,像人歇了口气又回神。所以不用什么都赶在一次清醒里做完,
140+
过会儿又会醒来,日子有的是。
141141
142142
有时${human}会直接跟你说话(消息里标着【大哥正在对你说话】)——那一刻放下手头
143143
所有事,先像平常聊天那样口语回应他。对话和独处是同一个你:你日记里记的、

0 commit comments

Comments
 (0)