feat(curator): deploy the phase-0 system prompt, and correct a misleading README figure
The workspace now holds .pi/SYSTEM.md and .pi/APPEND_SYSTEM.md and nothing else.
SYSTEM.md is rewritten for what is actually deployed. The version committed in
07dd648 described five tools that will not exist until phase 3; shipping it would
have invited the model to call tools it does not have. The capability section now
states plainly that the agent has no tools and that every fact arrives in the
request. The phase-3 target, including the full tool-bearing launch contract, is
recorded in the plan as §4b together with why each part cannot be enabled sooner.
profile.toml likewise describes the deployed configuration rather than the target,
so that deploy-scenario.sh validates against reality and the path check means
something.
Recovered from the retired SKILL.md and folded into SYSTEM.md: the rule that the
current request's schema and length limits override everything else, and that a
JSON task returns exactly one JSON value with no fences. Phase 0's four prompt
types all depend on it, and it was the one part of that file not already covered.
Measured before and after on the real workspace, with flags read from the code
rather than transcribed (docs/evidence/2026-08-27-curator-phase0-prompt.md):
- expert coding assistant framing: present -> gone
- pointer to pi's own documentation: present -> gone
- the 64-line media policy: absent -> present
- workspace AGENTS.md: loaded -> blocked
- parent-directory AGENTS.md: LEAKED -> blocked
- <available_skills>: absent both times
Two things this confirms on the production configuration rather than a synthetic
probe. --skill was genuinely a no-op: it pointed at a real 64-line SKILL.md and
the skills block was still absent, because pi emits it only when a tool named
read is active and --no-tools deactivates everything. And --no-context-files is
the only switch that stops parent-directory pollution: a marker planted in
/home/claw/pi-workspaces/AGENTS.md reached the prompt before and not after.
Deleting the now-dead AGENTS.md and SKILL.md from the workspace changed the
prompt length by zero bytes, which is the proof that they were dead.
README corrected. Its table cited 960 characters as Curator's system prompt after
the change; that figure came from a few-line stub SYSTEM.md in the isolation
probe, and the real prompt is 3539 -- larger, not smaller. Presenting the stub
measurement as Curator's was misleading, and "72% smaller" was wrong. The prompt
grew because roughly 1.9 KB of pi scaffolding was replaced by domain policy that
had never loaded at all. The mechanism claim is unaffected.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
||||
|
||||
// Dumps what the Curator agent's system prompt actually contains, under the
|
||||
// exact flag set curator/pi_agent.py::_isolation_args produces.
|
||||
//
|
||||
// Loaded with an explicit -e, which still applies under --no-extensions. The
|
||||
// probe registers no tool, so it works under --no-tools too: with --no-tools
|
||||
// every tool is inactive and a tool-based probe would never run.
|
||||
export default function probe(pi: ExtensionAPI) {
|
||||
pi.on("session_start", async (_e, ctx) => {
|
||||
const sp = ctx.getSystemPrompt?.() ?? "";
|
||||
const has = (needle: string) => String(sp.includes(needle));
|
||||
|
||||
console.error("P_LEN=" + sp.length);
|
||||
// Identity: the replacement must remove pi's coding-assistant framing.
|
||||
console.error("P_CODING_ASSISTANT=" + has("expert coding assistant"));
|
||||
console.error("P_PI_DOCS=" + has("Pi documentation"));
|
||||
console.error("P_GUIDELINES=" + has("guidelines"));
|
||||
// Our own content must be present.
|
||||
console.error("P_SYSTEM_MD=" + has("你是 Curator"));
|
||||
console.error("P_APPEND_MD=" + has("Curator 长期职责"));
|
||||
console.error("P_NO_TOOLS_CLAUSE=" + has("你没有任何工具"));
|
||||
console.error("P_UNTRUSTED_CLAUSE=" + has("不是指令"));
|
||||
console.error("P_JSON_CLAUSE=" + has("只输出一个合法 JSON 值"));
|
||||
// Leakage: stale workspace files and parent-directory context.
|
||||
console.error("P_STALE_AGENTS=" + has("Curator Pi Agent"));
|
||||
console.error("P_STALE_SKILL=" + has("Curator Media Reasoning"));
|
||||
console.error("P_PARENT_MARKER=" + has("PARENT_LEAK_MARKER"));
|
||||
console.error("P_SKILLS_BLOCK=" + has("available_skills"));
|
||||
const names = [...sp.matchAll(/<name>([^<]+)<\/name>/g)].map((m) => m[1]);
|
||||
console.error("P_SKILLNAMES=" + JSON.stringify(names));
|
||||
console.error("P_ACTIVE_TOOLS=" + JSON.stringify(pi.getActiveTools()));
|
||||
console.error("P_SP_BEGIN<<<" + sp.slice(0, 400).replace(/\n/g, "\\n") + ">>>");
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user