Skip to content

feat: run comparison - merged graph & change summary logic - #2597

Merged
camielvs merged 1 commit into
masterfrom
cmp-02-graph-summary-logic
Aug 19, 2026
Merged

feat: run comparison - merged graph & change summary logic#2597
camielvs merged 1 commit into
masterfrom
cmp-02-graph-summary-logic

Conversation

@camielvs

@camielvs camielvs commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Second PR in the Compare Runs stack. Builds two more pieces of logic on top of the diff engine — still no UI.

  • Merged graph — takes the task/input/output diffs and turns them into a single combined graph that overlays both runs. Every task, input and output from either run becomes one node, and every connection is tagged as belonging to run A only, run B only, or both. This is what the Graph tab later renders.
  • Change summaries — small helpers that turn a task or input/output diff into a short human caption (e.g. "component · 2 arguments · cache disabled", or "source rewired") for use as subdued labels on graph nodes.

Related Issue and Pull requests

Part of the Compare Runs stack. Builds on #2596; the next PR (#2598) builds on this branch.

Type of Change

  • New feature

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Test Instructions

Pure logic, no standalone UI.

  • Run the unit tests: npm run test -- buildMergedGraph summarizeChange
  • Coverage includes unioning tasks from both runs into single nodes, tagging edges as A-only / B-only / shared, dropping edges to unknown tasks, wiring input→task→output edges, rewired outputs, and the wording of the change summaries.

To see it end-to-end, check out the top of the stack (#2603), enable the Compare runs flag, and open the Graph tab of a comparison.

Additional Comments

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: cmp-02-graph-summary-logic/355f371

@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from b799ace to dbfea62 Compare July 31, 2026 00:24
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from 8c0a61b to 2d2c65a Compare July 31, 2026 00:24
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from dbfea62 to ec52e0b Compare August 14, 2026 18:17
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from 2d2c65a to 115570a Compare August 14, 2026 18:17
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from ec52e0b to f4272b7 Compare August 14, 2026 19:07
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch 2 times, most recently from 160bb74 to cfcc893 Compare August 14, 2026 21:01
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from f4272b7 to 0577e9a Compare August 14, 2026 21:01
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from cfcc893 to 186b9c5 Compare August 14, 2026 23:47
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from 0577e9a to 5f5b90c Compare August 14, 2026 23:47
Comment thread src/routes/v2/pages/CompareView/utils/summarizeChange.ts Outdated
Comment thread src/routes/v2/pages/CompareView/utils/summarizeChange.ts Outdated
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from 186b9c5 to ce6f309 Compare August 17, 2026 20:01
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch 2 times, most recently from 0fc0811 to 5f39e5d Compare August 17, 2026 23:03
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from ce6f309 to 06a5da8 Compare August 17, 2026 23:03
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from 5f39e5d to d28657f Compare August 18, 2026 00:44
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from 06a5da8 to be013a9 Compare August 18, 2026 00:44
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from be013a9 to e7623f8 Compare August 18, 2026 00:56
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from d28657f to 10263af Compare August 18, 2026 00:56
@camielvs
camielvs marked this pull request as ready for review August 18, 2026 01:20
@camielvs
camielvs requested a review from a team as a code owner August 18, 2026 01:20
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from 10263af to bce2375 Compare August 18, 2026 21:00
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch from e7623f8 to 1e002d5 Compare August 18, 2026 21:00
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from bce2375 to ca98738 Compare August 18, 2026 21:59
@camielvs
camielvs force-pushed the cmp-01-diff-engine branch 2 times, most recently from 54c5d66 to b4b8a6f Compare August 19, 2026 20:50
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from ca98738 to 3149ff2 Compare August 19, 2026 20:50

camielvs commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Aug 19, 9:01 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 19, 9:02 PM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 19, 9:06 PM UTC: @camielvs merged this pull request with Graphite.

@camielvs
camielvs changed the base branch from cmp-01-diff-engine to graphite-base/2597 August 19, 2026 21:01
camielvs added a commit that referenced this pull request Aug 19, 2026
## Description

First PR in the **Compare Runs** stack. Adds the core engine that diffs two pipeline runs — no UI yet, just the logic everything else builds on.

Given two runs it aligns their tasks by id and works out, for each one, whether it was added, removed, changed, or unchanged. "Changed" covers a different component version, different arguments, different annotations, or a flipped cache setting. Pipeline inputs and outputs are compared the same way (including detecting when an output was rewired to a different task). Layout-only editor annotations (node positions, colours, etc.) are stripped out first so they don't show up as noise.

It also tracks per-task execution outcome, so a task whose spec is identical but that succeeded in one run and failed in the other is still flagged as "outcome differs".

A small helper for loading a single run's spec and execution status (`useRunComparisonSide`) and a shared `buildTaskExecutionStatusMap` util round out the PR.

## Related Issue and Pull requests

<!-- Link to any related issues using the format #<issue-number> -->

Part of the Compare Runs stack. Branches off `master`; the next PR (#2597) builds on this branch.

## Type of Change

- [x] New feature

## Checklist

<!-- Please ensure the following are completed before submitting the PR -->

- [ ] I have tested this does not break current pipelines / runs functionality
- [ ] I have tested the changes on staging

## Screenshots (if applicable)

<!-- No visual changes in this PR — it is logic only. -->

## Test Instructions

This PR is pure logic and ships behind the (not-yet-added) `compare-runs` flag, so there's nothing to click through on its own.

- Run the unit tests: `npm run test -- comparePipelines`
- The suite covers added/removed/changed/unchanged tasks, argument and annotation diffs, cache changes, outcome differences, input/output alignment and rewired outputs.

To exercise it in the real UI, check out the top of the stack (#2603), enable the **Compare runs** beta flag, and compare two runs.

## Additional Comments

<!-- Add any additional context or information that reviewers might need to know regarding this PR -->
@camielvs
camielvs changed the base branch from graphite-base/2597 to master August 19, 2026 21:01
@camielvs
camielvs force-pushed the cmp-02-graph-summary-logic branch from 3149ff2 to 355f371 Compare August 19, 2026 21:01
@camielvs
camielvs merged commit adaf00b into master Aug 19, 2026
16 of 17 checks passed
@camielvs
camielvs deleted the cmp-02-graph-summary-logic branch August 19, 2026 21:06
camielvs added a commit that referenced this pull request Aug 19, 2026
## Description

Third PR in the **Compare Runs** stack. Adds the small, shared UI building blocks that the later comparison views reuse, so they stay consistent. Nothing here is wired into a page yet.

- **CompareRunPicker** — a list of recent runs used to pick a run for either side of the comparison.
- **DiffStatusBadge** — the coloured Added / Removed / Changed / Unchanged badge.
- **RunTag / RunTags** — the small "A" / "B" pills that mark which run a value belongs to.
- **FieldDiffRow** — a single field's before/after values with expand-to-see-more for long values.
- **YamlDiffView** — a side-by-side YAML diff of the two run specs (Monaco diff editor).

## Related Issue and Pull requests

<!-- Link to any related issues using the format #<issue-number> -->

Part of the Compare Runs stack. Builds on #2597; the next PR (#2599) builds on this branch.

## Type of Change

- [x] New feature

## Checklist

<!-- Please ensure the following are completed before submitting the PR -->

- [ ] I have tested this does not break current pipelines / runs functionality
- [ ] I have tested the changes on staging

## Screenshots (if applicable)

<!-- Add screenshots of the diff badge, run tags, field diff row and YAML diff once wired up. -->

## Test Instructions

These are shared presentational components with no entry point of their own on this branch. They're exercised through the full feature.

- Check out the top of the stack (#2603) and enable the **Compare runs** beta flag (Settings → Beta features).
- Compare two runs and confirm the status badges, A/B run tags and field rows render correctly, and that the YAML tab shows a readable side-by-side diff.

## Additional Comments

<!-- Add any additional context or information that reviewers might need to know regarding this PR -->
camielvs added a commit that referenced this pull request Aug 19, 2026
## Description

Seventh PR in the **Compare Runs** stack. Adds the **Graph** view — a visual, side-by-side-in-one-canvas take on the comparison.

It renders the merged graph (from #2597) with colour-coded nodes and edges: green for added, red for removed, amber for changed, grey for unchanged, plus a legend. Nodes show each task's status, digest and a short change summary; clicking one opens a detail popover reusing the same task/IO diff detail from the Structured view. A **Highlight A / B / Both** control dims everything not present in the chosen run and switches nodes to show that run's actual values.

Also refactors the run view's status indicator to extract a reusable `StatusTab` so the merged task nodes can show per-run (A/B) status tabs.

## Related Issue and Pull requests

<!-- Link to any related issues using the format #<issue-number> -->

Part of the Compare Runs stack. Builds on #2601; the final PR (#2603) builds on this branch.

## Type of Change

- [x] New feature
- [x] Cleanup/Refactor

## Checklist

<!-- Please ensure the following are completed before submitting the PR -->

- [ ] I have tested this does not break current pipelines / runs functionality
- [ ] I have tested the changes on staging

## Screenshots (if applicable)

<!-- Add screenshots of the graph tab: the merged graph with legend, a node detail popover, and the A/B highlight modes. -->

## Test Instructions

Reachable once the stack is wired up (#2603).

- Check out the top of the stack, enable the **Compare runs** beta flag, and compare two runs.
- On the **Graph** tab, confirm:
  - The merged graph lays out and node/edge colours match the legend (added / removed / changed / unchanged).
  - Clicking a node opens its detail popover; clicking the background closes it.
  - **Highlight A / B / Both** dims the other run and shows the highlighted run's values.
- Regression check the refactor: open a normal run's graph and confirm task status indicators (including the cache-disabled state) still render as before.

## Additional Comments

<!-- Add any additional context or information that reviewers might need to know regarding this PR -->
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