Skip to content

Desktop app that records your on-screen work session and uses the GitHub Copilot SDK to reconstruct it as an intent + ordered steps, then builds a reusable Skill or Automation for Microsoft Autopilots like Scout, Microsoft Copilot Cowork, or Copilot Studio.

Prefer device CLIs (gh) over the browser in built skills/automations (#12)

adileic991b2f70a94
diff --git a/electron/automationbuilder/instructions.ts b/electron/automationbuilder/instructions.ts
index de68dfa..2bbc0e3 100644
--- a/electron/automationbuilder/instructions.ts
+++ b/electron/automationbuilder/instructions.ts
@@ -65,8 +65,12 @@ Each step has a short **label** and a **prompt** — an imperative instruction t
collection and the SHAPE of the data, never the specific values from the recording.
- **Prefer native tools, and say why.** Map each recorded action to the target's native
capability (see the catalogue): searching Teams becomes a WorkIQ call, reading a local
- file becomes the file tools, editing a spreadsheet becomes the built-in skill. Only fall
- back to the browser for genuine UI-only steps, and the shell as a last resort.
+ file becomes the file tools, editing a spreadsheet becomes the built-in skill. When a
+ service has a first-class CLI on the device, PREFER it over the browser — above all
+ **GitHub → the \`gh\` CLI** (\`gh issue\`/\`gh pr\`/\`gh release\`/\`gh api\`), plus \`git\`
+ and cloud CLIs. Only fall back to the browser for genuine UI-only steps (a web app with
+ no API and no CLI). Write shell commands for the device OS (zsh/bash on macOS,
+ PowerShell on Windows).
- **Resolve inputs inside the prompt.** An automation runs unattended and can't stop to ask
a human, so tell the agent to DISCOVER inputs on the local OS / read them from M365, or
bake in a genuinely fixed value. Avoid "ask the user" inputs.
diff --git a/electron/automationbuilder/scout-automation-catalog.ts b/electron/automationbuilder/scout-automation-catalog.ts
index ae30770..7744eb1 100644
--- a/electron/automationbuilder/scout-automation-catalog.ts
+++ b/electron/automationbuilder/scout-automation-catalog.ts
@@ -9,7 +9,7 @@ import { SCOUT_NATIVE_CAPABILITIES } from "../skillbuilder/scout-catalog";
* Authored by inspecting `~/projects/m` (electron/automations/*). Refresh when
* Scout's automation model or native tools change.
*/
-export const SCOUT_AUTOMATION_CATALOGUE_VERSION = "2026-07-25";
+export const SCOUT_AUTOMATION_CATALOGUE_VERSION = "2026-07-26";
const SCOUT_AUTOMATION_CATALOGUE = `
# Target: Microsoft Scout — automation catalogue (built-ins only)
@@ -52,7 +52,8 @@ ${SCOUT_NATIVE_CAPABILITIES}
## Writing the automation
- Propose a trigger (a schedule by default) and 2–6 generalized, native-tool-first steps.
-- Prefer the native tools above; only use the browser for genuine UI-only steps.
+- Prefer the native tools above; use the device's CLI (e.g. \`gh\` for GitHub) over the
+ browser, and only use the browser for genuine UI-only steps (no API and no CLI).
- Give the automation a clear \`description\` of what it does and when it runs.
`.trim();
diff --git a/electron/skillbuilder/instructions.ts b/electron/skillbuilder/instructions.ts
index 1dedf43..81cef30 100644
--- a/electron/skillbuilder/instructions.ts
+++ b/electron/skillbuilder/instructions.ts
@@ -58,8 +58,12 @@ user can override any of them in plain language.
- Map each recorded action to the target's native capability. Searching Teams becomes
a WorkIQ call, not simulated clicks; reading a local file becomes the file tools;
editing a spreadsheet becomes the built-in spreadsheet skill.
-- Only fall back to browser automation for genuine UI-only steps with no API, and to
- the shell as a last resort (gated by \`allowed-tools\`).
+- When a service ships a first-class CLI on the device, prefer it over the browser —
+ above all **GitHub → the \`gh\` CLI**, plus \`git\` and cloud CLIs (Scout runs on the
+ user's Mac or Windows machine). Only fall back to browser automation for genuine
+ UI-only steps (a web app with no API and no CLI). Gate the shell with \`allowed-tools\`
+ (e.g. \`Bash(gh *)\`) and write commands for the device OS (zsh/bash on macOS,
+ PowerShell on Windows).
- Record your choices in the plan's \`toolMapping\`, and set \`allowedTools\` to the
patterns the skill actually needs.
- Rely ONLY on the built-in tools and skills in the catalogue — never on a skill the
diff --git a/electron/skillbuilder/scout-catalog.ts b/electron/skillbuilder/scout-catalog.ts
index c3e4fce..07c702d 100644
--- a/electron/skillbuilder/scout-catalog.ts
+++ b/electron/skillbuilder/scout-catalog.ts
@@ -10,7 +10,7 @@ import type { SkillArchitecture } from "../../common/skill";
* generated skill can only rely on what every Scout install ships with. Refresh
* this when Scout's native tools/skills change.
*/
-export const SCOUT_CATALOGUE_VERSION = "2026-07-25";
+export const SCOUT_CATALOGUE_VERSION = "2026-07-26";
/**
* The reusable core of the Scout catalogue: the native tools, built-in skills, and
@@ -18,9 +18,12 @@ export const SCOUT_CATALOGUE_VERSION = "2026-07-25";
* Builder (their preambles/tails differ, but both prefer these same capabilities).
*/
export const SCOUT_NATIVE_CAPABILITIES = `
-## Native tools, in the order to PREFER them
+## Where this runs, and the native tools to PREFER
-Prefer a real native tool/API over replaying UI clicks. Only fall back down this list.
+Scout runs on the user's own **device — macOS or Windows**, not a sandbox: it has a real
+shell and whatever command-line tools the user has installed (e.g. the \`gh\` GitHub CLI,
+\`git\`, cloud CLIs). Prefer a real native tool, API, or first-class **CLI** over replaying
+a web UI. Reach for these in order:
1. **WorkIQ (\`workiq_*\`) — Microsoft 365.** Use for anything in Teams, Outlook mail,
Calendar, SharePoint/OneDrive, or the org directory. Read tools are auto-approved;
@@ -38,13 +41,21 @@ Prefer a real native tool/API over replaying UI clicks. Only fall back down this
2. **SDK built-ins — local files, code, and the web.** \`view\` (read a file), \`glob\`
(find files by pattern), \`grep\` (search file contents), \`web_fetch\` (fetch a URL).
These are how a skill DISCOVERS inputs on the local OS instead of asking the user.
-3. **Browser automation (\`browser_*\`, Playwright).** Only when there is no API/WorkIQ
- equivalent — a web app you must drive through its UI. Key tools: \`browser_navigate\`,
- \`browser_snapshot\` (always snapshot before you act — it returns the element refs),
- \`browser_click\`, \`browser_type\`, \`browser_fill_form\`, \`browser_select_option\`,
- \`browser_press_key\`, \`browser_wait_for\`, \`browser_take_screenshot\`.
-4. **Shell (\`bash\`) — last resort.** Gate it with an \`allowed-tools\` pattern such as
- \`Bash(git *)\` so only the needed commands are permitted.
+3. **The device shell + installed CLIs (\`bash\`).** Scout runs on a real Mac or Windows
+ machine, so when a service ships a first-class CLI, that CLI IS its native tool —
+ prefer it over the browser. Above all: **GitHub → the \`gh\` CLI** (\`gh issue\`,
+ \`gh pr\`, \`gh release\`, \`gh repo\`, \`gh api\`), already signed in on the device —
+ never drive github.com through the browser. Likewise \`git\`, and the cloud/service
+ CLIs the task used (\`az\`, \`aws\`, \`gcloud\`, \`kubectl\`, \`npm\`, \`docker\`). Write
+ commands for the target OS — POSIX shell (zsh/bash) on **macOS**, **PowerShell** on
+ **Windows** (mind path and quoting differences). Gate the shell with an
+ \`allowed-tools\` pattern scoped to the tool, e.g. \`Bash(gh *)\` or \`Bash(git *)\`.
+4. **Browser automation (\`browser_*\`, Playwright) — the UI fallback.** ONLY for a web app
+ with no API and no CLI, that you must drive through its UI. (GitHub is NOT such a case —
+ use \`gh\`.) Key tools: \`browser_navigate\`, \`browser_snapshot\` (always snapshot before
+ you act — it returns the element refs), \`browser_click\`, \`browser_type\`,
+ \`browser_fill_form\`, \`browser_select_option\`, \`browser_press_key\`, \`browser_wait_for\`,
+ \`browser_take_screenshot\`.
## Built-in skills you can lean on
@@ -71,8 +82,10 @@ skill being installed.
| Sending a message, email, or invite | \`workiq_send_chat_message\` / \`workiq_send_email\` / \`workiq_create_event\` (approval) |
| Opening / reading a local file or folder | \`view\` / \`glob\` / \`grep\` |
| Reading a public web page | \`web_fetch\` |
+| Acting on GitHub — issues, PRs, releases, repos, gists, Actions | the \`gh\` CLI via \`Bash(gh *)\` (\`gh issue\`, \`gh pr\`, \`gh release\`, \`gh api\`) — never the browser |
+| Running git, cloud, or package operations | the matching CLI via the shell (\`git\`, \`az\`/\`aws\`/\`gcloud\`, \`npm\`, \`docker\`) |
| Editing a spreadsheet / doc / deck | the \`xlsx\` / \`docx\` / \`pptx\` built-in skill |
-| Filling a form on a web app with no API | \`browser_navigate\` + \`browser_snapshot\` + \`browser_fill_form\`/\`browser_type\`/\`browser_click\` |
+| Filling a form on a web app with no API or CLI | \`browser_navigate\` + \`browser_snapshot\` + \`browser_fill_form\`/\`browser_type\`/\`browser_click\` |
`.trim();
const SCOUT_CATALOGUE = `
diff --git a/evals/README.md b/evals/README.md
index b036861..4da1ee7 100644
--- a/evals/README.md
+++ b/evals/README.md
@@ -113,6 +113,41 @@ export const myScenario: Scenario = {
};
```
+## Builder evals (`evals/builder/`)
+
+A second, smaller harness that guards the **final stage** — the builder that
+generalizes an approved analysis into a Scout artifact — rather than the
+describer. It exists because of a real regression: when generalizing GitHub work,
+the builder preferred driving the **browser (Playwright)** instead of the **`gh`
+CLI**, even though Scout runs on the user's own Mac/Windows device where `gh` is
+installed and authenticated.
+
+```bash
+npm run eval:builder # all builder scenarios
+npm run eval:builder -- --only=github-issue-triage
+npm run eval:builder -- --keep # print the temp sessions dir
+npm run eval:builder -- --model=<model-id> # override the builder model
+```
+
+**How it isolates the builder.** Each scenario seeds a **fixed, approved
+`Analysis`** (plus a minimal valid `bundle.json`) into a temp sessions dir, then
+runs the real `AutomationBuilder.build()` for a chosen `architecture` and
+`platform` (macOS or Windows). Seeding a frozen analysis removes describer
+variance, so a failure points squarely at the builder's instructions/catalogue.
+Only the plan's **steps** (`label` + `prompt`) are scored — the summary and
+generalization prose are intentionally excluded, so the builder isn't penalized
+for *explaining* which tool it avoided.
+
+**Rubric** (`score.ts`): a scenario passes only if the steps satisfy every
+`mustUseAny` group (e.g. mentions `gh ` and a concrete `gh issue`/`gh pr`/`gh api`
+command) and contain **none** of the `forbidden` tokens (`playwright`, `browser_`,
+`click`, `navigate to github`, hard-coded `github.com/...` URLs). The two seed
+scenarios cover GitHub issue triage (darwin) and stale-PR nudging (win32); both
+start from a browser-based recording, so a correct build must *re-map* the work
+onto the device CLI. This is the eval that drove the catalogue fix in
+`electron/skillbuilder/scout-catalog.ts` (prefer first-class device CLIs — above
+all `gh` — over the browser, platform-aware for zsh/bash vs PowerShell).
+
## Mock pages (`evals/mocks/`)
Static, self-contained HTML fixtures matching the scenarios (`pricing.html`,
diff --git a/evals/builder/run.ts b/evals/builder/run.ts
new file mode 100644
index 0000000..d5c5b5c
--- /dev/null
+++ b/evals/builder/run.ts
@@ -0,0 +1,212 @@
+// Builder eval harness: runs the real final-stage builder against each fixed
+// scenario and scores how it GENERALIZES the analysis — specifically whether it
+// reaches for the right native tool (the `gh` CLI for GitHub) instead of replaying
+// the UI in the browser.
+//
+// For every scenario it: seeds a session with the scenario's FIXED approved
+// analysis (analysis.json) into a temp sessions root, runs the real
+// AutomationBuilder.build (one turn → a proposed plan), then scores the plan's
+// step prompts against the rubric. No describer, no capture — this isolates the
+// builder, the part with the variance we're measuring.
+//
+// Run:
+// node --experimental-transform-types --import ./evals/register.mjs evals/builder/run.ts [flags]
+// Flags:
+// --only=slug,slug run a subset of scenarios
+// --keep print the temp sessions dir (artifacts kept for inspection)
+// --model=<id> override the builder model
+
+import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
+import os from "node:os";
+import path from "node:path";
+
+import { toAnalysis, type Analysis } from "../../common/analysis";
+import { SessionBundleSchema, type SessionBundle } from "../../common/bundle";
+import { AutomationBuilder } from "../../electron/automationbuilder/builder";
+import type { AutomationPlan } from "../../common/automation";
+import { builderScenarios } from "./scenarios";
+import { scoreBuilder, type BuilderScoreResult } from "./score";
+import type { BuilderScenario } from "./scenario";
+
+interface Flags {
+ only: Set<string> | null;
+ keep: boolean;
+ model?: string;
+}
+
+function parseFlags(argv: string[]): Flags {
+ const flags: Flags = { only: null, keep: false };
+ for (const arg of argv) {
+ if (arg.startsWith("--only=")) flags.only = new Set(arg.slice(7).split(",").map((s) => s.trim()).filter(Boolean));
+ else if (arg === "--keep") flags.keep = true;
+ else if (arg.startsWith("--model=")) flags.model = arg.slice(8);
+ }
+ return flags;
+}
+
+interface Result {
+ id: string;
+ title: string;
+ ok: boolean;
+ error?: string;
+ durationMs: number;
+ plan?: AutomationPlan;
+ score?: BuilderScoreResult;
+}
+
+/** Seed the scenario's fixed approved analysis so the builder can read it. */
+function seed(root: string, scenario: BuilderScenario): void {
+ const dir = path.join(root, scenario.id);
+ mkdirSync(dir, { recursive: true });
+ const analysis: Analysis = {
+ ...toAnalysis(scenario.id, 1, scenario.analysis, []),
+ approved: true,
+ approvedAt: Date.now(),
+ };
+ writeFileSync(path.join(dir, "analysis.json"), JSON.stringify(analysis, null, 2));
+ writeFileSync(path.join(dir, "bundle.json"), JSON.stringify(toSeedBundle(scenario), null, 2));
+}
+
+const URL_RE = /https?:\/\/\S+/g;
+
+/**
+ * A minimal but schema-valid timeline for the builder's `get_timeline` tool, built
+ * from the fixed analysis. It carries the device **platform** (so the builder knows
+ * it targets macOS or Windows) and each step's app + any URLs/hosts pulled from the
+ * analysis evidence — the same grounding the real bundle would provide.
+ */
+function toSeedBundle(scenario: BuilderScenario): SessionBundle {
+ const now = Date.now();
+ const steps = scenario.analysis.steps.map((s, i) => {
+ const urls = (s.evidence.join(" ").match(URL_RE) ?? []).map((u) => u.replace(/[)"']+$/, ""));
+ const hosts = [...new Set(urls.map((u) => { try { return new URL(u).host; } catch { return ""; } }).filter(Boolean))];
+ const clipboardCount = s.evidence.filter((e) => e.toLowerCase().startsWith("clipboard")).length;
+ return {
+ index: i,
+ startMs: now + i * 1000,
+ endMs: now + (i + 1) * 1000,
+ durationMs: 1000,
+ boundary: (i === 0 ? "start" : "app-change") as SessionBundle["steps"][number]["boundary"],
+ app: s.apps[0],
+ titles: [],
+ hosts,
+ urls,
+ commands: [],
+ clipboardCount,
+ markers: [],
+ eventSeqs: [i],
+ frames: [],
+ summary: s.title,
+ };
+ });
+ return SessionBundleSchema.parse({
+ version: 1,
+ session: {
+ id: scenario.id,
+ startedAt: now,
+ stoppedAt: now + steps.length * 1000,
+ durationMs: steps.length * 1000,
+ platform: scenario.platform,
+ appVersion: "eval",
+ },
+ steps,
+ stats: {
+ eventCount: steps.length,
+ meaningfulEventCount: steps.length,
+ stepCount: steps.length,
+ frameCount: 0,
+ unexplainedFrameCount: 0,
+ silentEventCount: 0,
+ },
+ });
+}
+
+/** The actionable text we score: the ordered step labels + prompts. */
+function stepsText(plan: AutomationPlan): string {
+ return plan.steps.map((s) => `${s.label}\n${s.prompt}`).join("\n\n");
+}
+
+const bar = "─".repeat(64);
+
+async function main(): Promise<void> {
+ const flags = parseFlags(process.argv.slice(2));
+ if (flags.model) process.env.SKILL_RECORDER_MODEL = flags.model;
+
+ let root = process.env.SKILL_RECORDER_SESSIONS_DIR;
+ if (!root) {
+ root = mkdtempSync(path.join(os.tmpdir(), "sr-builder-evals-"));
+ process.env.SKILL_RECORDER_SESSIONS_DIR = root;
+ }
+
+ const selected = builderScenarios.filter((s) => !flags.only || flags.only.has(s.id));
+ if (selected.length === 0) {
+ console.error("No scenarios matched", flags.only ? [...flags.only] : "");
+ process.exit(2);
+ }
+
+ console.error(`\nSkill Recorder — builder evals`);
+ console.error(`${selected.length} scenario(s) · sessions root: ${root}`);
+ console.error(bar);
+
+ const builder = new AutomationBuilder((p) => {
+ if (p.message) process.stderr.write(` · [${p.sessionId}] ${p.message}\n`);
+ });
+
+ const results: Result[] = [];
+ for (const scenario of selected) {
+ console.error(`\n▶ ${scenario.id} — ${scenario.title}`);
+ const started = Date.now();
+ const res: Result = { id: scenario.id, title: scenario.title, ok: false, durationMs: 0 };
+ try {
+ seed(root, scenario);
+ const plan = await builder.build({ sessionId: scenario.id, architecture: scenario.architecture });
+ res.plan = plan;
+ res.score = scoreBuilder(stepsText(plan), scenario.rubric);
+ res.ok = res.score.pass;
+ } catch (err) {
+ res.error = err instanceof Error ? err.message : String(err);
+ }
+ res.durationMs = Date.now() - started;
+ results.push(res);
+ printResult(res);
+ }
+
+ await builder.dispose();
+
+ const stamp = new Date().toISOString().replace(/[:.]/g, "-");
+ const outFile = path.join(process.cwd(), "evals", "results", `builder-${stamp}.json`);
+ mkdirSync(path.dirname(outFile), { recursive: true });
+ writeFileSync(outFile, JSON.stringify({ at: stamp, root, results }, null, 2));
+
+ console.error(`\n${bar}\nSummary`);
+ const passed = results.filter((r) => r.ok).length;
+ for (const r of results) {
+ const pct = r.score ? `${Math.round(r.score.score * 100)}%` : " — ";
+ const status = r.error ? "ERROR" : r.ok ? "PASS " : "FAIL ";
+ console.error(` ${status} ${pct.padStart(4)} ${r.id}${r.error ? ` (${r.error})` : ""}`);
+ }
+ console.error(`\n ${passed}/${results.length} scenarios passed`);
+ if (flags.keep) console.error(` artifacts: ${root}`);
+ console.error(` results: ${path.relative(process.cwd(), outFile)}\n`);
+
+ process.exit(passed === results.length ? 0 : 1);
+}
+
+function printResult(r: Result): void {
+ if (r.error) {
+ console.error(` ✗ error: ${r.error}`);
+ return;
+ }
+ for (const [i, s] of (r.plan?.steps ?? []).entries()) {
+ console.error(` ${i + 1}. ${s.label}: ${s.prompt}`);
+ }
+ console.error(` score: ${Math.round((r.score?.score ?? 0) * 100)}% · ${r.ok ? "PASS" : "FAIL"} · ${(r.durationMs / 1000).toFixed(1)}s`);
+ for (const c of r.score?.checks ?? []) {
+ if (!c.pass) console.error(` ✗ ${c.name}${c.detail ? ` — ${c.detail}` : ""}`);
+ }
+}
+
+main().catch((err) => {
+ console.error("Harness crashed:", err);
+ process.exit(3);
+});
diff --git a/evals/builder/scenario.ts b/evals/builder/scenario.ts
new file mode 100644
index 0000000..9d34e4c
--- /dev/null
+++ b/evals/builder/scenario.ts
@@ -0,0 +1,43 @@
+// Scenario model for the **builder** evals.
+//
+// Unlike the describer evals (which score how a recording is reconstructed), these
+// score the *final stage*: how the builder GENERALIZES an approved analysis into a
+// runnable artifact. The variance we care about here is native-tool choice — e.g.
+// mapping GitHub work to the `gh` CLI instead of replaying github.com through the
+// browser. To isolate the builder from describer variance, each scenario ships a
+// FIXED analysis (as if the describer had produced it); the harness seeds it to
+// disk and runs the real builder against it.
+
+import type { AnalysisSubmission } from "../../common/analysis";
+import type { SkillArchitecture } from "../../common/skill";
+
+/** Deterministic rubric for a builder's generalized output (its step prompts). */
+export interface BuilderRubric {
+ /**
+ * Each group is a set of synonyms; the built output must contain at least one
+ * member of every group (case-insensitive). Use it to require the RIGHT native
+ * tool, e.g. [["gh "], ["gh issue", "gh api"]].
+ */
+ mustUseAny: string[][];
+ /**
+ * None of these may appear in the built output (case-insensitive) — the signals
+ * of the WRONG tool, e.g. replaying the UI ("playwright", "browser_", "click").
+ */
+ forbidden: string[];
+}
+
+export interface BuilderScenario {
+ /** Slug used for the session id and result keys. */
+ id: string;
+ /** Human-readable title. */
+ title: string;
+ /** Which target agent's catalogue the builder generalizes against. */
+ architecture: SkillArchitecture;
+ /** The device OS the Scout automation will run on (macOS or Windows). */
+ platform: NodeJS.Platform;
+ /** Ground-truth description of the task (for docs + humans reading failures). */
+ truth: string;
+ /** The approved analysis fed to the builder, exactly as the describer would emit it. */
+ analysis: AnalysisSubmission;
+ rubric: BuilderRubric;
+}
diff --git a/evals/builder/scenarios.ts b/evals/builder/scenarios.ts
new file mode 100644
index 0000000..31ccabc
--- /dev/null
+++ b/evals/builder/scenarios.ts
@@ -0,0 +1,150 @@
+// Builder eval scenarios.
+//
+// Each ships a FIXED approved analysis describing a GitHub task the user did
+// THROUGH THE BROWSER (clicking around github.com). A correct builder generalizes
+// that to the `gh` CLI (the native GitHub interface) rather than replaying the UI
+// with browser automation / Playwright. These reproduce the bug where the builder
+// preferred the browser for GitHub work, and guard against it regressing.
+
+import type { BuilderScenario } from "./scenario";
+
+/** Triage bug issues — recorded in the browser, should generalize to `gh issue`. */
+const githubIssueTriage: BuilderScenario = {
+ id: "github-issue-triage",
+ title: "Triage new bug issues on GitHub",
+ architecture: "scout",
+ platform: "darwin",
+ truth:
+ "In Chrome the user opened the acme/api repo's open issues filtered to label:bug with no " +
+ "assignee, read a new report, posted a comment asking the reporter for exact reproduction " +
+ "steps and their version, and applied the 'needs-info' label — a triage pass they repeat " +
+ "for every new unassigned bug. The right generalization drives GitHub with the gh CLI " +
+ "(gh issue list / gh issue comment / gh issue edit --add-label), not the browser UI.",
+ analysis: {
+ title: "Triage new bug issues",
+ intent:
+ "Triage newly reported, unassigned bug issues in the acme/api GitHub repository: for each " +
+ "open issue labeled 'bug' with no assignee, post a comment asking the reporter for exact " +
+ "reproduction steps and their version, then add the 'needs-info' label.",
+ intentConfidence: "high",
+ intentRationale:
+ "The browser stayed on github.com/acme/api issue pages throughout; the same comment text " +
+ "and the same 'needs-info' label were applied to a bug issue.",
+ steps: [
+ {
+ id: "s1",
+ title: "Open the repo's open bug issues on GitHub",
+ detail:
+ "Navigated in Chrome to the acme/api issues list filtered to open bug issues with no " +
+ "assignee to find reports that still need triage.",
+ apps: ["Google Chrome"],
+ evidence: [
+ "browser.url https://github.com/acme/api/issues?q=is%3Aissue+is%3Aopen+label%3Abug+no%3Aassignee",
+ "title 'Issues · acme/api'",
+ ],
+ confidence: "high",
+ },
+ {
+ id: "s2",
+ title: "Open a new bug report to read it",
+ detail: "Opened issue #214 in Chrome to read the reported bug before triaging it.",
+ apps: ["Google Chrome"],
+ evidence: ["browser.url https://github.com/acme/api/issues/214"],
+ confidence: "high",
+ },
+ {
+ id: "s3",
+ title: "Comment asking for reproduction steps",
+ detail:
+ "Typed a comment into the issue's comment box and submitted it, asking the reporter " +
+ "for exact reproduction steps and the version they are on.",
+ apps: ["Google Chrome"],
+ evidence: [
+ "clipboard 'Thanks for the report! Could you share exact reproduction steps and the version you're on?'",
+ "browser.url https://github.com/acme/api/issues/214",
+ ],
+ confidence: "high",
+ },
+ {
+ id: "s4",
+ title: "Apply the needs-info label",
+ detail:
+ "Opened the Labels sidebar on the issue and applied the 'needs-info' label to mark it " +
+ "as waiting on the reporter.",
+ apps: ["Google Chrome"],
+ evidence: ["browser.url https://github.com/acme/api/issues/214", "label 'needs-info'"],
+ confidence: "medium",
+ },
+ ],
+ },
+ rubric: {
+ mustUseAny: [["gh "], ["gh issue", "gh api"]],
+ forbidden: ["playwright", "browser_", "click", "navigate to github", "github.com/acme"],
+ },
+};
+
+/** Nudge stale PRs — recorded in the browser, should generalize to `gh pr`. */
+const githubStalePrNudge: BuilderScenario = {
+ id: "github-stale-pr-nudge",
+ title: "Nudge pull requests awaiting review on GitHub",
+ architecture: "scout",
+ platform: "win32",
+ truth:
+ "In Chrome the user opened the acme/api open pull requests that still need review, checked " +
+ "how long each had been waiting, and posted a gentle nudge comment on the ones sitting for " +
+ "more than a couple of days. The right generalization uses the gh CLI (gh pr list / gh pr " +
+ "comment), not browser automation.",
+ analysis: {
+ title: "Nudge stale PRs",
+ intent:
+ "Find open pull requests in the acme/api GitHub repository that have been awaiting review " +
+ "for more than two days and post a gentle reminder comment on each one.",
+ intentConfidence: "high",
+ intentRationale:
+ "The browser stayed on github.com/acme/api pull-request pages; a reminder comment was " +
+ "posted on a PR that had been open and unreviewed for several days.",
+ steps: [
+ {
+ id: "s1",
+ title: "Open pull requests that need review",
+ detail:
+ "Navigated in Chrome to the acme/api pull requests filtered to open PRs still awaiting " +
+ "review, sorted oldest first to find the ones that have been waiting longest.",
+ apps: ["Google Chrome"],
+ evidence: [
+ "browser.url https://github.com/acme/api/pulls?q=is%3Apr+is%3Aopen+review%3Arequired+sort%3Acreated-asc",
+ ],
+ confidence: "high",
+ },
+ {
+ id: "s2",
+ title: "Check how long a PR has been waiting",
+ detail:
+ "Opened PR #estimated in Chrome and checked the opened date to confirm it had been " +
+ "waiting for review for more than two days.",
+ apps: ["Google Chrome"],
+ evidence: ["browser.url https://github.com/acme/api/pull/338"],
+ confidence: "medium",
+ },
+ {
+ id: "s3",
+ title: "Post a reminder comment tagging the reviewer",
+ detail:
+ "Typed a friendly reminder into the PR comment box tagging the requested reviewer and " +
+ "submitted it, asking them to take a look.",
+ apps: ["Google Chrome"],
+ evidence: [
+ "clipboard 'Friendly ping — this PR has been waiting on review for a couple of days, could you take a look?'",
+ "browser.url https://github.com/acme/api/pull/338",
+ ],
+ confidence: "high",
+ },
+ ],
+ },
+ rubric: {
+ mustUseAny: [["gh "], ["gh pr", "gh api"]],
+ forbidden: ["playwright", "browser_", "click", "navigate to github", "github.com/acme"],
+ },
+};
+
+export const builderScenarios: BuilderScenario[] = [githubIssueTriage, githubStalePrNudge];
diff --git a/evals/builder/score.ts b/evals/builder/score.ts
new file mode 100644
index 0000000..6f54e0f
--- /dev/null
+++ b/evals/builder/score.ts
@@ -0,0 +1,53 @@
+// Deterministic, LLM-free scoring for the builder evals: does the generalized
+// output reach for the RIGHT native tool? We score the actionable text — the
+// ordered step labels + prompts — against the scenario's rubric. The plan's
+// summary/generalization are intentionally NOT scored, so the builder isn't
+// penalized for *explaining* what it deliberately avoided (e.g. "instead of
+// clicking through the browser…").
+
+import type { BuilderRubric } from "./scenario";
+
+export interface BuilderCheck {
+ name: string;
+ pass: boolean;
+ detail?: string;
+}
+
+export interface BuilderScoreResult {
+ pass: boolean;
+ score: number;
+ checks: BuilderCheck[];
+}
+
+const has = (haystack: string, needle: string): boolean =>
+ haystack.toLowerCase().includes(needle.toLowerCase());
+
+/** Score the built steps' text against the rubric. `stepsText` is label + prompt joined. */
+export function scoreBuilder(stepsText: string, rubric: BuilderRubric): BuilderScoreResult {
+ const checks: BuilderCheck[] = [];
+
+ for (const group of rubric.mustUseAny) {
+ const hit = group.find((k) => has(stepsText, k));
+ checks.push({
+ name: `uses one of: ${group.map((k) => JSON.stringify(k)).join(", ")}`,
+ pass: Boolean(hit),
+ detail: hit ? `found ${JSON.stringify(hit)}` : "none of these appeared in the steps",
+ });
+ }
+
+ for (const bad of rubric.forbidden) {
+ const present = has(stepsText, bad);
+ checks.push({
+ name: `avoids ${JSON.stringify(bad)}`,
+ pass: !present,
+ detail: present ? `forbidden token ${JSON.stringify(bad)} appeared in the steps` : undefined,
+ });
+ }
+
+ // A forbidden-token hit (wrong tool) fails the scenario outright; otherwise the
+ // must-use checks must all pass.
+ const forbiddenHit = checks.some((c) => c.name.startsWith("avoids ") && !c.pass);
+ const passed = checks.filter((c) => c.pass).length;
+ const score = checks.length ? passed / checks.length : 0;
+ return { pass: !forbiddenHit && passed === checks.length, score, checks };
+}
diff --git a/package.json b/package.json
index c531985..11d2fce 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"typecheck": "tsc --noEmit",
"typecheck:evals": "tsc --noEmit -p evals/tsconfig.json",
"eval": "node --experimental-transform-types --no-warnings --import ./evals/register.mjs evals/run.ts",
+ "eval:builder": "node --experimental-transform-types --no-warnings --import ./evals/register.mjs evals/builder/run.ts",
"dist": "vite build && electron-builder",
"start": "electron ."
},