Align pi sandbox context and bootstrap injection

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Harivansh Rathi 2026-03-08 17:41:57 -07:00
parent fb782fa025
commit 59ad12335a
6 changed files with 261 additions and 15 deletions

View file

@ -100,5 +100,35 @@ describe("buildSystemPrompt", () => {
);
expect(prompt).toContain("## /tmp/project/SOUL.md");
});
test("adds companion context guidance for identity, tools, and bootstrap files", () => {
const prompt = buildSystemPrompt({
contextFiles: [
{
path: "/home/node/.pi/workspace/IDENTITY.md",
content: "# Identity\n\nPi",
},
{
path: "/home/node/.pi/workspace/TOOLS.md",
content: "# Tools\n\nUse ~/.pi/apps",
},
{
path: "/home/node/.pi/workspace/BOOTSTRAP.md",
content: "# Bootstrap\n\nDo the setup",
},
],
skills: [],
});
expect(prompt).toContain(
"If IDENTITY.md is present, treat it as the agent's self-description",
);
expect(prompt).toContain(
"If TOOLS.md is present, treat it as the source of truth for the current sandbox filesystem",
);
expect(prompt).toContain(
"If BOOTSTRAP.md is present, treat it as an actionable onboarding task list",
);
});
});
});