feat(KB-093): add PR-first merge mode with configurable merge strategies

- Add mergeStrategy setting (fast-forward, squash, merge-commit) to config
- Implement PR-first auto-completion flow that monitors PR merge status
- Wire PR monitoring service to detect merge completion and trigger auto-close
- Add PR status UI to dashboard with merge progress indicator
- Update settings modal with merge strategy selector
- Add changeset for PR-first merge mode feature
This commit is contained in:
gsxdsm
2026-03-29 23:13:24 -07:00
parent 94f599a3df
commit fd9a1b186a
27 changed files with 1715 additions and 109 deletions

View File

@@ -384,6 +384,19 @@ describe("TaskStore", () => {
});
});
describe("mergeStrategy setting", () => {
it("defaults mergeStrategy to direct for backward compatibility", async () => {
const settings = await store.getSettings();
expect(settings.mergeStrategy).toBe("direct");
});
it("persists mergeStrategy and returns it via getSettings", async () => {
await store.updateSettings({ mergeStrategy: "pull-request" });
const settings = await store.getSettings();
expect(settings.mergeStrategy).toBe("pull-request");
});
});
// ── Concurrent stress test ───────────────────────────────────────
describe("concurrent stress", () => {

View File

@@ -23,6 +23,7 @@ export const COLOR_THEMES = [
export type ColorTheme = (typeof COLOR_THEMES)[number];
export type PrStatus = "open" | "closed" | "merged";
export type MergeStrategy = "direct" | "pull-request";
export interface PrInfo {
url: string;
@@ -195,6 +196,12 @@ export interface Settings {
pollIntervalMs: number;
groupOverlappingFiles: boolean;
autoMerge: boolean;
/** How completed in-review tasks should be finalized when autoMerge is enabled.
* - "direct": preserve the existing local squash-merge flow into the current branch
* - "pull-request": create or reuse a GitHub PR and wait for GitHub-side checks/reviews
* before merging through GitHub
* Default: "direct" for backward compatibility. */
mergeStrategy?: MergeStrategy;
/** Shell command to run inside each new worktree immediately after creation.
* Useful for project-specific setup (e.g. `pnpm install`, `cp .env.local .env`). */
worktreeInitCommand?: string;
@@ -271,6 +278,7 @@ export const DEFAULT_SETTINGS: Settings = {
pollIntervalMs: 15000,
groupOverlappingFiles: false,
autoMerge: true,
mergeStrategy: "direct",
worktreeInitCommand: undefined,
recycleWorktrees: false,
worktreeNaming: "random",