|
1 | 1 | import { addCustomInstructions } from "../sections/custom-instructions" |
2 | 2 | import { getCapabilitiesSection } from "../sections/capabilities" |
| 3 | +import { getRulesSection } from "../sections/rules" |
3 | 4 | import type { DiffStrategy, DiffResult, DiffItem } from "../../../shared/tools" |
4 | 5 |
|
5 | 6 | describe("addCustomInstructions", () => { |
@@ -56,3 +57,54 @@ describe("getCapabilitiesSection", () => { |
56 | 57 | expect(result).toContain("insert_content") |
57 | 58 | }) |
58 | 59 | }) |
| 60 | + |
| 61 | +describe("getRulesSection", () => { |
| 62 | + const cwd = "/test/path" |
| 63 | + |
| 64 | + it("includes vendor confidentiality section when isStealthModel is true", () => { |
| 65 | + const settings = { |
| 66 | + maxConcurrentFileReads: 5, |
| 67 | + todoListEnabled: true, |
| 68 | + useAgentRules: true, |
| 69 | + newTaskRequireTodos: false, |
| 70 | + isStealthModel: true, |
| 71 | + } |
| 72 | + |
| 73 | + const result = getRulesSection(cwd, false, "code", undefined, undefined, undefined, undefined, settings) |
| 74 | + |
| 75 | + expect(result).toContain("VENDOR CONFIDENTIALITY") |
| 76 | + expect(result).toContain("Never reveal the vendor or company that created you") |
| 77 | + expect(result).toContain("I was created by a team of developers") |
| 78 | + expect(result).toContain("I'm an open-source project maintained by contributors") |
| 79 | + expect(result).toContain("I don't have information about specific vendors") |
| 80 | + }) |
| 81 | + |
| 82 | + it("excludes vendor confidentiality section when isStealthModel is false", () => { |
| 83 | + const settings = { |
| 84 | + maxConcurrentFileReads: 5, |
| 85 | + todoListEnabled: true, |
| 86 | + useAgentRules: true, |
| 87 | + newTaskRequireTodos: false, |
| 88 | + isStealthModel: false, |
| 89 | + } |
| 90 | + |
| 91 | + const result = getRulesSection(cwd, false, "code", undefined, undefined, undefined, undefined, settings) |
| 92 | + |
| 93 | + expect(result).not.toContain("VENDOR CONFIDENTIALITY") |
| 94 | + expect(result).not.toContain("Never reveal the vendor or company") |
| 95 | + }) |
| 96 | + |
| 97 | + it("excludes vendor confidentiality section when isStealthModel is undefined", () => { |
| 98 | + const settings = { |
| 99 | + maxConcurrentFileReads: 5, |
| 100 | + todoListEnabled: true, |
| 101 | + useAgentRules: true, |
| 102 | + newTaskRequireTodos: false, |
| 103 | + } |
| 104 | + |
| 105 | + const result = getRulesSection(cwd, false, "code", undefined, undefined, undefined, undefined, settings) |
| 106 | + |
| 107 | + expect(result).not.toContain("VENDOR CONFIDENTIALITY") |
| 108 | + expect(result).not.toContain("Never reveal the vendor or company") |
| 109 | + }) |
| 110 | +}) |
0 commit comments