mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
Merge origin/main into worktree-1
This commit is contained in:
@@ -27,6 +27,27 @@ test("all package extensions load together without global registration conflicts
|
||||
packageJson.pi.extensions.includes("./pi-extension-codex-fast-mode/index.ts"),
|
||||
"the bundle must load the locally maintained Codex Fast mode extension",
|
||||
);
|
||||
assert.ok(packageJson.pi.extensions.includes("./pi-ssh/index.ts"), "the bundle must load the locally maintained SSH extension");
|
||||
assert.equal(packageJson.dependencies["pi-ssh"], "file:./pi-ssh");
|
||||
assert.equal(packageJson.dependencies.ssh2, "1.17.0", "the packed bundle must install pi-ssh's runtime transport");
|
||||
assert.equal(packageJson.dependencies.jiti, "2.7.0", "the packed helper must load local TypeScript outside Pi");
|
||||
assert.ok(packageJson.files.includes("pi-ssh"), "the packed bundle must include the locally maintained SSH source");
|
||||
assert.ok(packageJson.files.includes("ssh_config.sh"), "the packed bundle must include the SSH host import helper");
|
||||
const permissionConfig = JSON.parse(
|
||||
await readFile(join(repositoryRoot, "config", "pi-permission-system.json"), "utf8"),
|
||||
) as { authorizerChain: string[]; permission: Record<string, unknown> };
|
||||
assert.equal(permissionConfig.permission.ssh_connect, "ask", "SSH connection must enter the permission gate");
|
||||
assert.deepEqual(permissionConfig.authorizerChain, ["auto-review"], "SSH connection asks must reach AutoReview");
|
||||
assert.ok(
|
||||
packageJson.pi.extensions.indexOf("./extensions/permission-system.ts") <
|
||||
packageJson.pi.extensions.indexOf("./pi-ssh/index.ts"),
|
||||
"the permission service must load before pi-ssh registers its permission bridge",
|
||||
);
|
||||
assert.ok(
|
||||
packageJson.pi.extensions.indexOf("./pi-ssh/index.ts") <
|
||||
packageJson.pi.extensions.indexOf("./pi-tool-search/extensions/index.ts"),
|
||||
"pi-ssh tools must register before Tool Search builds its catalog",
|
||||
);
|
||||
assert.equal(
|
||||
packageJson.dependencies["@firstpick/pi-extension-codex-fast-mode"],
|
||||
"file:./pi-extension-codex-fast-mode",
|
||||
|
||||
@@ -21,6 +21,20 @@ test("search routing narrows files before requesting matching line numbers", ()
|
||||
assert.match(section, /Use read with offset\/limit only for the exact matching region/);
|
||||
});
|
||||
|
||||
test("SSH connection routing requires an explicit named host and concrete task", () => {
|
||||
const section = buildToolRoutingSection(["ssh_connect"]);
|
||||
assert.match(section, /only when the user explicitly names an imported host/);
|
||||
assert.match(section, /Connect before calling other ssh_\* tools/);
|
||||
assert.match(section, /never infer or substitute a different host/);
|
||||
});
|
||||
|
||||
test("remote search routing uses structured bounded SSH tools", () => {
|
||||
const section = buildToolRoutingSection(["ssh_find", "ssh_grep"]);
|
||||
assert.match(section, /use ssh_find to narrow remote file paths before ssh_grep/);
|
||||
assert.match(section, /Do not run find, fd, grep, or rg through ssh_bash/);
|
||||
assert.match(section, /when a result says truncated, narrow the path or pattern/);
|
||||
});
|
||||
|
||||
test("context routing analyzes large files without a full read", () => {
|
||||
const section = buildToolRoutingSection(["ctx_execute", "ctx_execute_file"]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user