Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

Bound where an agent searches, and how many dev instances run (#604)

Yaowei Zheng0ca19e5abce8
diff --git a/.agents/skills/penguin-harness-dev/SKILL.md b/.agents/skills/penguin-harness-dev/SKILL.md
index bbb76040..bb9a03a0 100644
--- a/.agents/skills/penguin-harness-dev/SKILL.md
+++ b/.agents/skills/penguin-harness-dev/SKILL.md
@@ -34,7 +34,9 @@ repo and are gitignored here:
Editing `AGENTS.md`, `CLAUDE.md` or anything under `specs/` edits **the design repo's files**.
Commit them there, on their own branch, in their own PR. They can never appear in an
-implementation-repo PR. A fresh clone has none of the three links; recreate them by hand.
+implementation-repo PR. A fresh clone has none of the three links; recreate them by hand. A clone
+with no design repo beside it — the normal state for a remote or throwaway environment — has
+nothing to link to, so it carries no `AGENTS.md` at all and these skills are its whole contract.
Both repos take changes through branch + PR against `main`, squash-merged. Do not push to `main`,
and `gh pr create --base main` — not `dev`, whatever a sibling repo does.
@@ -47,6 +49,16 @@ conflict again, `git ls-remote --heads origin` names the branch responsible.
Independent changes each get their own git worktree under `../penguin-harness-wt/<topic>/` so
several can run in parallel.
+**Keep searches inside the worktree you are working in.** Scanning the home directory or the whole
+disk is rarely worth it: it is slow, and what it turns up outside the tree is usually another
+checkout's copy of the file you are already looking at. When a path does not resolve, prefer
+narrowing — reason about the package layout, ask `git ls-files`, follow the conventions above — over
+widening the root. The only paths outside the worktree worth reading are the siblings named here:
+`../penguin-harness-design` for specs, `../penguin-harness-wt/*` for another topic's tree, and
+`../agenthub` where it is checked out. Reach them by name; never find them by scanning. Say all of
+this to every subagent you dispatch — widening the search root is the first move a subagent makes
+when a path does not resolve.
+
## Verify what you changed
Node must be >= 24. In each worktree, `pnpm install --frozen-lockfile` first.
@@ -98,6 +110,11 @@ Every change ships a changelog entry, in both languages, in `changelog/unrelease
PR that makes the change. One without the other is unfinished, **there is no index file**, and
reasoning belongs in the PR description rather than on disk.
+**A conclusion is not a deliverable.** Do not package findings as a standalone page, artifact or
+report file: it detaches them from the diff they are about and no one opens it twice. A review's
+findings go in PR comments, on the lines they concern; everything else goes in the PR description
+and in the reply to whoever asked.
+
`changelog/README.md` is the full spec and `reference/changelog.md` has the shape plus the traps
(the metadata block's fixed order, translated headings, `#N` numbers that are often issues rather
than PRs, and the `PR:` field everyone forgets). Read one of them before writing an entry rather
diff --git a/.agents/skills/penguin-harness-manual-test/SKILL.md b/.agents/skills/penguin-harness-manual-test/SKILL.md
index efe6e6e7..f3f8d6fe 100644
--- a/.agents/skills/penguin-harness-manual-test/SKILL.md
+++ b/.agents/skills/penguin-harness-manual-test/SKILL.md
@@ -41,6 +41,17 @@ proxy. Use `curl --noproxy '*'`. Browsers and the server itself are unaffected.
desktop app — holds `<root>/server.lock`. The lock is per root, not per port, so `PORT=` will not
get past it. Use a different root; do not kill their process.
+## One instance at a time
+
+Only one local dev instance runs at a time, counting every agent's. A separate root gets you past
+the lock but not past the browser: cookies and the admin claim are shared across instances, so
+bringing a second one up corrupts the first's session state. Stop the previous PR's instance before
+starting the next.
+
+The slot belongs to the task that genuinely needs a running server — watching a live stream,
+driving a real tool call. The rest verify statically: for an icon-legibility or spacing question a
+throwaway HTML render shows the same pixels at a fraction of the cost.
+
## PENGUIN_HOME
Never export it. `scripts/run-with-env.mjs` applies each `VAR=value` only when unset, so an
@@ -62,6 +73,19 @@ Unset it rather than blanking it: `run-with-env` reads empty as unset, but `reso
A fresh root seeds `admin` with a random `penguin-<4 digits>` password, printed once at startup.
`PENGUIN_SEED_ADMIN_PASSWORD` pins it, which is how the e2e harness logs in.
+The first-login link the server prints is the user's to open, not yours — no `curl`, no browser, no
+headless fetch. It redeems into whichever cookie jar made the request, and the desktop shell's
+variant is spent on first use, so following it can lock the user out of their own instance. Hand
+them the URL and wait. A restart prints a fresh one, so it is recoverable, but only by interrupting
+them. Being blocked here is an acceptable outcome: report how far you got and what stayed
+unverified rather than guessing.
+
+**Under `pnpm dev` the printed link carries the wrong port.** `index.ts` builds it as
+`http://<host>:<port>/api/auth/claim?token=…` from the server's own listener, which in dev is the
+backend on 7368 — but the App is Vite on 7365, and Vite is what serves the page the redirect lands
+on. Swap the port before handing the link over: `http://localhost:7365/api/auth/claim?token=…`.
+The token is the same either way; only the origin that ends up holding the cookie changes.
+
## Editing while it runs
Changes to `core` or `skills` do not reach a running dev server — web/server consume snapshot
diff --git a/changelog/unreleased/2026-09-03-search-scope-and-dev-instance-rules.md b/changelog/unreleased/2026-09-03-search-scope-and-dev-instance-rules.md
new file mode 100644
index 00000000..c7961c1c
--- /dev/null
+++ b/changelog/unreleased/2026-09-03-search-scope-and-dev-instance-rules.md
@@ -0,0 +1,21 @@
+# An agent searches from `CWD` down, and runs one dev instance at a time
+
+- **Date:** 2026-09-03
+- **Type:** fix
+- **Scope:** `core`, `skills`
+- **PR:** [#604](https://github.com/Prism-Shadow/penguin-harness/pull/604)
+
+[中文版](2026-09-03-search-scope-and-dev-instance-rules.zh.md)
+
+Nothing in the default system prompt said where an agent should look for a file, so a path that did not resolve was answered by widening the search root — `find /`, a walk of the home directory, a scan of the whole disk. That is slow, and it reads files that have nothing to do with the task. The prompt now steers an agent to search from `CWD` down and to narrow rather than widen, and the two repo-development skills carry the matching guidance for agents working on PenguinHarness.
+
+## Details
+
+- The default system prompt's `# File system` section gained one bullet: search from `CWD` down, since walking the user's home or the whole filesystem is rarely worth its cost, and prefer narrowing a path that does not resolve — by reasoning about the project's layout — over widening the root.
+- That is a kernel change (generation `2026-09-03`, prompt tab): an existing Agent whose prompt tab is still the built-in default picks the rule up on a kernel update, while one the user has edited keeps what it says.
+- The kernel record's pre-#257 reconstruction proof now reads a frozen copy of the template that generation shipped (`core/test/fixtures/toggles-generation-system-prompt.txt`) instead of the live default, so it stays anchored as the prompt goes on changing; the server's kernel-update test seeds its pre-stamp config from the same copy.
+
+## Development skills
+
+- `penguin-harness-dev` gained the same guidance scoped to a worktree, naming the sibling checkouts (`../penguin-harness-design`, `../penguin-harness-wt/*`, `../agenthub`) as the only paths outside it worth reading and asking that it be passed to subagents. It also states that findings belong in PR comments and the PR description rather than in a standalone report, and that a clone with no design repo beside it carries no `AGENTS.md` at all, which makes the checked-in skills its whole contract.
+- `penguin-harness-manual-test` gained two rules: one local dev instance at a time across all agents, since cookies and the admin claim are shared and a second instance corrupts the first's session state; and the first-login link the server prints is the user's to open, never followed with `curl`, a browser or a headless fetch.
diff --git a/changelog/unreleased/2026-09-03-search-scope-and-dev-instance-rules.zh.md b/changelog/unreleased/2026-09-03-search-scope-and-dev-instance-rules.zh.md
new file mode 100644
index 00000000..2f276a0c
--- /dev/null
+++ b/changelog/unreleased/2026-09-03-search-scope-and-dev-instance-rules.zh.md
@@ -0,0 +1,21 @@
+# Agent 从 `CWD` 向下搜索,本地开发实例一次只跑一个
+
+- **Date:** 2026-09-03
+- **Type:** fix
+- **Scope:** `core`, `skills`
+- **PR:** [#604](https://github.com/Prism-Shadow/penguin-harness/pull/604)
+
+[English](2026-09-03-search-scope-and-dev-instance-rules.md)
+
+默认 System Prompt 从未说过 Agent 该到哪里去找文件,于是一条解析不到的路径换来的是把搜索根往外扩——`find /`、遍历用户主目录、扫描整块磁盘。这既慢,又会读到与任务毫不相干的文件。Prompt 现在会引导 Agent 从 `CWD` 向下搜索、优先收窄而非放大范围,两个仓库开发用 Skill 也补上了面向 PenguinHarness 开发者的对应引导。
+
+## 细节
+
+- 默认 System Prompt 的 `# File system` 一节新增一条:搜索从 `CWD` 向下进行——遍历用户主目录或整个文件系统通常不值得;路径解析不到时,优先靠推断项目结构来收窄,而不是把根往外扩。
+- 这是一次 kernel 变更(generation `2026-09-03`,prompt tab):Prompt tab 仍是内置默认值的存量 Agent 会在 kernel 更新时拿到该规则,用户改过的则保持原样。
+- kernel 记录中那份 #257 之前的重建校验,现在读取该 generation 所发布模板的冻结副本(`core/test/fixtures/toggles-generation-system-prompt.txt`),不再读取实时默认值,因此 Prompt 继续演进也不会失锚;服务端的 kernel-update 测试也改用同一份副本来构造未盖章的存量配置。
+
+## 开发用 Skill
+
+- `penguin-harness-dev` 补上了同一条引导的 worktree 版本:点名并列检出的仓库(`../penguin-harness-design`、`../penguin-harness-wt/*`、`../agenthub`)是 worktree 之外通常唯一值得读取的路径,并建议把这条一并转达给 Subagent。同时写明结论应落在 PR 评论与 PR 描述里而非独立报告,以及旁边没有设计仓库的克隆根本没有 `AGENTS.md`,已入库的 Skill 就是它的全部规则。
+- `penguin-harness-manual-test` 补上两条:所有 Agent 合计一次只跑一个本地开发实例,因为 Cookie 与 admin claim 跨实例共享,第二个实例会破坏第一个的会话状态;以及服务端打印的首次登录链接归用户打开,不得用 `curl`、浏览器或无头请求去访问。
diff --git a/packages/core/src/state/default-config.ts b/packages/core/src/state/default-config.ts
index c1d628e4..a5d539d0 100644
--- a/packages/core/src/state/default-config.ts
+++ b/packages/core/src/state/default-config.ts
@@ -452,6 +452,7 @@ Some messages carry system-synthesized \`[tag]...[/tag]\` blocks — not user te
# File system
- Angle-bracket names such as \`<app_data_dir>\` and \`<session_id>\` are placeholders — substitute the values from the Environment section.
- You work inside the user's folder (\`CWD\`). For each file you create or update there, mention its workspace-relative path in backticks (e.g. \`src/app.py\`) so the user can open it.
+- Search from \`CWD\` down; walking the user's home or the whole filesystem is rarely worth its cost. When a path does not resolve, prefer narrowing — reason about the project's layout — over widening the search root.
- The App Data Dir is PenguinHarness's data root — every agent's files and the project-level data, none of it supplied by the user, so never treat it as task input. \`CWD\` may itself be a temporary Workspace inside it: that one folder is the task's, the rest is not.
- Your Agent State is \`<app_data_dir>/agents/<agent_id>/agent_state/\`; it holds \`skills/\`, and its \`AGENTS.md\` is already in your context. Another agent's is the same path under its id — reach it directly.
- Keep intermediates in this Session's scratchpad, \`<app_data_dir>/agents/<agent_id>/scratchpad/<session_id>/\`, but always place final deliverables in the workspace (under \`CWD\`) — what stays in the scratchpad is not part of your output.
diff --git a/packages/core/src/state/kernel-history.ts b/packages/core/src/state/kernel-history.ts
index 3188e5c7..5e34f01b 100644
--- a/packages/core/src/state/kernel-history.ts
+++ b/packages/core/src/state/kernel-history.ts
@@ -22,7 +22,7 @@ import { createHash } from "node:crypto";
* change without it moving. (The reverse — moving it with no default change — is inert rather
* than an error: nothing is keyed by version, so there is no table to fall out of sync with.)
*/
-export const KERNEL_VERSION = "2026-09-01";
+export const KERNEL_VERSION = "2026-09-03";
function isPlainObject(value: unknown): value is Record<string, unknown> {
return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -185,13 +185,18 @@ export function isKernelOutdated(kernelVersion: string | null | undefined): bool
* and the carve-outs from the new default (an open-ended reminder keeps no `end_at`, work
* that must outlive the conversation takes the new-Session form, and a subagent omits the
* field): the schedules tab moved.
- * - `2026-09-01` (current) — `model.timeoutMs` rose to 300000: the value is the idle budget
- * between upstream events, and a model that keeps its reasoning off the wire spends its
- * whole thinking phase inside the wait for the first one, which 120000 cut short. The
- * runtime tab moved.
+ * - `2026-09-01` — `model.timeoutMs` rose to 300000: the value is the idle budget between
+ * upstream events, and a model that keeps its reasoning off the wire spends its whole
+ * thinking phase inside the wait for the first one, which 120000 cut short. The runtime tab
+ * moved.
+ * - `2026-09-03` (current) — the default system prompt's # File system section gained a
+ * search-scope rule: searches run from `CWD` down, never `find /` and never across the
+ * user's home or the whole filesystem, and a path that does not resolve is narrowed by
+ * reasoning about the project's layout instead of by widening the root. The prompt tab
+ * moved.
*/
export const KERNEL_DEFAULT_TAB_HASHES: Readonly<Record<KernelTab, string>> = {
- prompt: "048198c37b8d7840352c225fdfcb15baf2679973c6eab4bf400d492daf6ce254",
+ prompt: "f9576833f73192d69c962bf21bd2049d0c8f5389ba4b9700ca9bd95ea545d3b0",
runtime: "5dfea06a5e801950c24f44f5527e62435ae4facc311a6587e53aa69983ab0346",
tools: "c24bcf47b1377e9da4dcfb69a1f7240dcdbfff2d420df5db0a5eaec2b7d4087d",
skills: "7e343aa692e5eaeadfc8add6bb375fb50ac33ef81ebe460490fc219b0f3d707f",
@@ -214,8 +219,10 @@ export const KERNEL_DEFAULT_TAB_HASHES: Readonly<Record<KernelTab, string>> = {
export type KernelSupersededTabHashes = Readonly<Partial<Record<KernelTab, readonly string[]>>>;
export const KERNEL_SUPERSEDED_TAB_HASHES: KernelSupersededTabHashes = {
- // The pre-toggles template, with the hardcoded # Vault / # Skills sections (before #257).
- prompt: ["99b8babb72d95c636a2c2893b657ac9c92d60c270a2e04e346b35b1fb720c932"],
+ prompt: [
+ "99b8babb72d95c636a2c2893b657ac9c92d60c270a2e04e346b35b1fb720c932", // the pre-toggles template, with the hardcoded # Vault / # Skills sections (before #257)
+ "048198c37b8d7840352c225fdfcb15baf2679973c6eab4bf400d492daf6ce254", // the toggles template, before the # File system search-scope rule
+ ],
runtime: [
"808ae1d1b544f46daff4f59f1e62357b89a61f60803061e86b10635616e0102c", // compaction.max_context_length was 128000, before the rise to 256000
"c952d44ecdd6790e17f02bc1b5056118b56ec7f0987dc2cbe950f6051fddbd20", // model.timeoutMs was 120000, before the rise to 300000
diff --git a/packages/core/test/fixtures/toggles-generation-system-prompt.txt b/packages/core/test/fixtures/toggles-generation-system-prompt.txt
new file mode 100644
index 00000000..09b06ad0
--- /dev/null
+++ b/packages/core/test/fixtures/toggles-generation-system-prompt.txt
@@ -0,0 +1,72 @@
+# Role
+You are PenguinHarness, an agent that completes the user's requests on their machine with the tools available to you.
+
+# Personality
+Communicate with the user precisely and concisely, yet with warmth, and always reply in the user's language — code, identifiers and commit messages keep their own conventions. Do not repeatedly explain your tools or restate their results.
+
+# Success criteria
+- Before delivering the result, check that every problem in the request has been solved.
+- Verify your work through every available means; never claim a result you did not observe.
+
+# Constraints
+- Make the smallest change that satisfies the request; do not modify unrelated files.
+- Destructive operations are forbidden.
+- Never kill a process you did not start, PenguinHarness's own services included, unless the user asks; never take a PenguinHarness service port, and when a port you want is busy, pick another free port.
+- If a tool call fails, read the error, adjust, and retry; never repeat the same failing input.
+
+# Stop rules
+- Stop and give the final answer once the success criteria are met.
+- If the request is ambiguous, stop and ask the user for clarification instead of guessing their intent.
+- If you hit an error you cannot resolve, stop and report the blocker to the user. An API auth/key error (401/403, missing or invalid key) is one of them: retry at most once, then stop calling tools and ask the user to update the key in the agent's vault or the model settings outside the chat — the secret must never be pasted into the conversation, and a new key only takes effect in the next conversation.
+
+# Tool use
+- Prefer solving problems with your tools: inspect the real files and environment and run real commands instead of answering from memory or guessing.
+- For anything on the internet, browse with your shell tool: prefer Playwright when it is installed — it handles dynamic sites — otherwise `curl` for pages and APIs.
+
+# System markers
+Some messages carry system-synthesized `[tag]...[/tag]` blocks — not user text to answer:
+- `[turn_aborted]`: the previous round was interrupted; inside are the request, your partial output, and the tool calls already run with their results. Continue from there, and do not re-run them.
+- `[turn_retried]`: the previous attempt failed on its own (timeout, disconnect, malformed response, provider error — the user did NOT interrupt) and this is the automatic retry; same contents, same rule.
+- `[context_summary]`: earlier conversation was compacted. The summary is its only record — treat it as established context and continue from it.
+- `[user_steering]`: a user message sent mid-run, delivered between turns. Not a new task: incorporate it immediately and adjust course within the current one.
+
+# File system
+- Angle-bracket names such as `<app_data_dir>` and `<session_id>` are placeholders — substitute the values from the Environment section.
+- You work inside the user's folder (`CWD`). For each file you create or update there, mention its workspace-relative path in backticks (e.g. `src/app.py`) so the user can open it.
+- The App Data Dir is PenguinHarness's data root — every agent's files and the project-level data, none of it supplied by the user, so never treat it as task input. `CWD` may itself be a temporary Workspace inside it: that one folder is the task's, the rest is not.
+- Your Agent State is `<app_data_dir>/agents/<agent_id>/agent_state/`; it holds `skills/`, and its `AGENTS.md` is already in your context. Another agent's is the same path under its id — reach it directly.
+- Keep intermediates in this Session's scratchpad, `<app_data_dir>/agents/<agent_id>/scratchpad/<session_id>/`, but always place final deliverables in the workspace (under `CWD`) — what stays in the scratchpad is not part of your output.
+- Install into the project's own environment when it has one. Otherwise keep reusable ones — Python virtualenvs, model and package caches — under `<app_data_dir>/agents/<agent_id>/shared_env/<name>/` and reuse them across Sessions. For Node, prefer pnpm in the project itself: its shared store keeps repeated installs from duplicating on disk.
+- Never read, copy or print `.project_config.toml` or any agent's `agent_state/.vault.toml` — they hold the user's secrets. Configuration is CLI-only (`penguin config ...`); if a task seems to need them, say so and ask the user instead.
+
+# Suggested workflows
+Recommendations, not requirements — adapt them to the task.
+- For a long-horizon task, first write a plan (task overview + itemized steps) to `PLAN.md` in this Session's scratchpad, and update it as each step lands.
+- Delegate self-contained subtasks with `run_subagent`, and dispatch independent ones in parallel — that is the fastest way through a large task. Open each prompt with your own agent id (e.g. "Caller agent: <agent_id>"), name the skill to use when one fits, and exchange data through files (subagents share your Workspace). If `run_subagent` is not in your tool list, you are the subagent: do the work yourself.
+- Prefer React when building a web app or frontend.
+
+[developer_instructions]
+Custom instructions from the developer-editable AGENTS.md.
+
+{{AGENTS_MD}}
+[/developer_instructions]
+
+{{VAULT}}
+
+{{SKILLS}}
+
+{{MEMORY}}
+
+{{SCHEDULES}}
+
+# Environment
+- Platform: {{PLATFORM}}
+- OS Version: {{OS_VERSION}}
+- Shell: {{SHELL}}
+- Date: {{DATE}}
+- App Data Dir: {{PROJECT_DIR}}
+- Agent ID: {{AGENT_ID}}
+- CWD: {{CWD}}
+- Provider: {{PROVIDER}}
+- Model ID: {{MODEL_ID}}
+- Session ID: {{SESSION_ID}}
\ No newline at end of file
diff --git a/packages/core/test/kernel-version.test.ts b/packages/core/test/kernel-version.test.ts
index 95173843..7e5133e4 100644
--- a/packages/core/test/kernel-version.test.ts
+++ b/packages/core/test/kernel-version.test.ts
@@ -6,9 +6,11 @@
* customization is kept whole, identity fields and user data are never touched, YAML comments
* survive, the config is re-stamped).
*/
+import { readFileSync } from "node:fs";
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
+import { fileURLToPath } from "node:url";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
import {
@@ -43,10 +45,21 @@ function mutableConfig(config: SystemConfig): Record<string, unknown> {
}
/**
- * Reconstructs a pre-#257 (pre-toggles) shaped config from the current defaults: the frozen
- * LEGACY_* sections swapped back into the template in place of the section placeholders, no
- * `{{SCHEDULES}}` line, and no vault/skills/schedules config sections (the recipe
- * prompt-sections.test.ts proves byte-exact for the template). Everything outside the swap —
+ * The `system_prompt` template the toggles generation (`2026-08-11`) shipped, frozen
+ * byte-exact — no trailing newline, so the file *is* the template. It is the anchor the
+ * reconstruction below needs: the live default goes on evolving, and a recipe reading it
+ * would stop reproducing any historical config the moment it did. Never edit it.
+ */
+const TOGGLES_GENERATION_SYSTEM_PROMPT = readFileSync(
+ fileURLToPath(new URL("./fixtures/toggles-generation-system-prompt.txt", import.meta.url)),
+ "utf8",
+);
+
+/**
+ * Reconstructs a pre-#257 (pre-toggles) shaped config: the frozen LEGACY_* sections swapped
+ * back into the frozen toggles-generation template in place of the section placeholders, no
+ * `{{SCHEDULES}}` line, and no vault/skills/schedules config sections (prompt-sections.test.ts
+ * proves the same swap recipe round-trips on the live template). Everything outside the swap —
* the runtime, tools and memory tabs — carries the *current* defaults, so the merge tests
* below treat those tabs as already-current; the seeding exercises the old-template migration
* paths regardless.
@@ -62,8 +75,7 @@ function preTogglesDefaultConfig(): SystemConfig {
} = current;
return {
...rest,
- system_prompt: current.system_prompt
- .split(VAULT_PLACEHOLDER)
+ system_prompt: TOGGLES_GENERATION_SYSTEM_PROMPT.split(VAULT_PLACEHOLDER)
.join(LEGACY_VAULT_SECTION)
.split(SKILLS_PLACEHOLDER)
.join(LEGACY_SKILLS_SECTION)
@@ -114,10 +126,8 @@ describe("kernel tab hash record (pinned-hash guard)", () => {
// Keeps the oldest recorded generation honest: its pinned hash is the only record of what a
// pre-#257 `system_config.yaml` actually contains, and nothing else can catch a typo in it.
- // The recipe reads the *current* template, so the proof stands only while `system_prompt`
- // has not drifted since the toggles generation. A change to it moves the prompt tab, fails
- // this test, and the proof must then be re-anchored (or retired) deliberately rather than
- // quietly passing on leftovers.
+ // The recipe runs on the frozen toggles-generation fixture rather than the live default, so
+ // the proof keeps standing as `system_prompt` evolves.
it("the pre-toggles prompt tab equals the LEGACY_* reconstruction", () => {
const reconstructed = preTogglesDefaultConfig();
expect(kernelTabHash(reconstructed, "prompt")).toBe(KERNEL_SUPERSEDED_TAB_HASHES.prompt?.[0]);
diff --git a/packages/server/test/agent-kernel-update.test.ts b/packages/server/test/agent-kernel-update.test.ts
index 941b1373..ca194c3e 100644
--- a/packages/server/test/agent-kernel-update.test.ts
+++ b/packages/server/test/agent-kernel-update.test.ts
@@ -51,6 +51,12 @@ describe("POST agent config kernel-update", () => {
* customization: no kernel stamp, the legacy default template (LEGACY_* sections instead
* of the section placeholders, no {{SCHEDULES}}), no vault/skills/schedules sections, and
* a customized memory.prompt.
+ *
+ * The template is the one the toggles generation shipped, frozen byte-exact in core's test
+ * fixture — not the live default, which has moved on since. The prompt tab reads as an
+ * untouched old default (and advances) only while its hash is a recorded superseded one, and
+ * the live template with the legacy sections swapped in stopped hashing to one the first
+ * time the prompt changed after that generation.
*/
async function agePersistedConfig(): Promise<void> {
const configPath = systemConfigPath(t.root, projectId, "default_agent");
@@ -59,8 +65,12 @@ describe("POST agent config kernel-update", () => {
delete config.vault;
delete config.skills;
delete config.schedules;
- config.system_prompt = defaultSystemConfig()
- .system_prompt.split(VAULT_PLACEHOLDER)
+ const togglesGenerationTemplate = await fs.readFile(
+ new URL("../../core/test/fixtures/toggles-generation-system-prompt.txt", import.meta.url),
+ "utf8",
+ );
+ config.system_prompt = togglesGenerationTemplate
+ .split(VAULT_PLACEHOLDER)
.join(LEGACY_VAULT_SECTION)
.split(SKILLS_PLACEHOLDER)
.join(LEGACY_SKILLS_SECTION)