Skip to content

Build Compound Engineering plugin dist before its tests (fix Full Suite) - #1688

Merged
gsxdsm merged 1 commit into
mainfrom
fix/compound-engineering-dist-freshness
Jun 20, 2026
Merged

Build Compound Engineering plugin dist before its tests (fix Full Suite)#1688
gsxdsm merged 1 commit into
mainfrom
fix/compound-engineering-dist-freshness

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

What & why

The non-blocking Full Suite has been red on every main commit for days (visible on the post-merge runs for #1686, #1687, and earlier). Root cause is a single test, unrelated to those PRs:

plugins/fusion-plugin-compound-engineering/src/__tests__/dist-freshness.test.ts reads the plugin's compiled output — dist/settings.js and dist/session/orchestrator.js — to guard against shipping stale dist (FN-6596). But:

  • the plugin had no pretest build, and
  • it was absent from scripts/ensure-test-artifacts.mjs (the registry that builds required dist artifacts before tests).

So on a fresh CI checkout dist/ doesn't exist and the guard throws dist/ is missing — run pnpm build first, failing test shard 4/4.

Fix

Mirror exactly how the other bundled plugins (dependency-graph, hermes, openclaw, paperclip) handle the same dist-before-test requirement:

  • Register the plugin's required artifacts + source inputs in ensure-test-artifacts.mjs.
  • Add "pretest": "node ../../scripts/ensure-test-artifacts.mjs" to the plugin so its dist is built (and freshness-cached) before vitest runs.

Verification

With dist/ absent locally (the exact CI scenario), pnpm --filter @fusion-plugin-examples/compound-engineering test now builds the dist via the new pretest and all 192 plugin tests pass, including the two dist-freshness cases that were failing.

🤖 Generated with Claude Code


Open in Stage

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a persistent test failure in the Compound Engineering plugin that occurred on fresh repository checkouts by ensuring required build artifacts are properly generated before tests run.

dist-freshness.test.ts reads the plugin's compiled dist/settings.js and
dist/session/orchestrator.js to guard against stale dist (FN-6596), but the
plugin had no pretest build and was missing from ensure-test-artifacts.mjs.
On a fresh CI checkout dist/ does not exist, so the guard threw "dist/ is
missing" — failing the non-blocking Full Suite on every main commit.

Register the plugin's required artifacts in ensure-test-artifacts.mjs and add
a `pretest` hook that builds them, matching the dependency-graph / hermes /
openclaw plugins. Verified locally: with dist/ absent, `pnpm --filter
@fusion-plugin-examples/compound-engineering test` now builds dist via the
pretest and all 192 plugin tests pass (incl. the two dist-freshness cases).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ghost

ghost commented Jun 20, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 3 individual chapters for you:

Title
1 Register Compound Engineering artifacts for test builds
2 Add pretest hook to build plugin artifacts
3 Document fix with a changeset
Open in Stage

Chapters generated by Stage for commit 8b5b9a7 on Jun 20, 2026 3:48am UTC.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d1efa156-922f-4b7f-9bd2-e4a2c67f7027

📥 Commits

Reviewing files that changed from the base of the PR and between a9b65ac and 8b5b9a7.

📒 Files selected for processing (3)
  • .changeset/fix-compound-engineering-dist-freshness.md
  • plugins/fusion-plugin-compound-engineering/package.json
  • scripts/ensure-test-artifacts.mjs

📝 Walkthrough

Walkthrough

Adds @fusion-plugin-examples/compound-engineering to REQUIRED_BUILD_PACKAGES in ensure-test-artifacts.mjs with its required dist/ artifacts and source staleness glob. Wires a pretest script in the plugin's package.json to invoke this script before tests run. A changeset patch entry documents the fix.

Changes

Compound Engineering dist-freshness fix

Layer / File(s) Summary
Register dist artifacts and add pretest hook
scripts/ensure-test-artifacts.mjs, plugins/fusion-plugin-compound-engineering/package.json, .changeset/fix-compound-engineering-dist-freshness.md
REQUIRED_BUILD_PACKAGES gains an entry for @fusion-plugin-examples/compound-engineering requiring dist/settings.js and dist/session/orchestrator.js, with plugins/fusion-plugin-compound-engineering/src as the staleness source. The plugin's package.json adds a pretest script invoking ensure-test-artifacts.mjs. A changeset patch entry records the fix.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Runfusion/Fusion#1423: Also targets the Compound Engineering plugin's dist/ artifacts — that PR updates bundling configuration (BUNDLED_PLUGIN_IDS, tsup staging) to package those outputs, while this PR ensures they are built and validated before tests run.

Poem

🐇 Hop hop, the dist/ was bare,
Fresh checkouts left nothing there!
Now pretest builds the needed files,
The freshness guard no longer riles.
With artifacts registered just right,
The CI suite runs green tonight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: adding a build step before tests for the Compound Engineering plugin to fix Full Suite failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compound-engineering-dist-freshness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gsxdsm
gsxdsm merged commit 82fa537 into main Jun 20, 2026
5 of 6 checks passed
@gsxdsm
gsxdsm deleted the fix/compound-engineering-dist-freshness branch June 20, 2026 03:49
@greptile-apps

greptile-apps Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a persistent CI failure in the Full Suite by registering fusion-plugin-compound-engineering in ensure-test-artifacts.mjs and adding a pretest hook to its package.json, ensuring the plugin's dist/ is built before dist-freshness.test.ts runs on a fresh checkout.

  • scripts/ensure-test-artifacts.mjs: Adds a new entry for @fusion-plugin-examples/compound-engineering with the two compiled artifacts (dist/settings.js, dist/session/orchestrator.js) and a staleAgainstGlobs pointing to the plugin's src/, matching the shape of the existing plugin entries (hermes, openclaw, paperclip, dependency-graph).
  • plugins/fusion-plugin-compound-engineering/package.json: Adds "pretest": "node ../../scripts/ensure-test-artifacts.mjs" so running the plugin's tests in isolation also triggers a dist build — identical to fusion-plugin-dependency-graph's setup.
  • .changeset/fix-compound-engineering-dist-freshness.md: Adds a patch-level changeset documenting the fix.

Confidence Score: 5/5

Safe to merge — a targeted CI fix with no logic changes to production code.

The change adds one registry entry and one lifecycle script, both matching the established pattern used by fusion-plugin-dependency-graph. The artifact paths in ensure-test-artifacts.mjs exactly match what dist-freshness.test.ts reads, the package name matches package.json, and the pretest hook is identical in form to the only other plugin with the same requirement. No production code is touched.

No files require special attention.

Important Files Changed

Filename Overview
scripts/ensure-test-artifacts.mjs Adds compound-engineering to REQUIRED_BUILD_PACKAGES with the two dist artifacts the freshness test reads; follows the identical shape of all existing plugin entries.
plugins/fusion-plugin-compound-engineering/package.json Adds pretest hook that runs ensure-test-artifacts.mjs before vitest, matching fusion-plugin-dependency-graph's package.json exactly.
.changeset/fix-compound-engineering-dist-freshness.md Patch-level changeset with a clear description of the root cause and fix; no issues.

Reviews (1): Last reviewed commit: "Build Compound Engineering plugin dist b..." | Re-trigger Greptile

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.

1 participant