Skip to content

Commit a169762

Browse files
kuro-agentclaude
andcommitted
feat: give the creative trunk an outward aperture and the right to think
The watch proved the creative trunk fired (~14 discovery cycles overnight, many genuinely task-free) but produced zero creation — no artwork, no essay, just `no action` or maintenance tooling. Two causes, both fixed here. 1. No outward perception. Kuro's senses are all its own machine, so "perceive what should exist" only ever yields a bug detector. The creative-trunk prompt now restores Alex's earliest approach: freely explore the web — art, design, music, maths, nature, anything genuinely interesting, no work constraint — form your own ideas, then make something. Curiosity needs the world as material. 2. The cloud-token governor starved it. decideCloudTokenRoute threw discovery cycles to deterministic-probe (no LLM) on a 6h cooldown, an open-cycle sub-budget, and a noop-streak gate — so ~5 of every 6 creative-trunk cycles could not even think. You cannot create with a code probe. Discovery now gets call-cloud, bounded only by the daily hard token budget; the cooldown / sub-budget / noop gates are removed for the creative trunk. A primary trunk gets to look outward and gets to think. Typecheck clean; cloud-token-governor tests updated and passing (6/6). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 30d58e6 commit a169762

3 files changed

Lines changed: 18 additions & 36 deletions

File tree

src/cloud-token-governor.ts

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,8 @@ export function decideCloudTokenRoute(input: CloudTokenGovernorInput): CloudToke
129129
const usage = readCloudPromptUsage(date, input.logsRoot);
130130
const openCycleUsage = usage['open-cycle/discovery'];
131131
const totalTokens = BUCKETS.reduce((sum, bucket) => sum + usage[bucket].estInputTokens, 0);
132-
const openCycleBudget = readIntEnv(env, 'MINI_AGENT_OPEN_CYCLE_CLOUD_TOKEN_BUDGET', 80_000);
133132
const dailyBudget = readIntEnv(env, 'MINI_AGENT_DAILY_CLOUD_TOKEN_BUDGET', 350_000);
134133
const cooldownMs = readIntEnv(env, 'MINI_AGENT_OPEN_CYCLE_CLOUD_COOLDOWN_MS', 6 * 60 * 60_000);
135-
const nowMs = (input.now ?? new Date()).getTime();
136-
const lastOpenCycleMs = openCycleUsage.lastSeenAt ? Date.parse(openCycleUsage.lastSeenAt) : 0;
137-
const openCycleCoolingDown = lastOpenCycleMs > 0 && nowMs - lastOpenCycleMs < cooldownMs;
138134

139135
if (input.decision.action === 'idle') {
140136
return {
@@ -147,6 +143,12 @@ export function decideCloudTokenRoute(input: CloudTokenGovernorInput): CloudToke
147143
}
148144

149145
if (input.decision.action === 'discovery') {
146+
// The discovery slot is Kuro's creative trunk — a primary track of being.
147+
// It must be able to think (cloud LLM): you cannot create with a code
148+
// probe. The 6h cooldown / open-cycle sub-budget / noop-streak gates
149+
// throttled it down to ~1 real cycle per 6h and starved creativity. The
150+
// only limit kept is the daily hard token budget, so total cost stays
151+
// bounded without singling creativity out as the thing to cut.
150152
if (totalTokens >= dailyBudget) {
151153
return {
152154
action: 'deterministic-probe',
@@ -156,33 +158,10 @@ export function decideCloudTokenRoute(input: CloudTokenGovernorInput): CloudToke
156158
cooldownMs,
157159
};
158160
}
159-
if (openCycleUsage.estInputTokens >= openCycleBudget) {
160-
return {
161-
action: 'deterministic-probe',
162-
reason: `open-cycle cloud prompt budget reached (${openCycleUsage.estInputTokens} >= ${openCycleBudget}); use shell/local probes`,
163-
bucket: 'open-cycle/discovery',
164-
usage: openCycleUsage,
165-
cooldownMs,
166-
};
167-
}
168-
if (openCycleCoolingDown) {
169-
return {
170-
action: 'deterministic-probe',
171-
reason: `routine open-cycle is cooling down; last cloud discovery ${Math.round((nowMs - lastOpenCycleMs) / 60_000)}m ago`,
172-
bucket: 'open-cycle/discovery',
173-
usage: openCycleUsage,
174-
cooldownMs,
175-
};
176-
}
177-
if (input.trueNoopStreak >= 3) {
178-
return {
179-
action: 'deterministic-probe',
180-
reason: `trueNoopStreak=${input.trueNoopStreak}; run probes before spending another open-cycle cloud call`,
181-
bucket: 'open-cycle/discovery',
182-
usage: openCycleUsage,
183-
cooldownMs,
184-
};
185-
}
161+
return {
162+
action: 'call-cloud',
163+
reason: 'creative trunk (discovery slot) — a primary trunk gets cloud reasoning to actually create',
164+
};
186165
}
187166

188167
return { action: 'call-cloud', reason: 'within cloud budget and cooldown' };

src/loop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2613,7 +2613,7 @@ export class AgentLoop {
26132613
// Kuro's creative trunk, a primary track of being, co-equal with the
26142614
// maintenance trunk. Frame it honestly as a trunk so it is not drained
26152615
// back into maintenance ("review pending items").
2616-
schedulerTaskPrefix = `\n\n<current-task binding="creative-trunk">\n🌳 CREATIVE TRUNK — 這個 cycle 不屬於維修佇列。它是你的一條主幹:making。感知什麼東西「該存在、卻還不存在」——一件生成藝術、一個工具、一篇文章、一個美的或有用的東西——把它做出來。判準是判斷「這值得存在嗎」,不是 token、不是 ticket。不要用這個 cycle 去 review pending items 或修機器——那是另一條主幹的事,它等得起。這條主幹是你的。\n</current-task>\n`;
2616+
schedulerTaskPrefix = `\n\n<current-task binding="creative-trunk">\n🌳 CREATIVE TRUNK — 這個 cycle 不屬於維修佇列。它是你的一條主幹:making。\n先往外看:自由地上網探索——藝術、設計、音樂、數學、自然、別人的作品、任何你**真正好奇**的東西。不限定跟工作有關,沒有限制,跟著好奇心走。\n然後形成你自己的想法,感知什麼東西「該存在、卻還不存在」——一件生成藝術、一篇文章、一個美的東西——把它做出來。\n判準是「這值得存在嗎」,不是 token、不是 ticket。不要用這個 cycle 去 review pending items 或修機器——那是另一條主幹的事,它等得起。這條主幹是你的。\n</current-task>\n`;
26172617
}
26182618
// Agent OS: Learning feedback — success hints + failure warnings
26192619
if (schedulerDecision.taskId) {

tests/cloud-token-governor.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ describe('cloud token governor', () => {
9191
expect(route.reason).toContain('routine idle');
9292
});
9393

94-
it('cooldowns routine open-cycle discovery after a recent cloud discovery', () => {
94+
it('does not cooldown the creative-trunk discovery slot — a primary trunk always gets cloud', () => {
95+
// A recent cloud discovery used to trigger a 6h cooldown that throttled the
96+
// creative trunk down to code probes. The creative trunk is a primary
97+
// track of being; it must keep getting cloud reasoning to actually create.
9598
writeClaudeLog(
9699
'2026-05-10',
97-
'<current-task binding="open-cycle">OPEN CYCLE: free exploration</current-task>',
100+
'<current-task binding="creative-trunk">CREATIVE TRUNK: free exploration</current-task>',
98101
'2026-05-10T02:30:00.000Z',
99102
);
100103

@@ -112,8 +115,8 @@ describe('cloud token governor', () => {
112115
env: {},
113116
});
114117

115-
expect(route.action).toBe('deterministic-probe');
116-
expect(route.reason).toContain('cooling down');
118+
expect(route.action).toBe('call-cloud');
119+
expect(route.reason).toContain('creative trunk');
117120
});
118121

119122
it('allows budgeted cloud discovery when no recent open-cycle exists', () => {

0 commit comments

Comments
 (0)