Skip to content

fix: support starter files without a local stack - #553

Open
mattrossman wants to merge 3 commits into
mainfrom
mattrossman/ai-1551-run-spark-evals-with-starter-files-and
Open

mattrossman wants to merge 3 commits into
mainfrom
mattrossman/ai-1551-run-spark-evals-with-starter-files-and

Conversation

@mattrossman

@mattrossman mattrossman commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

(spawned from discussion on #526)

Today, the harness assumes local/ starter files belong to a CLI local-stack eval, so REST and MCP evals can’t use them.

This PR copies local/ files into the workspace independently of local stack setup. Evals now use explicit preinstallCli and startLocalStack frontmatter to opt in to CLI installation and stack startup.

CLI eval with a running stack

 interface: cli
+preinstallCli: true
+startLocalStack: true

CLI eval where the agent starts the stack

 interface: cli
-projectRunning: false
+preinstallCli: true
+# startLocalStack defaults to false

Both setup fields default to false. Existing CLI evals are migrated to preserve their initial setup.

Verified a temporary MCP eval edited a starter file and updated a platform-lite project without starting a local stack, passing both checks (Braintrust trace).

Closes AI-1551

…un-spark-evals-with-starter-files-and

# Conflicts:
#	evals/cli/build-database-002-stack-lifecycle/stack.ts
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Nov 25, 2026 10:14pm UTC

Request Review

@mattrossman

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T20:10:29.759668Z a999775 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a999775a99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mattrossman
mattrossman marked this pull request as ready for review November 25, 2026 21:54
@mattrossman
mattrossman requested review from a team as code owners November 25, 2026 21:54
@mattrossman
mattrossman requested a review from jgoux November 25, 2026 21:54

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, left some feedback inline.

Also noticed that the docs-eval planning checklist in evals/docs/.claude/skills/docs-eval-planning/references/prompt-rules.md still needs preinstallCli and startLocalStack, might be worth a follow-up?

? toIdentifierList(data.services)
: undefined,
projectRunning: data.projectRunning,
preinstallCli: data.preinstallCli,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must fix: flag the old keys before the open eval PRs merge.

This silently drops projectRunning and skipCliInstall, and both defaults flip. Around 20 open eval PRs rely on the old defaults (docs batch #537, #544 to #563, plus #543, #410, #399, #401, #309). They merge without conflicts, so nothing flags the change. Their evals then run with no CLI and no stack, which makes a score drop look like a model regression.

I'd throw a "renamed to" error naming startLocalStack or preinstallCli for the old key, and give the authors a heads-up about both defaults.

`${promptPath}: ships a local/ workspace but declares interface: ${interfaceKind}, expected cli`
);
}
return interfaceKind === 'cli' || preinstallCli ? 'local-stack' : 'tools';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smaller: handle preinstallCli on MCP and REST evals.

The flag switches the eval to a local-stack session. Platform-lite and the remote/ seed never start, and MCP falls back to docs-only unless hostedProject is set. No eval does this yet, but list would schedule a CI pair for spark that the run loop skips, so CI gets no result.

We could restrict the flag to interface: cli. If we keep it independent of interface as the README suggests, I'd have list skip experiments without localStack for these evals too.

sessionArchivePath: sessionArchivePath(expName, ev.id, runIndex),
});
const agentRunEndedAt = Date.now();
const hostWorkspace = cliSandbox

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smaller: skip the workspace copy when the scorer won't use it.

All current experiments use sandboxed agents, so every MCP and REST run now pays for a docker cp. Even an eval with no local/ whose scorer never reads hostWorkspace can fail before scoring if that copy fails.

Gating the copy on ev.localDir would keep the old cost for those runs. Another option is to copy when the scorer first asks for the workspace. The local-stack-only comment at run-vercel-evals.ts:831 needs an update too.

Comment thread README.md
An experiment can pass `localStackRuntime({ env: { SUPABASE_EXPERIMENTAL_STACK: '1' } })` to turn on feature-flagged CLI behaviour for every eval it runs. The eval itself stays flag-agnostic, so once the feature graduates you drop the entry and the eval's history carries on. Names the harness manages itself (`PATH`, `HOME`, `DOCKER_HOST`, hosted-link credentials and so on) are rejected.

Scorers check what the agent produced, never what the harness provisioned: with `projectRunning: true` (the default) the running stack and the seeded `local/` workspace are setup, so score only the deltas the agent made on top; with `projectRunning: false` the agent creates that state itself, so depending on it is fair game.
Scorers check what the agent produced. When `startLocalStack: true`, score changes to the provisioned stack and workspace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smaller: spell out which workspace changes count toward the score.

The harness now copies local/ even when the stack stays off. With the default settings, a scorer author could read this as permission to give the agent credit for a file the harness put there.

Maybe "Starter files from local/ are harness setup, as is the stack when startLocalStack: true. Score only the agent's changes on top."

The frontmatter has no `services:` key. The sandbox shim turns it into
`supabase start -x <container names>`, which the managed stack rejects. With
`projectRunning: false` the harness starts no stack at all — both are the
`startLocalStack` defaults to false the harness starts no stack at all — both are the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: tidy up the wording around the new default.

"With startLocalStack defaults to false the harness starts no stack" reads a little oddly here. The same wording shows up in build-database-002-stack-lifecycle/README.md:95 and build-cli-004-worktree-stacks/README.md:46, and again in investigate-database-001-slow-query/README.md:93.

"With startLocalStack unset, the harness starts no stack" would work here.

rjgtav commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Hi @mattrossman! Thanks for the PR. I've rebased my changes on top of your branch and everything's working correctly. The only remaining tweak I had to do in the framework is to give EVAL access to the agent sandbox, so the EVAL can evaluate the generated app. Do you want to include that in these changes as well? You can find my commit here: #526

const handle = await createBareSandbox({ localDir: seed });
try {
const result = await handle.sandbox.exec(
"printf 'updated' > app.txt"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test still passes if createBareSandbox ignores localDir: printf 'updated' > app.txt creates the file whether or not the starter file was copied in, and the export check only looks for the new value. Could you first check inside the sandbox that app.txt reads starter, then overwrite it?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants