Conflictfix

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 3, 2026

将合并冲突块分类为安全的机械式解决方案或有风险的;有风险的冲突块保持手动处理。

AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。

原文描述

Classify merge-conflict hunks as safe mechanical resolutions or risky; risky hunks stay manual.

已验证STDIO仅桌面

概览

Conflictfix 的本地 MCP 服务;无需登录;STDIO。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Conflictfix,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

conflictfix

A merge conflict already exists, and the question for each hunk in it is narrow: can this one be resolved mechanically, or does a human need to look at it? conflictfix answers hunk by hunk. You supply the file path and, for every hunk, the three line lists a three-way merge works from — the common ancestor's lines (base), your side's lines (ours), and their side's lines (theirs) — and it classifies each hunk, returning the resolved lines for the ones that are safe and leaving the risky ones alone.

Four classes are safe. When ours and theirs are exactly the same, the hunk is identical and resolves to those lines, however they differ from base. When only one side moved — ours still equals base, so the hunk is theirs_only and resolves to theirs, or theirs still equals base, so the hunk is ours_only and resolves to ours — the side that changed wins outright, including when it deleted every line. When the two sides differ only in whitespace, the hunk is whitespace_only and resolves to ours echoed verbatim, spacing and all: normalization decides the class, it never rewrites the lines. Everything else is conflict: not safe, resolution null, and never auto-merged by this tool.

The checks run in that fixed order and the first match wins, so a hunk where all three lists agree is identical, not ours_only, and a one-sided change that also happens to be whitespace-equal is reported as the one-sided change it is. Whitespace normalization trims each line, drops leading and trailing entries that are empty after trimming, and joins what remains with newlines. Interior blank lines are preserved by that process, so a blank line appearing in the middle of one side only is a real difference and the hunk is a conflict, not a whitespace difference.

The result echoes the path, carries one entry per input hunk with its 0-based index, class, safe flag, and resolution, and totals the outcome: safe_count, risky_count, and fully_resolvable, which is true exactly when no hunk is risky. Malformed input — a missing, empty, or non-string path, a missing, non-array, or empty hunks list, a hunk that is not an object, a missing or non-array base, ours, or theirs, or any line that is not a string — is a validation error naming the offending path, such as hunks[2].ours[0] must be a string, with no partial result. Unknown extra fields are ignored, including inside hunk items. The computation is pure and local: no repository is read, no merge is performed, and no files are touched.

CLI

bash
npx @reneturcios/conflictfix triage --input args.jsonnpx @reneturcios/conflictfix --version

args.json contains the full arguments object:

json
{  "path": "src/app.ts",  "hunks": [    {      "base": ["const x = 1;"],      "ours": ["const x = 1;"],      "theirs": ["const x = 2;"]    },    {      "base": ["return a;"],      "ours": ["return b;"],      "theirs": ["return c;"]    }  ]}

The result is printed as JSON:

json
{  "path": "src/app.ts",  "hunks": [    {      "index": 0,      "class": "theirs_only",      "safe": true,      "resolution": ["const x = 2;"]    },    {      "index": 1,      "class": "conflict",      "safe": false,      "resolution": null    }  ],  "safe_count": 1,  "risky_count": 1,  "fully_resolvable": false}

Exit codes: 0 on success, 1 on a runtime error (including an unreadable or invalid input file, or invalid input), 2 on a usage error.

MCP server

bash
npx -y @reneturcios/conflictfix mcp

MCP client config:

json
{  "mcpServers": {    "conflictfix": {      "command": "npx",      "args": ["-y", "@reneturcios/conflictfix", "mcp"]    }  }}

Tools

  • triage_conflicts — Triage a three-way merge conflict: classify each hunk as a safe mechanical resolution or risky from caller-supplied base, ours, and theirs lines. Safe hunks return their resolved lines; risky hunks are never auto-merged.

    • path (string, required, non-empty) — file path the conflict hunks belong to
    • hunks (array, required, at least 1 item) — conflict hunks to triage; each item carries:
      • base (array of strings, required, may be empty) — lines from the common ancestor
      • ours (array of strings, required, may be empty) — lines from our side
      • theirs (array of strings, required, may be empty) — lines from their side

    Returns {path, hunks, safe_count, risky_count, fully_resolvable}, where each entry in hunks is {index, class, safe, resolution} with class one of identical, theirs_only, ours_only, whitespace_only, or conflict.

Docker

bash
docker run -i ghcr.io/cloudcorprecords/conflictfixdocker run --rm -v "$PWD:/w" ghcr.io/cloudcorprecords/conflictfix triage --input /w/args.json

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (pure local, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

来源:README.md,提交 5760fba

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Nov 3, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分