Skip to content

fix(ci): green full-suite reds and drop low-signal engine tests - #2448

Open
gsxdsm wants to merge 5 commits into
mainfrom
feature/speed-up-ci
Open

fix(ci): green full-suite reds and drop low-signal engine tests#2448
gsxdsm wants to merge 5 commits into
mainfrom
feature/speed-up-ci

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix the always-red full-suite failure in starved-refinement-x-triage-poll by giving peer-progress todos real PROMPT.md files so they do not re-enter planning FIFO ahead of the starved refinement.
  • Delete expired quarantine / value-audit low-signal engine tests (~34s of always-running wall-clock from timings snapshot) and clear exclude-list drift so only executor-task-done-invariant remains ledger-locked.
  • Re-home FN-5743 hard-cancel merge-request coverage on the real PostgreSQL moveTask path plus a focused maybeRetryTransientMerge unit test (sync SQLite TaskStore is gone).
  • Collapse SettingsModal waitForSettingsModalReady into a single assertion body (no timeout/worker appeasement).

Test plan

  • pnpm test:gate (exit 0)
  • pnpm --filter @fusion/engine exec vitest run --project=engine-reliability (102 files / 517 tests pass)
  • starved-refinement, hard-cancel PG, and maybe-retry scoped vitest runs pass
  • pnpm check:quarantine-ledger + check-no-test-timeout-appeasement clean
  • Confirm full-suite shard that previously failed on starved-refinement is green on this branch

Summary by CodeRabbit

  • Bug Fixes

    • Improved task workflow transitions when cancelling an in-review merge request.
    • User-initiated cancellations now correctly clear pending completion handoffs, while automated retries preserve them.
    • Improved reliability of transient merge retries and task status updates.
  • Reliability

    • Strengthened validation for merge, branch, workspace, and shared-branch workflows.
    • Improved test scheduling and handling of planning-task prompts for more consistent automation.

@coderabbitai

coderabbitai Bot commented Jul 26, 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: c996190e-fc06-4e22-a2d4-5cd2c331a2e2

📥 Commits

Reviewing files that changed from the base of the PR and between 715cf03 and 659f612.

📒 Files selected for processing (2)
  • packages/core/src/__tests__/postgres/hard-cancel-merge-request.pg.test.ts
  • packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/engine/src/tests/maybe-retry-transient-merge.test.ts
  • packages/core/src/tests/postgres/hard-cancel-merge-request.pg.test.ts

📝 Walkthrough

Walkthrough

The PR adds PostgreSQL and engine coverage for merge-request cancellation and transient retry behavior, stabilizes a polling test fixture, refreshes Vitest exclusions, consolidates dashboard test waiting, and removes multiple obsolete engine test suites.

Changes

Test coverage and maintenance

Layer / File(s) Summary
Merge-request state coverage
packages/core/src/__tests__/postgres/hard-cancel-merge-request.pg.test.ts, packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts
Adds coverage for user hard-cancel versus engine rebound behavior, completion handoff markers, and transient merge retry scheduling.
Reliability fixtures, exclusions, and retired suites
packages/engine/src/__tests__/reliability-interactions/starved-refinement-x-triage-poll.test.ts, packages/engine/vitest.config.ts, packages/engine/src/__tests__/*
Adds peer PROMPT.md fixtures, updates reliability and slow-test exclusion rules, and removes obsolete branch-conflict, merger, branch-group, self-healing, lease, and worktree test suites.
Settings modal readiness wait
packages/dashboard/app/components/__tests__/SettingsModal.test-harness.tsx
Combines fetch-start and loading-state assertions into one polling callback.

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

Possibly related PRs

🚥 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 matches the main themes of the PR: unblocking CI and removing low-signal engine tests.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/speed-up-ci

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 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restructures and trims CI test coverage.

  • Adds PostgreSQL hard-cancel coverage and a focused transient-merge retry unit test.
  • Repairs the starved-refinement fixture and simplifies SettingsModal readiness synchronization.
  • Removes expired engine test suites and cleans their Vitest exclusions.

Confidence Score: 3/5

The PR should not merge until the PostgreSQL hard-cancel regression is restored to a merge-blocking test lane.

The new hard-cancel suite exercises the live PostgreSQL store path, but the current test:pg-gate script still omits it, so a regression can pass the PR gate and be detected only after merge by the non-blocking full suite.

Files Needing Attention: packages/core/src/tests/postgres/hard-cancel-merge-request.pg.test.ts and packages/core/package.json

Important Files Changed

Filename Overview
packages/core/src/tests/postgres/hard-cancel-merge-request.pg.test.ts Adds real PostgreSQL coverage for user hard-cancel and engine rebound behavior.
packages/engine/src/tests/maybe-retry-transient-merge.test.ts Adds focused fake-timer coverage for transient merge-request requeue and scheduled retry behavior.
packages/engine/src/tests/reliability-interactions/starved-refinement-x-triage-poll.test.ts Gives peer-progress fixtures real prompts so they do not re-enter planning ahead of the starved refinement.
packages/engine/vitest.config.ts Removes exclusions corresponding to deleted expired-quarantine suites.
packages/dashboard/app/components/tests/SettingsModal.test-harness.tsx Combines modal fetch-start and loading-complete readiness checks into one wait loop.

Reviews (4): Last reviewed commit: "fix(ci): keep PG gate canaries at two fi..." | Re-trigger Greptile

@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: 2

🧹 Nitpick comments (1)
packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts (1)

12-37: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Verify that retry scheduling is exercised, not only state mutation.

internalEnqueueMerge is stubbed but never asserted. If this method owns scheduling, a regression could leave the merge request queued with no retry work enqueued while the test still passes. Assert the callback with the expected task ID, or document that scheduling is owned elsewhere.

🤖 Prompt for 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.

In `@packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts` around
lines 12 - 37, Update the transient merge retry test around
ProjectEngine.prototype.maybeRetryTransientMerge to assert that the injected
internalEnqueueMerge callback is invoked with the expected task ID "FN-5743".
Keep the existing queued-state and moveTask assertions, ensuring the test
verifies both state transition and retry scheduling.
🤖 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/__tests__/postgres/hard-cancel-merge-request.pg.test.ts`:
- Around line 1-12: Move the detailed bug-spec planning from the comments in
packages/core/src/__tests__/postgres/hard-cancel-merge-request.pg.test.ts lines
1-12 and packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts lines
1-6 into their associated PROMPT.md files. Add both Symptom Verification and
Surface Enumeration sections to each PROMPT.md, preserving the relevant test
scenarios; leave only concise FNXC context and executable assertions in the
TypeScript files.
- Around line 45-52: Add an assertion in the “cancels pending merge request on
user in-review→todo hard-cancel” test using the existing store/taskId setup to
verify the persisted task state is “todo” after moveTask completes, while
preserving the existing merge-request and marker assertions.

---

Nitpick comments:
In `@packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts`:
- Around line 12-37: Update the transient merge retry test around
ProjectEngine.prototype.maybeRetryTransientMerge to assert that the injected
internalEnqueueMerge callback is invoked with the expected task ID "FN-5743".
Keep the existing queued-state and moveTask assertions, ensuring the test
verifies both state transition and retry scheduling.
🪄 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: add16b57-0e7a-46ee-bf43-8ebdf08b4614

📥 Commits

Reviewing files that changed from the base of the PR and between f1a2029 and 5223756.

📒 Files selected for processing (21)
  • packages/core/src/__tests__/postgres/hard-cancel-merge-request.pg.test.ts
  • packages/dashboard/app/components/__tests__/SettingsModal.test-harness.tsx
  • packages/engine/src/__tests__/branch-conflicts-ghost-references.test.ts
  • packages/engine/src/__tests__/branch-conflicts-zero-unique.test.ts
  • packages/engine/src/__tests__/maybe-retry-transient-merge.test.ts
  • packages/engine/src/__tests__/merger-ai-dependency-install.slow.test.ts
  • packages/engine/src/__tests__/merger-autostash-orphan-surface.test.ts
  • packages/engine/src/__tests__/merger-empty-cherry-pick-fallback.test.ts
  • packages/engine/src/__tests__/reliability-interactions/branch-group-automerge-precedence.slow.test.ts
  • packages/engine/src/__tests__/reliability-interactions/branch-group-merge-routing.slow.test.ts
  • packages/engine/src/__tests__/reliability-interactions/branch-group-pr-sync.slow.test.ts
  • packages/engine/src/__tests__/reliability-interactions/branch-group-single-pr-e2e.slow.test.ts
  • packages/engine/src/__tests__/reliability-interactions/merge-request-cancel-on-hard-cancel.test.ts
  • packages/engine/src/__tests__/reliability-interactions/merge-runner-spawn-enoent-prevention.test.ts
  • packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.slow.test.ts
  • packages/engine/src/__tests__/reliability-interactions/soft-blocker-auto-finalize-interactions.real-git.test.ts
  • packages/engine/src/__tests__/reliability-interactions/starved-refinement-x-triage-poll.test.ts
  • packages/engine/src/__tests__/self-healing-already-merged.real-git.test.ts
  • packages/engine/src/__tests__/workspace-merger-lease.test.ts
  • packages/engine/src/__tests__/worktree-db-hydrate.test.ts
  • packages/engine/vitest.config.ts
💤 Files with no reviewable changes (16)
  • packages/engine/src/tests/branch-conflicts-zero-unique.test.ts
  • packages/engine/src/tests/reliability-interactions/branch-group-automerge-precedence.slow.test.ts
  • packages/engine/src/tests/reliability-interactions/branch-group-pr-sync.slow.test.ts
  • packages/engine/src/tests/reliability-interactions/merge-request-cancel-on-hard-cancel.test.ts
  • packages/engine/src/tests/reliability-interactions/branch-group-merge-routing.slow.test.ts
  • packages/engine/src/tests/self-healing-already-merged.real-git.test.ts
  • packages/engine/src/tests/reliability-interactions/soft-blocker-auto-finalize-interactions.real-git.test.ts
  • packages/engine/src/tests/reliability-interactions/shared-branch-group-lifecycle.slow.test.ts
  • packages/engine/src/tests/reliability-interactions/branch-group-single-pr-e2e.slow.test.ts
  • packages/engine/src/tests/merger-ai-dependency-install.slow.test.ts
  • packages/engine/src/tests/branch-conflicts-ghost-references.test.ts
  • packages/engine/src/tests/worktree-db-hydrate.test.ts
  • packages/engine/src/tests/merger-empty-cherry-pick-fallback.test.ts
  • packages/engine/src/tests/workspace-merger-lease.test.ts
  • packages/engine/src/tests/reliability-interactions/merge-runner-spawn-enoent-prevention.test.ts
  • packages/engine/src/tests/merger-autostash-orphan-surface.test.ts

gsxdsm added 3 commits July 26, 2026 07:17
Fix the always-red starved-refinement FIFO poll fixture (peer todos need PROMPT.md),
replace the expired SQLite FN-5743 suite with PG moveTask + unit coverage, delete
expired quarantine/value-audit dead weight (~34s), and clear exclude/ledger drift.
Peer todo PROMPT.md keeps unplanned peers out of the admission queue so FN-R1
surfaces within seven polls; re-home hard-cancel merge-request checks on the
real PG moveTask path and drop expired vitest excludes without ledger entries.
Add hard-cancel-merge-request.pg.test.ts to packages/core test:pg-gate so
merge-blocking CI covers the user hard-cancel merge-request path. Assert the
persisted task lands in todo, not only MR cancelled / handoff-marker cleared.
@gsxdsm
gsxdsm force-pushed the feature/speed-up-ci branch from 5223756 to 1f57f75 Compare July 26, 2026 14:18
Comment thread packages/core/package.json Outdated
Remove hard-cancel-merge-request.pg.test.ts from test:pg-gate so the FN-8497
allowlist policy stays green; coverage remains on the non-blocking core PG lane.
Assert transient merge retry actually schedules internalEnqueueMerge after the
backoff timer.
@gsxdsm

gsxdsm commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

Review feedback follow-up

Addressed the open Greptile P1 (PG gate allowlist) in 659f612ab:

  • Reverted hard-cancel-merge-request.pg.test.ts from test:pg-gate so the FN-8497 two-file canary policy stays green (engine-vitest-gate-policy + pnpm test:gate both pass locally).
  • Left FN-5743 hard-cancel coverage on the non-blocking core PG discovery lane (still asserted with column === "todo").
  • Strengthened maybe-retry-transient-merge to assert internalEnqueueMerge("FN-5743") after advancing the 5s backoff timer.

All review threads resolved.

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