@gitkraken/conflict-tools 0.2.4-beta.12 → 0.2.4-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
9
9
 
10
10
  ### Added
11
11
 
12
+ - Cross-file fixes in the fix phase (opt-in `ResolverConfig.fix`). After per-file convergence, a project-tier broken reference (an import/cross-file use whose target stopped resolving) is routed to the refine of its **use-site** file: the finding becomes a fix instruction, and the whole set is re-detected, up to `crossFileMaxIterations` rounds (default 2). Each cross-file fix is a single refine pass plus a mandatory per-file re-validation; the final whole-set detection also re-checks per-file for files a cross-file fix touched. **Limitation:** only use-site files that have an AI resolution are routed — a cross-file break landing on an auto-merged file (no resolution to carry the edit) is reported but not auto-fixed yet (needs a patches channel). The definition side, if broken, arrives as its own finding on its own file. Report-only (fix off) is unchanged.
12
13
  - Per-file fix loop (opt-in via `ResolverConfig.fix`, default `false`). When enabled, an AI-resolved (`strategy: 'ai'`) text file that carries error-severity per-file findings is routed back through refine: the findings become fix instructions, the file is re-analyzed after each edit, and the loop repeats until the file is clean, a round makes no progress, or `fixLoopMaxIterations` (default 3) is reached. Whatever it cannot fix stays in the findings, so the verdict reflects the post-fix state. The no-markers invariant holds (a fix that reintroduces markers is discarded). New progress events `fix:started` / `fix:completed`. Report-only (fix off) is unchanged. Deferred for the opt-in fix path: rebase per-step-ref/transient discipline, parser/validator call caching, cross-file fixes, and a full finding-lifecycle model (double-counting is handled here by fingerprint dedup when folding findings into the report).
13
14
  - `collectFileFindings` — a per-file detection unit (structural + intra-file broken references + consumer validator issues, all `tier: 'file'`) over already-loaded parent snapshots; the fix loop re-runs it after each edit. `detect()` remains the authoritative whole-set report.
14
15
  - Reference-integrity detection. `resolveConflicts` now attaches a `StepResult.detection` report listing broken references (symbols that resolved in a pre-merge parent but no longer resolve in the merged result, with provenance), duplicate definitions, and syntax errors in the resolved files. Detection is opt-in via a new `ParserPort` (`ResolverDeps.parser`) that supplies parsing/symbol resolution per surface (tree-sitter, language server); when it is absent, unavailable, or a file's language is unsupported, the report says so rather than implying a clean result. Report-only in this release — no automatic fixing.
@@ -41,6 +41,9 @@ interface ResolverConfig {
41
41
  fix?: boolean;
42
42
  /** Max per-file fix iterations (refine → re-detect the file) when `fix` is on. Default 3. */
43
43
  fixLoopMaxIterations?: number;
44
+ /** Max cross-file fix rounds (route project-level breaks to their use-site file → re-detect the whole
45
+ * set) when `fix` is on. Default 2. */
46
+ crossFileMaxIterations?: number;
44
47
  }
45
48
  //#endregion
46
49
  export { ConflictModelMessage, ConflictModelParams, ConflictModelPort, ConflictModelResult, ResolverConfig };
@@ -1,4 +1,6 @@
1
- import { Resolution } from "../types/resolution.js";
1
+ import { ConflictGitPort } from "../ports/git.js";
2
+ import { DetectionReport } from "../types/findings.js";
3
+ import { Resolution, ResolutionContext } from "../types/resolution.js";
2
4
  import { ConflictModelPort, ResolverConfig } from "../ports/model.js";
3
5
  import { ParserPort } from "../ports/parser.js";
4
6
  import { Validator } from "../ports/verify.js";
@@ -24,5 +26,25 @@ interface FixLoopDeps {
24
26
  * caller should invoke this only for AI-resolved (`strategy: 'ai'`) text files.
25
27
  */
26
28
  declare function runFixLoop(resolution: Resolution, oursContent: string | undefined, theirsContent: string | undefined, deps: FixLoopDeps): Promise<Resolution>;
29
+ interface FixPhaseDeps {
30
+ model: ConflictModelPort;
31
+ git: ConflictGitPort;
32
+ parser: ParserPort;
33
+ validator?: Validator;
34
+ config?: ResolverConfig;
35
+ onProgress?: (event: ConflictProgressEvent) => void;
36
+ signal?: AbortSignal;
37
+ }
38
+ /**
39
+ * The fix phase (opt-in). Stage 2: per-file convergence over each AI resolution ({@link runFixLoop}).
40
+ * Stage 3: route cross-file (`tier: 'project'`) broken references back to the refine of their use-site
41
+ * file and re-detect over the whole set, up to `crossFileMaxIterations` rounds. Mutates `resolutions`
42
+ * in place and returns the final whole-set {@link DetectionReport} — which, being whole-set, also
43
+ * re-checks per-file for files touched by cross-file fixes.
44
+ *
45
+ * Cross-file findings on files without an AI resolution (e.g. auto-merged) are not routed: they have no
46
+ * carrier for an edit yet (needs a patches channel), so they remain in the report unchanged.
47
+ */
48
+ declare function runFixPhase(resolutions: Resolution[], context: ResolutionContext, deps: FixPhaseDeps): Promise<DetectionReport>;
27
49
  //#endregion
28
- export { FixLoopDeps, runFixLoop };
50
+ export { FixLoopDeps, FixPhaseDeps, runFixLoop, runFixPhase };
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/conflict-tools",
3
- "version": "0.2.4-beta.12",
3
+ "version": "0.2.4-beta.13",
4
4
  "description": "AI-powered git conflict resolution.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Axosoft, LLC dba GitKraken",