aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-08 21:41:47 +0530
committeramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-08 21:41:47 +0530
commit1c12b43a674ae51a39c430ed8cfa138dbdf4dc71 (patch)
tree45d256d77c478d5cd1bae0620d5965d889bf4cce /test
parent3f65a30e3f78e749110ad0d883e265b3a59dec13 (diff)
feat: add deep-research skill, /deep-research command, fix web-search-researcher
deep-research skill fans out to isolated web-search-researcher subagents (now using browser_web_search + browser_read_page instead of the non-existent web_search/web_fetch), coverage-driven loop with a hard ceiling, synthesizes a cited Markdown report. /deep-research command as explicit entry point. Docs updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'test')
-rw-r--r--test/deep-research/agent-config-test.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/deep-research/agent-config-test.ts b/test/deep-research/agent-config-test.ts
new file mode 100644
index 0000000..0e9dfe4
--- /dev/null
+++ b/test/deep-research/agent-config-test.ts
@@ -0,0 +1,42 @@
+/**
+ * S20: the web-search-researcher subagent config references only real tools.
+ *
+ * Guards against the pre-Phase-3 regression where the agent named the
+ * non-existent web_search / web_fetch tools. Pure string checks over the
+ * markdown file — no browser, no subagent runtime.
+ *
+ * Run: npx tsx test/deep-research/agent-config-test.ts
+ */
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
+
+let passed = 0;
+let failed = 0;
+const check = (cond: boolean, label: string): void => {
+ if (cond) {
+ passed++;
+ console.log(` ✓ ${label}`);
+ } else {
+ failed++;
+ console.error(` ✗ ${label}`);
+ }
+};
+
+const agentPath = join(import.meta.dirname, "..", "..", ".pi", "agents", "web-search-researcher.md");
+const raw = readFileSync(agentPath, "utf8");
+
+const fmMatch = raw.match(/^---\n([\s\S]*?)\n---/);
+const frontmatter = fmMatch ? (fmMatch[1] ?? "") : "";
+const body = fmMatch ? raw.slice(fmMatch[0].length) : raw;
+const toolsLine = frontmatter.split("\n").find((l) => l.startsWith("tools:")) ?? "";
+
+// S20
+check(toolsLine.includes("browser_web_search"), "S20: tools includes browser_web_search");
+check(toolsLine.includes("browser_read_page"), "S20: tools includes browser_read_page");
+check(!/\bweb_search\b/.test(toolsLine), "S20: tools does NOT include web_search");
+check(!/\bweb_fetch\b/.test(toolsLine), "S20: tools does NOT include web_fetch");
+check(/^\s*isolated:\s*true\s*$/m.test(frontmatter), "S20: isolated: true is present");
+check(!/WebSearch|WebFetch/.test(body), "S20: body has no WebSearch/WebFetch references");
+
+console.log(`\n${passed} passed, ${failed} failed`);
+if (failed > 0) process.exit(1);