|
|
@@ -1,5 +1,6 @@
|
|
|
import { addCustomInstructions } from "../sections/custom-instructions"
|
|
|
import { getCapabilitiesSection } from "../sections/capabilities"
|
|
|
+import { getRulesSection } from "../sections/rules"
|
|
|
import type { DiffStrategy, DiffResult, DiffItem } from "../../../shared/tools"
|
|
|
|
|
|
describe("addCustomInstructions", () => {
|
|
|
@@ -56,3 +57,54 @@ describe("getCapabilitiesSection", () => {
|
|
|
expect(result).toContain("insert_content")
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
+describe("getRulesSection", () => {
|
|
|
+ const cwd = "/test/path"
|
|
|
+
|
|
|
+ it("includes vendor confidentiality section when isStealthModel is true", () => {
|
|
|
+ const settings = {
|
|
|
+ maxConcurrentFileReads: 5,
|
|
|
+ todoListEnabled: true,
|
|
|
+ useAgentRules: true,
|
|
|
+ newTaskRequireTodos: false,
|
|
|
+ isStealthModel: true,
|
|
|
+ }
|
|
|
+
|
|
|
+ const result = getRulesSection(cwd, false, "code", undefined, undefined, undefined, undefined, settings)
|
|
|
+
|
|
|
+ expect(result).toContain("VENDOR CONFIDENTIALITY")
|
|
|
+ expect(result).toContain("Never reveal the vendor or company that created you")
|
|
|
+ expect(result).toContain("I was created by a team of developers")
|
|
|
+ expect(result).toContain("I'm an open-source project maintained by contributors")
|
|
|
+ expect(result).toContain("I don't have information about specific vendors")
|
|
|
+ })
|
|
|
+
|
|
|
+ it("excludes vendor confidentiality section when isStealthModel is false", () => {
|
|
|
+ const settings = {
|
|
|
+ maxConcurrentFileReads: 5,
|
|
|
+ todoListEnabled: true,
|
|
|
+ useAgentRules: true,
|
|
|
+ newTaskRequireTodos: false,
|
|
|
+ isStealthModel: false,
|
|
|
+ }
|
|
|
+
|
|
|
+ const result = getRulesSection(cwd, false, "code", undefined, undefined, undefined, undefined, settings)
|
|
|
+
|
|
|
+ expect(result).not.toContain("VENDOR CONFIDENTIALITY")
|
|
|
+ expect(result).not.toContain("Never reveal the vendor or company")
|
|
|
+ })
|
|
|
+
|
|
|
+ it("excludes vendor confidentiality section when isStealthModel is undefined", () => {
|
|
|
+ const settings = {
|
|
|
+ maxConcurrentFileReads: 5,
|
|
|
+ todoListEnabled: true,
|
|
|
+ useAgentRules: true,
|
|
|
+ newTaskRequireTodos: false,
|
|
|
+ }
|
|
|
+
|
|
|
+ const result = getRulesSection(cwd, false, "code", undefined, undefined, undefined, undefined, settings)
|
|
|
+
|
|
|
+ expect(result).not.toContain("VENDOR CONFIDENTIALITY")
|
|
|
+ expect(result).not.toContain("Never reveal the vendor or company")
|
|
|
+ })
|
|
|
+})
|