feat(FN-5359): add push-to-origin button and hook to merge advance notice

Adds a push-to-origin workflow to the merge notice system, introducing a new `useMergeAdvanceNotice` hook, a `merge-advance-push-origin` route handler, and corresponding UI affordance in the `MergeAdvanceNotice` banner component. The engine gains TOCTOU and refusal audit assertions, and coverage exp

Fusion-Task-Id: FN-5359

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5359
This commit is contained in:
gsxdsm
2026-05-23 05:59:25 -07:00
parent 687237bd91
commit e5357a4afd
17 changed files with 1074 additions and 323 deletions

View File

@@ -92,7 +92,7 @@ describe("run-audit provisioning mutation types", () => {
const store = new AuditStoreStub();
const auditor = createRunAuditor(store as unknown as TaskStore, { runId: "r1", agentId: "a1", taskId: "FN-5358" });
const types: GitMutationType[] = ["pull:fast-forward", "stash:pop-conflict"];
const types: GitMutationType[] = ["pull:fast-forward", "stash:pop-conflict", "push:origin"];
for (const type of types) {
await auditor.git({ type, target: "feature/worktree", metadata: { taskId: "FN-5358" } });
}

View File

@@ -7914,6 +7914,15 @@ describe("FN-5335 triple-proof no-action unit coverage", () => {
expect((store as any).recordRunAuditEvent).toHaveBeenCalledWith(expect.objectContaining({ mutationType: "task:reclaim-self-owned-branch-conflict-no-action" }));
});
it("returns active merge task id via public accessor", () => {
const manager = new SelfHealingManager(createMockStore(), {
rootDir: "/tmp/test-project",
getActiveMergeTaskId: () => "FN-MERGE",
});
expect(manager.getActiveMergeTaskId()).toBe("FN-MERGE");
});
it("emits finalize-no-op-review no-action when unproven fallback fails triple proof", async () => {
const store = createMockStore({
getSettings: vi.fn().mockResolvedValue({ autoMerge: true, globalPause: false, enginePaused: false } as any),