Skip to content

feat: add durable plan sharding - #204

Merged
joshblack merged 7 commits into
mainfrom
feat/add-plan-sharding
Sep 4, 2026
Merged

feat: add durable plan sharding#204
joshblack merged 7 commits into
mainfrom
feat/add-plan-sharding

Conversation

@joshblack

@joshblack joshblack commented Sep 4, 2026

Copy link
Copy Markdown
Member

Follow up to #203.

This PR adds a durable execution plan that can be created once, shared across jobs, and replayed without rebuilding trial order. Plans store stable trial IDs plus the scenario, treatment, model, and benchmark capability references needed to resolve each trial from the current configuration.

The benchmark and experiment workflows now use the same four-shard flow: create plan.json, run each shard from that plan into output-{shard}.json, then combine those manifests into the standard portable output.json. The merge keeps the existing per-trial file references instead of reading and rewriting every trial result, which keeps the shard handoff small and works with the split output layout from #212.

This is the fifth entry in stack 214. #199 adds the benchmark scenarios last.

Changelog

New

  • Add --plan [path] and --from-plan [path] CLI modes.
  • Add --shard <order/total> for deterministic plan sharding.
  • Add --merge-results with --output-dir for combining output-*.json manifests.
  • Export durable plan schemas, types, serialization, resolution, and selection APIs.

Changed

  • Update shard runs to write output-{shard}.json manifests that reference split trial result files.
  • Update shard merging to validate and combine manifests without reading or rewriting per-trial JSON files.
  • Update the benchmark and experiment runner scripts with matching plan, shard, and merge modes.
  • Update both Actions workflows to create one plan, run four shards, and retain one merged result bundle.

Removed

  • None.

@joshblack joshblack changed the title feat/add plan sharding feat: add durable plan sharding Sep 4, 2026
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 6efd88a to 582745a Compare September 4, 2026 01:42
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 582745a to 671a436 Compare September 4, 2026 02:06
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 671a436 to 4b66a91 Compare September 4, 2026 02:17
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 4b66a91 to cc5f88c Compare September 4, 2026 02:33
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from cc5f88c to 9e8d108 Compare September 4, 2026 02:34
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 9e8d108 to 601b11f Compare September 4, 2026 02:44
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 601b11f to 1ed8a3d Compare September 4, 2026 02:48
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 1ed8a3d to d895d50 Compare September 4, 2026 02:49
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from d895d50 to 1e2e5a8 Compare September 4, 2026 03:32
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch 2 times, most recently from dc8028e to 418abef Compare September 4, 2026 03:48
@joshblack
joshblack marked this pull request as ready for review September 4, 2026 04:11
Copilot AI lite review requested due to automatic review settings September 4, 2026 04:11
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 04fed6b to 67cdf44 Compare September 4, 2026 04:13

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The experiment workflow’s merge job is missing a dependency install step (and inconsistent pnpm setup), which is likely to break CI execution.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 High severity

New issues introduced by this change (1)
Severity Finding
High severity .github/​workflows/​experiment.yml — The experiment workflow merge job runs pnpm run build without installing dependencies, and it…

Comment on lines +120 to +130
- name: set up pnpm
uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0
with:
cache: true
require-lockfile: true
- name: set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: '.nvmrc'
- name: build project
run: pnpm run build
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 9b90d80 to 6bd0145 Compare September 4, 2026 04:34
Copilot AI review requested due to automatic review settings September 4, 2026 04:38
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from 6bd0145 to f25acb0 Compare September 4, 2026 04:38
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from f25acb0 to c673f37 Compare September 4, 2026 04:41
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from c673f37 to a727bd5 Compare September 4, 2026 04:43

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The experiment workflow’s merge job is missing a dependency install step and is inconsistent with the pnpm setup used in the other jobs, which is likely to break CI.

Review tier: Lite
Findings: 1 High severity

Pre-existing issues (1)
Severity Finding
High severity .github/​workflows/​experiment.yml — The experiment workflow merge job runs pnpm run build without installing dependencies, and it… View comment
Suppressed comments (1)

.github/workflows/experiment.yml:129

  • The merge job builds without installing dependencies, and it uses pnpm/setup (v2) while the other jobs use pnpm/action-setup. This will likely fail at pnpm run build and makes the workflow inconsistent across jobs; align the merge job with the plan/run jobs by using pnpm/action-setup, enabling pnpm caching on setup-node, and running pnpm install --frozen-lockfile before the build.
      - name: set up Node.js
        uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
        with:
          node-version-file: '.nvmrc'
      - name: build project

Copilot AI review requested due to automatic review settings September 4, 2026 04:44
Base automatically changed from feat/add-experiment-runner-script to main September 4, 2026 04:45
joshblack and others added 7 commits September 3, 2026 23:47
Add reusable plan artifacts, deterministic shard execution, result merging, and four-way benchmark and experiment workflows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6d12a97a-b8d3-45ad-a09a-3c76d1411705
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7eb8999b-2277-4d41-915f-fb35cac43373
Use output directories to derive shard manifest names, rename the merge CLI mode, and keep result merging with durable plan logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2a354dad-88d9-4648-85d5-0a48ff1f03cf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep parent directory creation for plan and merged outputs without redundant existence checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 983b31cf-cd77-4cfe-854f-3c7fb34543a1
@joshblack
joshblack force-pushed the feat/add-plan-sharding branch from a727bd5 to 4c9bb02 Compare September 4, 2026 04:47
@joshblack
joshblack merged commit c02b5e6 into main Sep 4, 2026
8 checks passed
@joshblack
joshblack deleted the feat/add-plan-sharding branch September 4, 2026 04:48

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The experiment workflow’s merge job uses a different pnpm setup path than the plan/run jobs, which risks inconsistent pnpm behavior between shards and merge.

Review tier: Lite
Findings: 1 High severity

Pre-existing issues (1)
Severity Finding
High severity .github/​workflows/​experiment.yml — The experiment workflow merge job runs pnpm run build without installing dependencies, and it… View comment
Suppressed comments (1)

.github/workflows/experiment.yml:124

  • The merge job uses pnpm/setup while the plan/run jobs use pnpm/action-setup + setup-node pnpm caching. Mixing pnpm setup actions in the same workflow can lead to different pnpm versions/install behavior between shards and the merge job, which risks non-reproducible merges or unexpected failures when the action defaults change. Consider aligning the merge job to the same pnpm+Node setup pattern as the other jobs (including explicit pnpm install --frozen-lockfile).
      - name: set up pnpm
        uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0
        with:
          cache: true
          require-lockfile: true

Copilot AI review requested due to automatic review settings September 4, 2026 04:50

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The updated experiment workflow merge job is likely to fail on clean runners (missing dependency installation and inconsistent pnpm setup), and shard-merge should validate trial reference paths before producing a merged manifest.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 High severity · 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity packages/​agent-eval/​src/​plan.tsmergeTrialReferences currently accepts trial file references verbatim. A shard output that…
Pre-existing issues (1)
Severity Finding
High severity .github/​workflows/​experiment.yml — The experiment workflow merge job runs pnpm run build without installing dependencies, and it… View comment
Suppressed comments (1)

.github/workflows/experiment.yml:130

  • The experiment workflow merge job runs pnpm run build without installing dependencies, and it uses pnpm/setup while the other jobs use pnpm/action-setup + setup-node pnpm cache. This is likely to fail in a clean runner because node_modules will be missing.
      - name: set up pnpm
        uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0
        with:
          cache: true
          require-lockfile: true
      - name: set up Node.js
        uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
        with:
          node-version-file: '.nvmrc'
      - name: build project
        run: pnpm run build

Comment on lines +237 to 245
function mergeTrialReferences(target: Record<string, string>, source: Record<string, string>): void {
for (const [trialId, reference] of Object.entries(source)) {
if (trialId in target) {
throw new Error(`Cannot merge duplicate trial id: ${trialId}`)
}

target[trialId] = reference
}
}
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.

2 participants