Skip to content

test(execute): cover input_set_ids merge edge cases for full pipeline inputs#576

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-4472
Draft

test(execute): cover input_set_ids merge edge cases for full pipeline inputs#576
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-4472

Conversation

@cursor

@cursor cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Adds regression tests for the harness_execute pipeline run path introduced in #575, where input_set_ids must be merged into the request body when callers pass full pipeline YAML (string or object) as inputs.

Risky behavior now covered

  • Stage-level variable merge: input set stage variables are merged with caller overrides; caller wins on conflict, input-set-only variables are retained.
  • Multiple input_set_ids + full pipeline override: later input sets override earlier ones, then caller inputs override the merged base.
  • Input set load failure: returns a clear error instead of silently falling back to the ignored inputSetIdentifiers query param.
  • Bare pipeline fragment YAML (no top-level pipeline: wrapper): extractPipelineFragment unwraps correctly before merge.
  • Disjoint variable union in mergeRuntimePipelineFragments: both base and override variables appear in the merged body.

Test files added/updated

  • tests/tools/tool-handlers.test.ts — 4 new harness_execute integration tests
  • tests/utils/materialize-input-sets.test.ts — 1 new unit test for disjoint variable merge

Why these tests materially reduce regression risk

PR #575 added two happy-path tests (string and object full pipeline inputs). The new paths exercise stage merging, multi-set ordering, error handling, and bare-fragment parsing — all areas with non-trivial logic in mergeRuntimePipelineFragments / extractPipelineFragment that previously had no integration coverage. A regression would cause input sets to be dropped at execution time without obvious client-side errors.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other — test coverage

Checklist

  • pnpm test passes (156 tests in touched files)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes
Open in Web View Automation 

thisrohangupta and others added 2 commits July 7, 2026 15:58
Running a pipeline via harness_execute with input_set_ids plus a full
pipeline document in `inputs` (either a YAML string or an object with a
top-level `pipeline` key) silently dropped the input set: the
materialization guard only admitted empty or flat key/value inputs, so
these fell through to the `inputSetIdentifiers` query param, which
pipeline execute ignores. The run proceeded without the input set applied.

Broaden the guard to also handle full-pipeline inputs, and merge the
materialized input set as the base with the caller's document as the
override (caller wins per variable / stage), sending the result as the
YAML execute body — the same mechanism the working UI path uses.

Adds tests for both the YAML-string and object input forms.

Note: pipeline_v1 still accepts input_set_ids in the shared schema
without forwarding them; left as-is pending confirmation of the v1
execute API's input-set contract.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

AI-Session-Id: b8e26a07-057c-406c-bfde-245eb0c917ae
AI-Tool: claude-code
AI-Model: unknown
… inputs

Add regression tests for stage-level variable merging, multiple input set
ordering, bare YAML fragments, and input set load failures when callers
pass full pipeline documents alongside input_set_ids.

Complements fix in PR #575 by exercising mergeRuntimePipelineFragments
paths that were previously untested at the harness_execute integration layer.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ thisrohangupta
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants