Skip to content

fix(missions): supersede stale generated fix features#1928

Merged
gsxdsm merged 2 commits into
Runfusion:mainfrom
plarson:fix/mission-supersede-stale-fixes
Jul 6, 2026
Merged

fix(missions): supersede stale generated fix features#1928
gsxdsm merged 2 commits into
Runfusion:mainfrom
plarson:fix/mission-supersede-stale-fixes

Conversation

@plarson

@plarson plarson commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Supersedes stale generated fix features when a mission feature is repaired by a fresh generated fix.
  • Records supersede events in mission store state and prevents stale generated fixes from staying active.
  • Adds mission-store and mission-execution-loop coverage for stale generated fix supersession.

Test Plan

  • corepack pnpm --filter @fusion/core vitest packages/core/src/tests/mission-store.test.ts
  • corepack pnpm --filter @fusion/engine vitest packages/engine/src/tests/mission-execution-loop.test.ts
  • corepack pnpm build

Summary by CodeRabbit

  • Bug Fixes
    • Prevented stale generated fix chains from incorrectly remaining active after their source feature has passed validation, ensuring generated fix features and linked tasks are correctly finalized.
    • Improved active mission recovery by reconciling superseded generated fix features per slice and skipping them during recovery iteration.
  • New Features
    • Added slice-level reconciliation for superseded generated fix features, automatically completing them when a passed ancestor is detected.
  • Tests
    • Added/extended unit tests covering validator-driven reconciliation and recovery behavior for stale generated fixes.

Copilot AI review requested due to automatic review settings July 6, 2026 04:56
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: e0ab7842-d8cc-4a71-81ba-b91d5dc573b6

📥 Commits

Reviewing files that changed from the base of the PR and between 3744fbc and 3d60f67.

📒 Files selected for processing (4)
  • packages/core/src/__tests__/mission-store.test.ts
  • packages/core/src/mission-store.ts
  • packages/engine/src/__tests__/mission-execution-loop.test.ts
  • packages/engine/src/mission-execution-loop.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/engine/src/mission-execution-loop.ts
  • packages/engine/src/tests/mission-execution-loop.test.ts
  • packages/core/src/tests/mission-store.test.ts
  • packages/core/src/mission-store.ts

📝 Walkthrough

Walkthrough

This PR adds reconciliation for superseded generated fix features after validator passes and during active mission recovery. It updates mission-store, engine recovery flow, tests, and adds a patch changeset.

Changes

Superseded Generated Fix Reconciliation

Layer / File(s) Summary
Reconciliation method and validator-pass wiring
packages/core/src/mission-store.ts, packages/core/src/__tests__/mission-store.test.ts
Adds reconcileSupersededGeneratedFixFeatures(sliceId) and calls it after passed validator runs; tests verify reconciliation, task unlinking, and slice completion.
Active mission recovery integration
packages/engine/src/mission-execution-loop.ts, packages/engine/src/__tests__/mission-execution-loop.test.ts
Runs slice-level reconciliation before recovery iteration, skips superseded features, and tests the recovery flow with stale generated fixes.
Changeset entry
.changeset/fuzzy-missions-heal.md
Adds a patch changeset for the stale generated fix reconciliation fix.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: gsxdsm

🚥 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 accurately and concisely describes the main change: superseding stale generated fix features in missions.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR cleans up stale generated mission fix work after the source work passes validation. The main changes are:

  • Supersede generated fix descendants when an ancestor feature has passed.
  • Clear stale board-task ownership for superseded mission fix features.
  • Skip newly superseded fixes during active mission recovery.
  • Add focused tests for mission-store reconciliation and recovery behavior.
  • Add a patch changeset for the published package.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
packages/core/src/mission-store.ts Adds generated-fix supersession after successful validation and clears stale feature/task ownership.
packages/engine/src/mission-execution-loop.ts Updates recovery to reconcile superseded generated fixes before processing active slice features.
packages/core/src/tests/mission-store.test.ts Adds tests for generated-fix descendant cleanup and validator-run ordering.
packages/engine/src/tests/mission-execution-loop.test.ts Adds recovery coverage for skipping superseded generated fixes from the stale snapshot.
.changeset/fuzzy-missions-heal.md Adds a patch changeset describing the mission fix cleanup behavior.

Reviews (2): Last reviewed commit: "fix(missions): address generated fix rev..." | Re-trigger Greptile

Comment thread packages/engine/src/mission-execution-loop.ts
Comment thread packages/core/src/mission-store.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents stale generated mission Fix Features from remaining active once an ancestor/source feature has passed validation, by reconciling (superseding) obsolete generated-fix chains both at validator-pass time (core) and during active-mission recovery (engine).

Changes:

  • Add MissionStore.reconcileSupersededGeneratedFixFeatures(sliceId) and invoke it when a validator run completes with passed.
  • Invoke supersession reconciliation during MissionExecutionLoop.recoverActiveMissions() for active slices to clean up stale fix chains during recovery.
  • Add core mission-store tests for supersession behavior, plus a changeset for @runfusion/fusion.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/engine/src/mission-execution-loop.ts Runs superseded-fix reconciliation during active mission recovery.
packages/engine/src/tests/mission-execution-loop.test.ts Extends the mock mission store to include the new reconciliation method.
packages/core/src/mission-store.ts Implements reconciliation of superseded generated-fix features and triggers it on validator pass.
packages/core/src/tests/mission-store.test.ts Adds tests covering supersession of generated-fix descendants and pass-triggered reconciliation.
.changeset/fuzzy-missions-heal.md Publishes a patch changeset describing the behavior change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/mission-store.ts
Comment thread packages/engine/src/mission-execution-loop.ts
Comment thread packages/engine/src/mission-execution-loop.ts

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/src/mission-store.ts`:
- Around line 3214-3220: The superseded-fix handling in updateFeature is leaving
the linked task active even after the feature is marked done/passed. In the
supersededFeatureIds loop inside mission-store.ts, extend the cleanup performed
by updateFeature so it also clears task ownership by removing taskId, or
otherwise reuses the same unlink/archive behavior used by unlinkFeatureFromTask
and deleteFeature. Make sure the feature no longer keeps a live board task
attached once it is superseded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f94ff74f-db8e-4164-8dbf-f396f507248a

📥 Commits

Reviewing files that changed from the base of the PR and between 6c9989c and 3744fbc.

📒 Files selected for processing (5)
  • .changeset/fuzzy-missions-heal.md
  • packages/core/src/__tests__/mission-store.test.ts
  • packages/core/src/mission-store.ts
  • packages/engine/src/__tests__/mission-execution-loop.test.ts
  • packages/engine/src/mission-execution-loop.ts

Comment thread packages/core/src/mission-store.ts Outdated
@gsxdsm gsxdsm merged commit e973ed5 into Runfusion:main Jul 6, 2026
7 checks passed
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