chatccc 0.2.238 → 0.2.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -56,6 +56,42 @@ afterEach(() => {
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
describe("ChatSession context management", () => {
|
|
59
|
+
it("keeps the generalized evidence gate in the stable system prompt prefix", async () => {
|
|
60
|
+
const { ChatSession } = await import("../builtin/index.ts");
|
|
61
|
+
const dir = await mkdtemp(join(tmpdir(), "deepccc-session-evidence-gate-"));
|
|
62
|
+
await writeFile(join(dir, "AGENTS.md"), "PROJECT GUIDANCE MARKER", "utf-8");
|
|
63
|
+
streamTextMock.mockReturnValueOnce({ textStream: textStream("done") });
|
|
64
|
+
|
|
65
|
+
const session = new ChatSession(
|
|
66
|
+
{ apiKey: "sk-test" },
|
|
67
|
+
{
|
|
68
|
+
cwd: dir,
|
|
69
|
+
sessionId: "evidence-gate",
|
|
70
|
+
systemPrompt: "CUSTOM PROMPT MARKER",
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
await collect(session.chat("diagnose a consequential problem"));
|
|
74
|
+
|
|
75
|
+
const system = streamTextMock.mock.calls.at(-1)?.[0].system as string;
|
|
76
|
+
expect(system).toContain("## Evidence-Gated Conclusions");
|
|
77
|
+
expect(system).toContain("source of truth");
|
|
78
|
+
expect(system).toContain("direct observations from inferences");
|
|
79
|
+
expect(system).toContain("plausible alternative explanations");
|
|
80
|
+
expect(system).toContain("runtime behavior for runtime claims");
|
|
81
|
+
expect(system).toContain("state uncertainty");
|
|
82
|
+
expect(system).toContain("Do not repeat checks once decisive evidence exists");
|
|
83
|
+
expect(system).not.toContain("CodesForUnity");
|
|
84
|
+
expect(system.indexOf("## Evidence-Gated Conclusions")).toBeLessThan(
|
|
85
|
+
system.indexOf("PROJECT GUIDANCE MARKER"),
|
|
86
|
+
);
|
|
87
|
+
expect(system.indexOf("## Evidence-Gated Conclusions")).toBeLessThan(
|
|
88
|
+
system.indexOf("Current working directory"),
|
|
89
|
+
);
|
|
90
|
+
expect(system.indexOf("## Evidence-Gated Conclusions")).toBeLessThan(
|
|
91
|
+
system.indexOf("CUSTOM PROMPT MARKER"),
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
|
|
59
95
|
it("injects cwd project instruction files before runtime workspace details", async () => {
|
|
60
96
|
const { ChatSession } = await import("../builtin/index.ts");
|
|
61
97
|
const dir = await mkdtemp(join(tmpdir(), "deepccc-session-instructions-"));
|
package/src/builtin/index.ts
CHANGED
|
@@ -42,9 +42,17 @@ const SYSTEM_PROMPT = [
|
|
|
42
42
|
"- Respond in the user's language unless they ask otherwise.",
|
|
43
43
|
"- Prefer direct, usable answers and concrete actions over long explanations.",
|
|
44
44
|
"- For code tasks, inspect the relevant files before editing and verify with tests or checks when practical.",
|
|
45
|
-
"- Preserve user work. Do not overwrite concurrent changes unless the user explicitly asks.",
|
|
46
|
-
"- Keep immutable platform rules above project guidance and runtime details.",
|
|
47
|
-
|
|
45
|
+
"- Preserve user work. Do not overwrite concurrent changes unless the user explicitly asks.",
|
|
46
|
+
"- Keep immutable platform rules above project guidance and runtime details.",
|
|
47
|
+
"",
|
|
48
|
+
"## Evidence-Gated Conclusions",
|
|
49
|
+
"- Apply this gate before consequential claims or actions that could affect code, data, deployments, or user decisions, and whenever the available evidence is indirect.",
|
|
50
|
+
"- Identify the claim and its authoritative source of truth. Separate direct observations from inferences, and test plausible alternative explanations before choosing one.",
|
|
51
|
+
"- Use the strongest practical decisive check at the same semantic level as the claim: runtime behavior for runtime claims, effective configuration for configuration claims, deployed state for deployment claims, and transformed output for transformation claims.",
|
|
52
|
+
"- Do not treat proxy signals such as names, timestamps, file sizes, line counts, partial samples, or a clean command exit as decisive when a direct check is practical.",
|
|
53
|
+
"- Use definitive language only after the evidence closes the loop. Otherwise state uncertainty, identify the missing evidence, and name the next check.",
|
|
54
|
+
"- Do not repeat checks once decisive evidence exists.",
|
|
55
|
+
].join("\n");
|
|
48
56
|
|
|
49
57
|
const SUMMARY_SYSTEM_PROMPT = [
|
|
50
58
|
"You are DeepCCC's context compactor.",
|