refactor(permission-system): simplify policy and autoreview flow

This commit is contained in:
云服务部-叶林立
2026-09-03 02:01:06 +08:00
parent 180da95ab7
commit 6e7effa792
112 changed files with 911 additions and 10346 deletions
@@ -132,18 +132,6 @@ describe("suggestSessionPattern", () => {
});
});
describe("external_directory surface", () => {
it("returns parent-directory glob from deriveApprovalPattern", () => {
const result = suggestSessionPattern(
"external_directory",
"/tmp/foo.txt",
);
expect(result).toMatchObject({
surface: "external_directory",
pattern: "/tmp/*",
});
});
});
describe("path surface", () => {
it("returns directory-scoped pattern for a file path", () => {
@@ -225,15 +213,6 @@ describe("suggestSessionPattern", () => {
);
});
it("external_directory label includes surface prefix", () => {
const result = suggestSessionPattern(
"external_directory",
"/tmp/foo.txt",
);
expect(result.label).toBe(
'Yes, allow access to external directory "/tmp/*" for this session',
);
});
it("path-bearing tool label includes path pattern", () => {
const result = suggestSessionPattern("edit", "src/file.ts");